apiVersion: apps/v1
kind: Deployment
metadata:
  name: echoserver
  labels:
    app: echoserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: echoserver
  template:
    metadata:
      labels:
        app: echoserver
    spec:
      imagePullSecrets:
        - name: dockerregcred
      containers:
        - name: echoserver
          image: docker.io/openresty/openresty:1.19.3.1-alpine
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 8080
          volumeMounts:
            - name: config
              mountPath: /usr/local/openresty/nginx/conf/nginx.conf
              subPath: nginx.conf
      volumes:
        - name: config
          configMap:
            name: echoserver-nginx-config
