apiVersion: apps/v1
kind: Deployment
metadata:
 name: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 1
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.17-alpine
          command: ["/bin/sh", "-c", "touch /usr/share/nginx/html/index.php; nginx -g 'daemon off;'"]
          ports:
            - containerPort: 80
          
        #   resources:
        #     requests:
        #       memory: "100Mi"
        #       cpu: "200m"
        #     limits:
        #       cpu: "250m"
        #       memory: "200Mi"
          
          volumeMounts:
          - mountPath: /etc/nginx/conf.d
            name: nginx-conf
            readOnly: true

      volumes:
      - name: nginx-conf
        configMap:
          name: nginx-conf
          items:
            - key: nginx.conf
              path: nginx.conf