You can seamless zero trust, secret-less access to Planetscale or any SaaS MySQL-based database (read more about MYSQL
Services here) without having to share and manage passwords and roles (read more about secret-less access here).
First we need to create a Secret for the database's password as follows:
octeliumctl create secret psdb-password
Now we use the database information (namely the address, user, database and the password Secret name) to create a Service for our database as follows:
1kind: Service2metadata:3name: psdb4spec:5mode: MYSQL6port: 33067config:8upstream:9url: mysql://aws.connect.psdb.cloud10mysql:11user: <USER>12database: <DB>13auth:14password:15fromSecret: psdb-password16isTLS: true
You can now apply the creation of the Service as follows (read more here):
octeliumctl apply /PATH/TO/SERVICE.YAML
Note that you can also provide dynamic secret-less access where you can set different users, databases and passwords for different Users under different contexts. Read more about dynamic configuration here.
Now after connecting to the Cluster via the octelium connect
command (read more about connecting to Clusters here), we can access the database with whatever relevant tool such as the mysql
CLI as follows:
mysql -h psdb