Answers: <p>You can use kustomization to run kubectl commands/apply files and can achieve the deployment.</p>
  <p>However if you really want to get into the k8s ecosystem you can have look into the various tools available for a more controlled deployment workflow.</p>
  <ul>
  <li><strong>Packaging:-</strong> Manage/package your k8s objects.E.g <a href="https://helm.sh/" rel="nofollow noreferrer">Helm</a>,<a href="https://jsonnet.org/articles/kubernetes.html" rel="nofollow noreferrer">jsonnet</a></li>
  <li><strong>Helm Repository:-</strong> Centralised helm chart repository. Helm repo is to helm charts what docker is to ECR/GCR/DockerHub. E.g (<a href="https://chartmuseum.com/" rel="nofollow noreferrer">ChartMuseum</a>)</li>
  <li><strong>CI:-</strong> Upgrade your CI to publish Helm charts. Apart from this you can run your builds on k8s as well which provide parllelism/scale and cost reduction. E.g <a href="https://github.com/features/actions" rel="nofollow noreferrer">Github Action</a>/<a href="https://www.jenkins.io/doc/book/installing/kubernetes/" rel="nofollow noreferrer">Jenkins</a>.</li>
  <li><strong>CD:-</strong> Use A specialized CD tool to manage multi-cluster deployments. <a href="https://fluxcd.io/" rel="nofollow noreferrer">FluxCD</a>,<a href="https://argoproj.github.io/argo-cd/" rel="nofollow noreferrer">ArgoCD</a>,<a href="https://rancher.com/docs/rancher/v2.x/en/deploy-across-clusters/fleet/#:%7E:text=Fleet%20is%20a%20separate%20project,any%20combination%20of%20the%20three." rel="nofollow noreferrer">Fleet</a></li>
  <li><strong>CI/CD:-</strong> Use a complete delivery tool that fulfills needs of CI/CD. You can use this if you are starting the pipelines from scratch without any existing infra. Also look into the lock-in aspect of using a complete solution. (Might not fulfill all the use cases you may have. Sometimes using  bunch of tools is better). E.g <a href="https://jenkins-x.io/" rel="nofollow noreferrer">JenkinsX</a>/<a href="https://circleci.com/" rel="nofollow noreferrer">CircleCI</a></li>
  <li><strong>Secret Manager:-</strong> You will not want to hard-code senstive/environment related information in your CD pipelines. You can look into <a href="https://www.vaultproject.io/" rel="nofollow noreferrer">Vault</a>,<a href="https://github.com/bitnami-labs/sealed-secrets" rel="nofollow noreferrer">Sealed-Secrets</a> to manage secrets.</li>
  <li><a href="https://www.weave.works/technologies/gitops/" rel="nofollow noreferrer">GitOps</a>/Pull/Push formats</li>
  </ul>
  <p>This is not an exhaustive list, but will get you started on continuous delivery on k8s.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-07-01T23:21:31.713Z
Answers: 2021-07-01T23:21:31.713Z
Answers: rohatgisanat
Body: <p>I have an application (Django web app alongside couple of microservices) and have done deployment previously via Ansible tasks. Playbook was invoked from Ansible Tower and essentially breaks down into following steps</p>
  <ul>
  <li>pull desired docker image</li>
  <li>migrate database</li>
  <li>build js bundle / collect static</li>
  <li>restart application with docker compose</li>
  </ul>
  <p><strong>What is the best practice / preferred solution to have centralized control panel for deploys with k8s?</strong></p>
  <p>Do I need to just rewrite Ansible tasks which will render <code>kustomization</code> file with new image tag and the rest will be just invocations of <code>kubectl</code>? Appreciate any suggestions or related resources</p>
  <p>P.S. <a href="https://devops.stackexchange.com/questions/2843/how-do-i-automate-deployments-with-kubernetes">this one</a> haven't helped much</p>
  
