# Nginx deployment with HPA that scales when the CPU usage
# exceeds 25% with a max of 10 replicas
#
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-nginx
  labels:
    app: nginx
spec:
  replicas: 10
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        env:
        - name: VAR1
          valueFrom:
            secretKeyRef:
              name: pdsecret
              key: var1
        - name: VAR2
          valueFrom:
            secretKeyRef:
              name: pdsecret
              key: var2
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: 100m
          requests:
            cpu: 50m
        volumeMounts:
        - name: foo
          mountPath: "/etc/pd"
          readOnly: true
      volumes:
      - name: foo
        secret:
          secretName: pdsecret

