apiVersion: apps/v1
kind: Deployment
metadata: # info to help identify object
  name: api
  labels: # arbitrary key value pairs to provide objects with meaning
    name: api
    maturityStage: dev
    release: stable
    teir: backend

spec: # desired state for object
  selector:
    matchLabels: # label selectors are intended to match multiple objects
      name: api
  replicas: 3
  template:
    metadata:
      labels:
        name: api
    spec:
      containers:
        - name: api-container
          image: walkerrandolphsmith/hello-container-orchastration-with-k8s:1.0
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
          env:
            - name: GET_HOSTS_FROM
              value: dns
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name # Expose pod information to container via DownwardAPI
          ports:
            - containerPort: 3000