Comments: CC BY-SA 4.0
Comments: 2021-06-11T13:09:19.103Z
Comments: Generally, GitOps is the way. See my tutorials here https://itnext.io/building-kubernetes-cicd-pipeline-with-github-actions-argocd-and-reliza-hub-e7120b9be870 and here https://worklifenotes.com/2021/05/22/helm-cd-with-reliza-hub-tutorial/ for example implementation options.
Comments: taleodor
Tags: <kubernetes><ansible><deployment><continuous-deployment><awx>
Title: Kubernetes deploy workflow
UserDisplayName: Most Wanted
ThreadText: # Kubernetes deploy workflow
  
  (Asked by: username_0 on 2021-06-11)
  
  I have an application (Django web app alongside couple of microservices) and have done deployment previously via Ansible tasks. Playbook was invoked from Ansible Tower and essentially breaks down into following steps
  
  * pull desired docker image
  * migrate database
  * build js bundle / collect static
  * restart application with docker compose
  
  **What is the best practice / preferred solution to have centralized control panel for deploys with k8s?**
  
  Do I need to just rewrite Ansible tasks which will render `kustomization` file with new image tag and the rest will be just invocations of `kubectl`? Appreciate any suggestions or related resources
  
  P.S. [this one](https://devops.stackexchange.com/questions/2843/how-do-i-automate-deployments-with-kubernetes) haven't helped much
  
  **Tags:** kubernetes, ansible, deployment, continuous-deployment, awx
  
  > **Comments:**
  > **username_1**: Generally, GitOps is the way. See my tutorials here https://itnext.io/building-kubernetes-cicd-pipeline-with-github-actions-argocd-and-reliza-hub-e7120b9be870 and here https://worklifenotes.com/2021/05/22/helm-cd-with-reliza-hub-tutorial/ for example implementation options.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-07-01. Score: 1 | Accepted answer
  
  You can use kustomization to run kubectl commands/apply files and can achieve the deployment.
  
  However if you really want to get into the k8s ecosystem you can have look into the various tools available for a more controlled deployment workflow.
  
  * **Packaging:-** Manage/package your k8s objects.E.g [Helm](https://helm.sh/),[jsonnet](https://jsonnet.org/articles/kubernetes.html)
  * **Helm Repository:-** Centralised helm chart repository. Helm repo is to helm charts what docker is to ECR/GCR/DockerHub. E.g ([ChartMuseum](https://chartmuseum.com/))
  * **CI:-** Upgrade your CI to publish Helm charts. Apart from this you can run your builds on k8s as well which provide parllelism/scale and cost reduction. E.g [Github Action](https://github.com/features/actions)/[Jenkins](https://www.jenkins.io/doc/book/installing/kubernetes/).
  * **CD:-** Use A specialized CD tool to manage multi-cluster deployments. [FluxCD](https://fluxcd.io/),[ArgoCD](https://argoproj.github.io/argo-cd/),[Fleet](https://rancher.com/docs/rancher/v2.x/en/deploy-across-clusters/fleet/#:%7E:text=Fleet%20is%20a%20separate%20project,any%20combination%20of%20the%20three.)
  * **CI/CD:-** Use a complete delivery tool that fulfills needs of CI/CD. You can use this if you are starting the pipelines from scratch without any existing infra. Also look into the lock-in aspect of using a complete solution. (Might not fulfill all the use cases you may have. Sometimes using bunch of tools is better). E.g [JenkinsX](https://jenkins-x.io/)/[CircleCI](https://circleci.com/)
  * **Secret Manager:-** You will not want to hard-code senstive/environment related information in your CD pipelines. You can look into [Vault](https://www.vaultproject.io/),[Sealed-Secrets](https://github.com/bitnami-labs/sealed-secrets) to manage secrets.
  * [GitOps](https://www.weave.works/technologies/gitops/)/Pull/Push formats
  
  This is not an exhaustive list, but will get you started on continuous delivery on k8s.
  
  
  ---
  
  