Mysql_exporter on k8s

I have been using mysql_exporter on k8s for a long time now. I am in a testing environment and I have migrated our DB to Planetscale. When trying to connect to the DB is keeps giving me:

"caller=exporter.go:149 level=error msg=“Error pinging mysqld” err=“Error 1105: unknown error: Code: UNAVAILABLE\nserver does not allow insecure connections, client must use SSL/TLS\n”

I do not use “DATA_SOURCE_NAME” env var because I have the .cnf mounted already.
I Have tried using a configmap for the .my.cnf which mounts correctly in ~/ and looks as follows:

apiVersion: v1
kind: ConfigMap
metadata:
name: prom-mysql-config
labels:
app: prom-mysql-exporter
data:
.my.cnf: |
[client]
user=exporter
password=myhashedpassword
port=3306
host=my.planetscale.db
tls=true

The DB does not have SSL/TLS key/cert, we just accept the server side one normally.

Is there any client side variable/argument that needs to be added to accept the server SSL certificate

Kind Regards

I figured it out for those that are interested.
Add it to the environment variable at the end with ?tls=true:

env:

  • name: DB_PASSWORD
    valueFrom:
    secretKeyRef:
    name: prom-prometheus-mysql-exporter
    key: password
    - name: DATA_SOURCE_NAME
    value: “exporter:$(DB_PASSWORD)@(my.planetscale.db:3306)/your_database?tls=true”

Hope it helps
Regards