mysql-deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql2
  template:
    metadata:
      labels:
        app: mysql2
    spec:
      containers:
      - name: mysql2
        image: mysql:5.7
        volumeMounts:
        - name: mysql
          mountPath: /var/lib/mysql/
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: mysql
        ports:
        - containerPort: 3306
      volumes:
      - name: mysql
        hostPath:
          path: /mysql

 

上一篇:tomcat mysql 练习


下一篇:创建harbor的secret和harbor进行通信(yaml格式)