apiVersion: apps/v1
kind: Deployment
metadata:
  #name: kubia-deploy # no need to include app version name
  name: backend
  namespace: chp16-set1633
spec:
  replicas: 1
  selector:
    matchLabels:
      #app: kubia-deploy # match spec.template.metadata.labels
      app: backend
  template:
    metadata:
      #name: kubia-deploy
      name: backend
      labels:
        # app: kubia-deploy # match spec.selector.matchLabels
        app: backend
    spec:
  
#      affinity:
#        nodeAffinity:
#          preferredDuringSchedulingIgnoredDuringExecution:
#          - weight: 80
#            preference:
#              matchExpressions:
#                values:
#                - zone1
#          - weight: 20
#            preference:
#              matchExpressions:
#              - key: share-type
#                operator: In
#                values:
#                - dedicated      

      # allow the pod to be scheduled to production nodes
#      tolerations:
#      - key: node-type
#        operator: Equal
#        value: production
#        effect: NoSchedule

      securityContext:
        runAsUser: 1000
        runAsNonRoot: true
      serviceAccountName: foo
      containers:
      - image: georgebaptista/kubia
        name: kubia-deploy 
        securityContext:
          allowPrivilegeEscalation: false
          privileged: false
          runAsNonRoot: true
          runAsUser: 1000 
        resources:
          limits:
            cpu: 200m
          requests:
            cpu: 100m
            #memory: "56Mi"
          #limits:
          #  cpu: 100m
            #memory: "56Mi"
