Provisioning a Scalingo for MySQL® Dedicated Resources Database
You can provision a MySQL® Dedicated Resources database using the dashboard, CLI, Terraform Provider or Kubernetes Operator.
Provisioning
Using the Dashboard
- From your web browser, open your dashboard
- Select the Project where you want to create the database
- Click the arrow next to Create an application, then click Database Dedicated Resources
- In the Databases engines section, select MySQL Dedicated Resources and confirm your choice
- Enter a database name, then select or confirm the appropriate Project and Region
- Select the plan you want to provision and confirm your selection
- Review the database configuration, then click the Create database button to confirm it and start provisioning
- Database provisioning typically takes 15–30 minutes
Using the Command Line (Preview)
Because Dedicated Resources databases are not yet generally available, you must first enable preview features to use the related CLI commands:
export SCALINGO_PREVIEW_FEATURES=true
- Make sure you have correctly setup the Scalingo command line tool
- From the command line, list the plans available for
mysql-dr:scalingo database-list-plans mysql-drThe output should look like this:
+-----------------------+------------+ | ID | NAME | +-----------------------+------------+ | mysql-dr-starter-8192 | Starter 8G | ... - Locate the
IDcorresponding to the plan you want to deploy (for examplemysql-dr-starter-8192) - Provision the database:
scalingo database-create --type mysql-dr --plan <plan_ID> <database_name>The output should look like this:
-----> Your mysql-dr database 698e082f968c27dfb8a27521 ('my-dedicated-database') is being provisioned… - Database provisioning typically takes 15–30 minutes
Optionally you can use --wait in order to make the command synchronous.
scalingo database-create --type mysql-dr --plan <plan_ID> --wait <database_name>
Using the Terraform Provider
- Place the following
resourceblock in your Terraform file to create the database:resource "scalingo_database" "my-dedicated-database" { name = "my-dedicated-database" technology = "mysql-dr" plan = "mysql-dr-starter-8192" }In this example, we create a dedicated MySQL Starter 8192 database named
my-dedicated-database. We could have done the same with another plan. - Run
terraform planand check if the result looks good - If so, run
terraform apply - Database provisioning typically takes 15–30 minutes
Using the Kubernetes Operator
-
Deploy the Scalingo Kubernetes Operator in your cluster using the installation manifest
install.yamlfrom the latest release. -
Create a Scalingo API token and store it in a Kubernetes Secret, as documented in Create Secret.
-
Create a custom resource to provision your dedicated MySQL database:
apiVersion: databases.scalingo.com/v1 kind: MySQL metadata: labels: app.kubernetes.io/name: scalingo-operator app.kubernetes.io/managed-by: kustomize name: my-dedicated-database spec: # Secret read by operator authSecret: name: scalingo key: api_token # Secret written by operator connInfoSecretTarget: name: my-dedicated-database-secret prefix: MYSQL # Network configuration networking: internet_access: enabled: true outscale: oks: net_peering: false firewall: rules: - type: "custom_range" cidr: "198.51.100.25/32" label: "My workstation" name: my-dedicated-database plan: mysql-dr-starter-8192 region: osc-fr1This example provisions a dedicated MySQL database named
my-dedicated-databaseon themysql-dr-starter-8192plan and writes its connection information to themy-dedicated-database-secretKubernetes Secret. You can use anothermysql-dr-*plan instead. -
Apply the resource and wait for provisioning to complete:
kubectl apply -f my-dedicated-database.yaml -
Database provisioning typically takes 15–30 minutes
To read the database URL from the generated secret:
kubectl describe secret my-dedicated-database-secret
kubectl get secret my-dedicated-database-secret -o jsonpath='{.data}' | grep MYSQL
For a complete manifest (including all available fields), use the official MySQL sample resource.
Accessing the Scalingo for MySQL® Dashboard
Every MySQL® database comes with its dedicated dashboard, generally referred to as database dashboard, which is the central place for administrative tasks such as:
- Monitoring the database through logs, metrics and statistics
- Upgrading the database engine version
- Managing database users
- Managing Collaborators
- Using multiple databases
- Managing backups
You can access the database dashboard from your project:
- From your web browser, open your dashboard
- Open the Project containing the database you want to manage
- In the Databases section, click the database name