Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

DevOps Fest 2020. Дмитрий Кудрявцев. Реализация GitOps на Kubernetes. ArgoCD

20 views

Published on

Kubernetes став стандартом для обчислювальних платформ і багато хто вже адаптував цю платформу як основну. Особливістю цієї платформи є нетипова система управління конфігураціями.
На презентації ми розглянемо що являє собою декларативний конфігураційний менеджмент. Чому Kustomize для нас є найкращим інструментом. І як за допомогою ArgoCD розгорнути Kubeflow на Kubernetes кластері.

Published in: Education
  • Be the first to comment

  • Be the first to like this

DevOps Fest 2020. Дмитрий Кудрявцев. Реализация GitOps на Kubernetes. ArgoCD

  1. 1. GitOps on Kubernetes. Managing services with ArgoCD Dmytro Kudriavtsev
  2. 2. whoiam Over9000 20y in IT: Devops 5y Admin 13y Java/Python dev 2y
  3. 3. Typical pipeline
  4. 4. deploy-dev-qa..: sed -i "s~latest~$BRANCH-$SHORT_COMMIT~g" deployment.yaml kubectl apply -f deployment.yaml #wrong cluster credentials #kubectl apply -f deployment.yaml -n wrong_ns #kubectl delete ns qa
  5. 5. What is GitOps
  6. 6. Principles of GitOps ● The entire system described declaratively. ● The canonical desired system state versioned in Git. ● Approved changes that can be automatically applied to the system.
  7. 7. GitOps
  8. 8. Key benefits of GitOps ● Deploy faster and more often. ● Easy and fast error recovery. ● Easier credential management. ● Self-documenting deployments. ● Shared knowledge in teams.
  9. 9. ArgoCD Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. Argo CD is implemented as a kubernetes controller which continuously monitors running applications and compares the current, live state against the desired target state (as specified in the Git repo).
  10. 10. ArgoCD Features ● Web UI which provides real-time view of application activity ● Automated deployment of applications to specified target environments ● Support for multiple config management/templating tools (Kustomize, Helm, Ksonnet, Jsonnet, plain-YAML) ● Ability to manage and deploy to multiple clusters ● Rollback/Roll-anywhere to any application configuration committed in Git repository ● Health status analysis of application resources
  11. 11. ArgoCD Features ● Webhook integration (GitHub, BitBucket, GitLab) ● SSO Integration (OIDC, OAuth2, LDAP, SAML 2.0, GitHub, GitLab, Microsoft, LinkedIn) ● Automated or manual syncing of applications to its desired state ● CLI for automation and CI integration ● Multi-tenancy and RBAC policies for authorization ● Automated configuration drift detection and visualization ● Access tokens for automation ● PreSync, Sync, PostSync hooks to support complex application rollouts (e.g.blue/green & canary upgrades) ● Audit trails for application events and API calls ● Prometheus metrics ● Parameter overrides for overriding ksonnet/helm parameters in Git
  12. 12. Input Kubernetes manifests can be specified in several ways: ● Plain directory of YAML/json manifests ● helm charts ● kustomize applications ● ksonnet applications ● jsonnet files
  13. 13. UI
  14. 14. Kustomize Kustomize is a standalone tool to customize Kubernetes objects through a kustomization file. kubectl apply -k <kustomization_directory>
  15. 15. The three roots dev, prod and staging all refer to the base root. One would have to inspect the kustomization.yaml files to be sure. An overlay is a kustomization that depends on another kustomization. The kustomizations an overlay refers to (via filepath, URI or other method) bases.An overlay is unusable without its bases. An overlay may act as a base to another overlay. ├── base │ ├── deployment.yaml │ ├── kustomization.yaml │ └── service.yaml └── overlays ├── dev │ ├── kustomization.yaml │ └── patch.yaml ├── prod │ ├── kustomization.yaml │ └── patch.yaml └── staging ├── kustomization.yaml └── patch.yaml Kustomize
  16. 16. =>
  17. 17. To start with Kustomize, you need to have your original yaml files describing any resources you want to deploy into your cluster. Those files will be stored for this example in the folder ./k8s/base/ . In this example, we will work with a service , deployment resources and kustomization.yaml
  18. 18. The result of kustomize build k8s/base command will be the following, which is for now only the two files previously seen, concatenated:
  19. 19. A kustomization file contains fields falling into four categories: ● resources - what existing resources are to be customized. Example fields: resources, crds. ● generators - what new resources should be created. Example fields: configMapGenerator (legacy), secretGenerator (legacy). ● transformers - what to do to the aforementioned resources. Example fields: namePrefix, nameSuffix, images, commonLabels, patchesJson6902, etc. and the more general transformers. ● meta - fields which may influence all or some of the above. Example fields: vars, namespace, apiVersion, kind, etc.
  20. 20. Why kustomize? ● Purely declarative ● Template-free customization via overlays ● Easy customization for common use-cases ● Flexible tooling
  21. 21. Demo time! Svc: - Logging - Monitoring - Redis - Rabbitmq - Postgresql - kafka App: - app
  22. 22. Install k create namespace argocd k apply -n argocd -f https://../argo-cd/stable/manifests/install.yaml Download Argo CD CLI Login Using The CLI: k get po -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2 argocd login <ARGOCD_SERVER>
  23. 23. more: https://argoproj.github.io/argo-cd/ https://github.com/argoproj/argocd-example-apps https://kustomize.io/ https://www.weave.works/technologies/gitops/ https://www.weave.works/blog/kubernetes-anti-patterns-let-s-do-gitops-not-ciops https://www.gitops.tech/#why-should-i-use-gitops https://www.youtube.com/watch?v=LKOa2vMoy44 https://cluster.dev/
  24. 24. Tnx to all мамі за то шо я такий класний Соні :3 ЗСУ/Добробатам youtube Ukrops Cluster.dev Send pm to demoontz*

×