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

2022-03-04 15:23:56 浏览数 (1)

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

答案2022-03-01:

yaml如下:

代码语言:javascript复制
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](https://gitee.com/moonfdd/k8syaml/blob/master/moonfdd/phpmyadmin.yaml)

0 人点赞