2022-03-01:k8s安装phpmyadmin,yaml如何写?

答案2022-03-01:

yaml如下:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: phpmyadmin
  name: phpmyadmin
  namespace: moonfdd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: phpmyadmin
  template:
    metadata:
      labels:
        app: phpmyadmin
    spec:
      containers:
        - env:
            - name: PMA_HOST
              value: mysql.fddtest
            - name: PMA_PORT
              value: '3306'
          image: phpmyadmin/phpmyadmin
          imagePullPolicy: IfNotPresent
          name: phpmyadmin
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: phpmyadmin
  name: phpmyadmin
  namespace: moonfdd
spec:
  ports:
    - name: 80-80
      port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: phpmyadmin
  type: NodePort

结果如下:

在这里插入图片描述 在这里插入图片描述 在这里插入图片描述


phpmyadmin的yaml