---
# Deploys the container as a single pod in the Kubernetes Cluster
# 
# kubectl create -f webapp-deployment.yml
# 
# This is how we validate that it is working
# kubectl describe deployment nginx-webapp -n p20-webapps
#
# This is how to remove this deployment
# kubectl delete deployment nginx-webapp -n p20-webapps
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-webapp
  namespace: p20-webapps
  labels:
    k8s-app: nginx-webapp
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: nginx-webapp
  template:
    metadata:
      labels:
        k8s-app: nginx-webapp
    spec:
      containers:
      - name: nginx-webapp
        image: izzyacademy/nginxserver:v1
        env:
          - name: P20_YEAR
            value: "2018"
          - name: P20_MONITORING_ENABLED
            value: "false"
          - name: P20_SECURITY_ENABLED
            value: "false"
        ports:
        - containerPort: 80
          name: ui
          protocol: TCP