Best CD strategy for Kubernetes Deployments

前端 未结 2 363
谎友^
谎友^ 2021-01-04 05:55

Our current CI deployment phase works like this:

  1. Build the containers.
  2. Tag the images as \"latest\" and < commit hash >
2条回答
  •  猫巷女王i
    2021-01-04 06:38

    We've been practising what we call GitOps for a while now.

    What we have is a reconciliation operator, which connect a cluster to configuration repository and makes sure that whatever Kubernetes resources (including CRDs) it finds in that repository, are applied to the cluster. It allows for ad-hoc deployment, but any ad-hoc changes to something that is defined in git will get undone in the next reconciliation cycle. The operator is also able to watch any image registry for new tags, an update image attributes of Deployment, DaemonSet and StatefulSet types of objects. It makes a change in git first, then applies it to the cluster.

    So what you need to do in CI is this:

    1. Build the containers.
    2. Tag the images as .
    3. Push images to repository.

    The agent will take care of the rest for you, as long you've connected it to the right config repo where the app Deployment object can be found.

    For a high-level overview, see:

    • Google Cloud Platform and Kubernetes
    • Deploy Applications & Manage Releases

    Disclaimer: I am a Kubernetes contributor and Weaveworks employee. We build open-source and commercial tools that help people to get to production with Kubernetes sooner.

提交回复
热议问题