apiVersion: apps/v1
kind: Deployment
metadata: 
  name: server-nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: server-nginx
  template:
    metadata:
      labels:
        app: server-nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.17-alpine
        ports:
        - containerPort: 80

        #resources:
        #  requests:
        #    memory: "100Mi"
        #    cpu: "200m"
        #  limits: 
        #    cpu: "250m"
        #    memory: "100Mi"

        volumeMounts: 
        - mountPath: /etc/nginx/conf.d
          name: nginx-conf
          readOnly: true
        - mountPath: /usr/share/nginx/html/
          name: nginx-conf

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