Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes: How to run MySQL command?

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

like image 366
Volatil3 Avatar asked Oct 29 '25 09:10

Volatil3


1 Answers

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
like image 92
Quentin Revel Avatar answered Oct 31 '25 02:10

Quentin Revel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!