apiVersion: apps/v1   # every object has an apiVersion which allows to support objects of different version / capabilities
                      # every kubernetes release has support for specific versions of objects
kind: Deployment      # the type of the object
metadata:
  name: demo-app      # every object must have a name
                      # additional metadata is used for monitoring / filtering / management of objects
  labels:
    app: demo-app
  annotations:
    example-long-description: |
      Hello,
      World!
spec:                 # every object has a spec which contains the specific configuration for this object
  selector:           # the deployment selector must match the labels in the template labels below
    matchLabels:
      app: demo-app
  replicas: 2         # how many pods should this deployment create and manage
  template:           # this is a template for all the pods this deployment will create and manage
    metadata:
      # the pod template doesn't have a name because it will be auto-generated by the deployment/replicaset
      labels:         # the labels must match the deployment selector
        app: demo-app
    spec:             # this is the spec for the pods this deployment will create
      containers:     # list of containers in this pod
      - name: nginx
        image: orihoch/demo-app-1-nginx   # this is the image we built and pushed previously from 001-docker/nginx
                                          # you can orihoch change to your docker username (but not required)
        ports:
        - containerPort: 80   # this doesn't expose the port anywhere, but is required to connect later
