Kubernetes - can a Deployment have multiple ReplicaSets?











up vote
0
down vote

favorite












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



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?



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









share|improve this question






















  • A deployment per microservice is common; a real application might be made of several related Deployments and Services that point at their Pods.
    – David Maze
    Nov 10 at 22:44















up vote
0
down vote

favorite












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



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?



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









share|improve this question






















  • A deployment per microservice is common; a real application might be made of several related Deployments and Services that point at their Pods.
    – David Maze
    Nov 10 at 22:44













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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



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?



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









share|improve this question













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



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?



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






kubernetes containers microservices






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 22:26









HashRocketSyntax

473726




473726












  • A deployment per microservice is common; a real application might be made of several related Deployments and Services that point at their Pods.
    – David Maze
    Nov 10 at 22:44


















  • A deployment per microservice is common; a real application might be made of several related Deployments and Services that point at their Pods.
    – David Maze
    Nov 10 at 22:44
















A deployment per microservice is common; a real application might be made of several related Deployments and Services that point at their Pods.
– David Maze
Nov 10 at 22:44




A deployment per microservice is common; a real application might be made of several related Deployments and Services that point at their Pods.
– David Maze
Nov 10 at 22:44












2 Answers
2






active

oldest

votes

















up vote
2
down vote













It is meant to be a deployment of each microservice.



You can also manage the quantity of "deployed services" of each microservices type.
So for instance, if you want to deploy Service A (Docker image with an Java service) 5 times, you have a deployment resulting 5 pods. Each pod contains the image of Service A.



If you deploy a new version of this Service A (Docker image with an Java service), Kubernetes is able to do a rolling update and manage the shut down of the old Java service type (the existing pods) and creates 5 new pods with the new Java Service A.2 (a new docker image).



Thus your whole microservices application/infrastructure is build upon multiple deployments. Each generating Kubernetes pods, which are published by Kubernetes services.






share|improve this answer





















  • Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
    – HashRocketSyntax
    Nov 12 at 11:22










  • Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
    – Lennart Blom
    Nov 12 at 11:54


















up vote
-1
down vote













A deployment contains a single pod template, and generates one replicaset per revision






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244033%2fkubernetes-can-a-deployment-have-multiple-replicasets%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    It is meant to be a deployment of each microservice.



    You can also manage the quantity of "deployed services" of each microservices type.
    So for instance, if you want to deploy Service A (Docker image with an Java service) 5 times, you have a deployment resulting 5 pods. Each pod contains the image of Service A.



    If you deploy a new version of this Service A (Docker image with an Java service), Kubernetes is able to do a rolling update and manage the shut down of the old Java service type (the existing pods) and creates 5 new pods with the new Java Service A.2 (a new docker image).



    Thus your whole microservices application/infrastructure is build upon multiple deployments. Each generating Kubernetes pods, which are published by Kubernetes services.






    share|improve this answer





















    • Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
      – HashRocketSyntax
      Nov 12 at 11:22










    • Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
      – Lennart Blom
      Nov 12 at 11:54















    up vote
    2
    down vote













    It is meant to be a deployment of each microservice.



    You can also manage the quantity of "deployed services" of each microservices type.
    So for instance, if you want to deploy Service A (Docker image with an Java service) 5 times, you have a deployment resulting 5 pods. Each pod contains the image of Service A.



    If you deploy a new version of this Service A (Docker image with an Java service), Kubernetes is able to do a rolling update and manage the shut down of the old Java service type (the existing pods) and creates 5 new pods with the new Java Service A.2 (a new docker image).



    Thus your whole microservices application/infrastructure is build upon multiple deployments. Each generating Kubernetes pods, which are published by Kubernetes services.






    share|improve this answer





















    • Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
      – HashRocketSyntax
      Nov 12 at 11:22










    • Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
      – Lennart Blom
      Nov 12 at 11:54













    up vote
    2
    down vote










    up vote
    2
    down vote









    It is meant to be a deployment of each microservice.



    You can also manage the quantity of "deployed services" of each microservices type.
    So for instance, if you want to deploy Service A (Docker image with an Java service) 5 times, you have a deployment resulting 5 pods. Each pod contains the image of Service A.



    If you deploy a new version of this Service A (Docker image with an Java service), Kubernetes is able to do a rolling update and manage the shut down of the old Java service type (the existing pods) and creates 5 new pods with the new Java Service A.2 (a new docker image).



    Thus your whole microservices application/infrastructure is build upon multiple deployments. Each generating Kubernetes pods, which are published by Kubernetes services.






    share|improve this answer












    It is meant to be a deployment of each microservice.



    You can also manage the quantity of "deployed services" of each microservices type.
    So for instance, if you want to deploy Service A (Docker image with an Java service) 5 times, you have a deployment resulting 5 pods. Each pod contains the image of Service A.



    If you deploy a new version of this Service A (Docker image with an Java service), Kubernetes is able to do a rolling update and manage the shut down of the old Java service type (the existing pods) and creates 5 new pods with the new Java Service A.2 (a new docker image).



    Thus your whole microservices application/infrastructure is build upon multiple deployments. Each generating Kubernetes pods, which are published by Kubernetes services.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 10 at 22:58









    Lennart Blom

    16211




    16211












    • Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
      – HashRocketSyntax
      Nov 12 at 11:22










    • Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
      – Lennart Blom
      Nov 12 at 11:54


















    • Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
      – HashRocketSyntax
      Nov 12 at 11:22










    • Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
      – Lennart Blom
      Nov 12 at 11:54
















    Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
    – HashRocketSyntax
    Nov 12 at 11:22




    Well, the name Deployment is unfortunate, but at least it makes sense that you can upgrade a microservice
    – HashRocketSyntax
    Nov 12 at 11:22












    Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
    – Lennart Blom
    Nov 12 at 11:54




    Yup... but be warned. If you start adding Spinnaker.io to orchestrate your Kubernetes Cluster it gets even better. Kubernetes Deployments = Spinnaker Spinnaker Cluster, which contains Spinnaker Server Groups. Welcome to the world of continuous deployment! :)
    – Lennart Blom
    Nov 12 at 11:54












    up vote
    -1
    down vote













    A deployment contains a single pod template, and generates one replicaset per revision






    share|improve this answer

























      up vote
      -1
      down vote













      A deployment contains a single pod template, and generates one replicaset per revision






      share|improve this answer























        up vote
        -1
        down vote










        up vote
        -1
        down vote









        A deployment contains a single pod template, and generates one replicaset per revision






        share|improve this answer












        A deployment contains a single pod template, and generates one replicaset per revision







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 22:40









        Jordan Liggitt

        6,6412421




        6,6412421






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244033%2fkubernetes-can-a-deployment-have-multiple-replicasets%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues