Kubernetes: How to run MySQL command?

1/4/2019

In Docker I can use the command: --default-authentication-plugin=mysql_native_password in docker-compose file. How do I pass this while creating a MySQL Deployment?

I am using MySQL8

-- Volatil3
devops
docker
kubernetes
mysql

1 Answer

1/4/2019

It could look like this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql-deployment
  labels:
    app: mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - name: mysql
        image: mysql:8
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: XXXXXXXXXXXXXXXX
        args: ["--default-authentication-plugin=mysql_native_password"]
        ports:
        - containerPort: 3306
-- Quentin Revel
Source: StackOverflow