Skip to main content
Feedback

Providing MySQL secrets

To connect to the APIM 5.x.x (migration source) and CAMLE 6.x.x (migration target) MySQL databases, provide these secrets mysql-secret-apim5 and mysql-secret-cam6 in templates/k8s/mysql-secret.yaml.

Provide the secrets in Kubernetes or Docker Swarm depending on whether your APIM 5.x.x cluster runs on Kubernetes or Docker Swarm. Refer to the following sections to provide secrets:

Kubernetes (Without Encryption)

Provide the mysql-secret-apim5 and mysql-secret-cam6 secrets in one file, migrate_5x_to_6/templates/k8s/mysql-secret.yaml, as two Secret objects separated by ---.

One for the APIM 5.x.x database (mysql-secret-apim5). For mysql-secret-apim5, each secret must contain the following attributes:

  • .apim_v5_username: MySQL username used by APIM 5.x.x.
  • .apim_v5_password: MySQL password used by APIM 5.x.x.

One for the CAMLE 6.x.x database (mysql-secret-cam6). For mysql-secret-cam6, each secret must contain the following attributes:

  • .cam_v6_username: MySQL username used by CAMLE 6.x.x.
  • .cam_v6_password: MySQL password used by CAMLE 6.x.x.

Procedure

  1. Base64 encode each credential:

    echo -n '<apim5-username>' | base64
    echo -n '<apim5-password>' | base64
    echo -n '<cam6-username>' | base64
    echo -n '<cam6-password>' | base64
  2. Fill in the YAML file (templates/k8s/mysql-secret.yaml) with the base64-encoded values. Do not change the secret name or attribute names. The migration pod looks them up by exact name.

    apiVersion: v1
    kind: SecretAfter obtaining your credentials, provide the secrets in:
    metadata:
    name: mysql-secret-apim5
    namespace: default
    type: Opaque
    data:
    # MySQL username used by APIM 5.x, base64 encoded: echo -n <username> | base64
    .apim_v5_username: <output of step 1>
    # MySQL password used by APIM 5.x, base64 encoded: echo -n <password> | base64
    .apim_v5_password: <output of step 1>
    ---
    apiVersion: v1
    kind: Secret
    metadata:
    name: mysql-secret-cam6
    namespace: default
    type: Opaque
    data:
    # MySQL username used by APIM 6.x, base64 encoded: echo -n <username> | base64
    .cam_v6_username: <output of step 1>
    # MySQL password used by APIM 6.x, base64 encoded: echo -n <password> | base64
    .cam_v6_password: <output of step 1>
  3. Apply the template before deploying the migration pod. One kubectl apply creates both Secret objects:

    kubectl apply -f migrate_5x_to_6/templates/k8s/mysql-secret.yaml
    note

    The MySQL host and port are not a secret. Set MYSQL_HOST_CAM6 and MYSQL_PORT_CAM6 in migration-override.env.

    Both MySQL secrets are mandatory. The migration pod (scripts/k8s/migration.yaml) projects them into its secrets volume, so a missing or misnamed secret blocks the pod from starting.

Docker Swarm

Provide each credential value, listed in the table below, in its corresponding template file located in migrate_5x_to_6/templates/swarm/:

Template fileCredential
migration-apim5-username.txtAPIM 5.x.x MySQL username
migration-apim5-password.txtAPIM 5.x.x MySQL password
migration-cam6-username.txtCAMLE 6.x.x MySQL username
migration-cam6-password.txtCAMLE 6.x.x MySQL password

After providing the credentials in the template files listed above, run the following commands to create the secrets in the cluster:

cd migrate_5x_to_6/templates/swarm

docker secret create migration-apim5-username migration-apim5-username.txt
docker secret create migration-apim5-password migration-apim5-password.txt
docker secret create migration-cam6-username migration-cam6-username.txt
docker secret create migration-cam6-password migration-cam6-password.txt

Next steps: Provide TLS setup

If your MySQL connection requires TLS, continue to Providing TLS setup.

On this Page