---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-pod-tpl
  labels:
    app: nginx-pod-tpl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-pod-tpl
  template:
    metadata:
      labels:
        app: nginx-pod-tpl
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80
#        volumeMounts:
#        - mountPath: /usr/share/nginx/html/index.html
#          name: nginx-pv-tpl
#          readOnly: True

#      volumes: 
#      - name: nginx-pv-tpl
#        hostPath:
#          path: /data/nginx/html/index.html
#          type: File

---
apiVersion: v1
kind: Service
metadata:
  name: nginx-svc-tpl
  labels:
    app: nginx-pod-tpl
spec:
  type: NodePort
  ports:
  - port: 80
    name: nginx-port-tpl
    protocol: TCP
    targetPort: 80
    nodePort: 80
  selector:
    app: nginx-pod-tpl
