时间:2021-07-01 10:21:17 帮助过:34人阅读
apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 kind: Deployment metadata: name: mysql spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:5.7 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: uwaynemya ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim
上述代码均可以在 haoprogrammer github 上找到
如果对您有帮助希望可以帮忙点颗星,感谢。
您的支持是我最大的动力!
kubernetes系列:(二)、kubernetes部署mysql(单节点)
标签:deploy rip targe 帮助 env str beta for pps