apiVersion: apps/v1
kind: Deployment
metadata:
  name: control-etherpad
  namespace: etherpad
spec:
  selector:
    matchLabels:
      app: control-etherpad
  template:
    metadata:
      labels:
        app: control-etherpad
    spec:
      containers:
      - env:
        - name: SKIN_NAME
          valueFrom:
            secretKeyRef:
              key: skin
              name: ether-secret
        - name: NODE_ENV
          valueFrom:
            secretKeyRef:
              key: env
              name: ether-secret
        - name: DB_TYPE
          valueFrom:
            secretKeyRef:
              key: db_type
              name: ether-secret
        - name: DB_HOST
          valueFrom:
            secretKeyRef:
              key: db_host
              name: ether-secret
        - name: DB_PORT
          valueFrom:
            secretKeyRef:
              key: db_port
              name: ether-secret
        - name: DB_NAME
          valueFrom:
            secretKeyRef:
              key: db_name
              name: ether-secret
        - name: DB_USER
          valueFrom:
            secretKeyRef:
              key: db_user
              name: ether-secret
        - name: DB_CHARSET
          valueFrom:
            secretKeyRef:
              key: db_charset
              name: ether-secret
        - name: PORT
          valueFrom:
            secretKeyRef:
              key: port
              name: ether-secret
        - name: DB_PASS
          valueFrom:
            secretKeyRef:
              key: db_password
              name: ether-secret
        - name: ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              key: admin_password
              name: ether-secret
        image: swr.cn-north-4.myhuaweicloud.com/opensourceway/common/etherpad:1.8.6
        imagePullPolicy: IfNotPresent
        name: control-etherpad
        ports:
        - containerPort: 9001
          name: https
          protocol: TCP
        volumeMounts:
        - mountPath: /opt/etherpad-lite/var
          name: data-volume
      volumes:
      - name: data-volume
        persistentVolumeClaim:
          claimName: cce-evs-etherpad