apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment-$TARGET_ROLE
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
      role: $TARGET_ROLE
  template:
    metadata:
      labels:
        app: nginx
        role: $TARGET_ROLE
    spec:
      containers:
      - name: nginx-$TARGET_ROLE
        image: $IMAGE_VERSION
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80
        readinessProbe:
          httpGet:
            path: /
            port: 80
        livenessProbe:
          httpGet:
            path: /
            port: 80
        resources:
          limits:
            memory: "128Mi" #128 MB
            cpu: "200m" #200 millicpu (.2 cpu or 20% of the cpu)