---
apiVersion: v1
kind: Service
metadata:
  name: adm-frontend
  labels:
    app: adm-frontend
spec:
  selector:
    app: adm-frontend
  ports:
    - port: 80
      targetPort: 80
      name: server-port

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: adm-frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: adm-frontend
  template:
    metadata:
      labels:
        app: adm-frontend
    spec:
      containers:
        - name: adm-frontend
          image: labisenlin.persagy.com/library/adm-frontend:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 80
              name: server-port
          resources:
            limits:
              memory: 1Gi
            requests:
              memory: 512Mi
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: SERVER_PORT
              value: "80"
          volumeMounts:
            - name: config
              mountPath: /etc/nginx/nginx.conf
              subPath: path/to/nginx.conf.js
      volumes:
        - name: config
          configMap:
            name: public-config
            defaultMode: 0777
            items:
              - key: nginx.conf
                path: path/to/nginx.conf.js