<p>Just finished reading Nigel Poulton's <strong>The Kubernetes Book</strong>. I'm left with the question of whether or not a Deployment can specify multiple ReplicaSets.</p>

<p>When I think Deployment, I think of it in the traditional sense of an entire application being deployed. Or is there meant to be a Deployment for each microservice?</p>

<pre><code>apiVersion: apps/v1beta2
kind: Deployment
metadata: 
  name: hello-deploy
spec:
  replicas: 10
  selector:
    matchLabels:
      app: hello-world
  minReadySeconds: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: hello-pod
        image: nigelpoulton/k8sbook : latest
        ports:
        - containerPort: 8080
</code></pre>

Kermit
<p>The replica sets can be multiple up to a limit of 10 based on the number of updates that have been done using deployment. But only one <code>replicaSet</code> (the latest one) should be showing the number of pods; all other older sets should be showing <code>0</code>.</p>
<p>We can set <code>revisionHistoryLimit</code> to specify how many old <code>replicaSet</code>s we want to retain:
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy" rel="noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy</a></p>
