<p>I have the following yaml file with replica set with 3 but when I deploy it on GKE in the yaml and in the console the number of replicas is only one.
When I deploy the pods are created but then are terminated. I forgot something?</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: xxx-nginx
  namespace: xxx
  labels:
    app: xxx-nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: xxx-nginx
  template:
    metadata:
      labels:
        app: xxx-nginx
    spec:
      volumes:
      - name: xxx-nginx
        configMap:
          name: xxx-nginx-configmap
      containers:
      - name: xxx-nginx
        image: nginx:1.15.3
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /etc/nginx/conf.d
          name: xxx-nginx
        readinessProbe:
          httpGet:
            path: /nginx-health
            port: 80
          initialDelaySeconds: 15
          timeoutSeconds: 1
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /nginx-health
            port: 80
          initialDelaySeconds: 15
          timeoutSeconds: 1
          periodSeconds: 10
        resources:
          requests:
            memory: 128Mi
            cpu: 100m
          limits:
            memory: 128Mi
            cpu: 100m
</code></pre>

<p>This is what I see on GCP console :</p>

<p><a href="https://i.stack.imgur.com/MtoQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MtoQU.png" alt="enter image description here"></a></p>

<p>[EDIT]</p>

<p>I also add the HPA :</p>

<pre><code>apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: xxxx-hpa
  namespace: xxx
  labels:
    app: xxx-hpa
spec:
  scaleTargetRef:
    kind: Deployment
    name: xxx-phpfpm
    apiVersion: apps/v1
  minReplicas: 1
  maxReplicas: 10
  targetCPUUtilizationPercentage: 60
</code></pre>

<p>Thank you, regards</p>

Alessandro Candon
<p>Thank you @apisim with his comment I found the problem...
The HPA commands, so if minReplicas is 1 there will be only one pod in production...</p>

<p>Thanks Regards</p>
