Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Best Practices for Using Developer Tooling to Drive Operations with GitOps

Best Practices for Using Developer Tooling to Drive Operations with GitOps

More and more businesses are requiring developers to own end-to-end delivery, including operational ownership. In this talk, Ilya will take you on a journey of discovery into the world of GitOps. He will share with you what it means, and how easy it is to create cloud native applications, CICD pipelines, integrate operations and more, using GitOps. Inherited from best practices going back 10-15 years, cloud native is making these practices more relevant today. At Weaveworks, their experiences are based on operating a full CNCF stack in anger for more than two years. This includes continuously updated Kubernetes, Prometheus, Istio, OpenTracing, and more. Ilya will showcase best practices and tools, including some of Weaveworks’ use cases.

121dcfb4f05ed316247772545e2cd590?s=128

Ilya Dmitrichenko

June 15, 2018
Tweet

Transcript

  1. @errordeveloper Developer Tooling to Drive Operations with GitOps

  2. outline: –define GitOps –example –dev toolkit

  3. – define GitOps

  4. Kubernetes managed through git

  5. not just config as code

  6. 3 promisses of GitOps

  7. declarative

  8. deterministic

  9. extendable

  10. GitOps vs CIOps

  11. None
  12. * Running tests √ Tests OK * Building container image

    # docker build -t $APP:$REV # docker push $APP:$REV * Deploying to Kubernetes # kubectl set image deployment/$APP $APP=$APP:$REV * Build finished √ “CIOps”
  13. concerns with “CIOps”

  14. are CI jobs interlocked?

  15. CI job per cluster?

  16. for a new cluster, re-run CI…

  17. in-cluster CI?

  18. …and how to do a rollback?

  19. “CIOps” pipeline

  20. None
  21. – example

  22. – using skaffold

  23. – local setup # skaffold.yaml apiVersion: skaffold/v1alpha2 kind: Config build:

    artifacts: - imageName: podinfo docker: dockerfilePath: ./Dockerfile.ci deploy: kubectl: { manifests: [ deploy/skaffold/dev/* ] }
  24. – local setup # skaffold.yaml apiVersion: skaffold/v1alpha2 kind: Config build:

    artifacts: - imageName: podinfo docker: dockerfilePath: ./Dockerfile.ci deploy: kubectl: { manifests: [ deploy/skaffold/dev/* ] }
  25. – local setup $ skaffold dev

  26. None
  27. – using skaffold with CI & Weave Cloud

  28. – CI setup # skaffold.yaml

  29. – CI setup # skaffold.yaml apiVersion: skaffold/v1alpha2 kind: Config build:

    {} # <snip> deploy: {} # <snip> profiles: - name: test # <snip>
 - name: production # <snip>
  30. – CI setup # skaffold.yaml (continued) - name: test ##

    This profile runs unit tests and builds the image build: local: { skipPush: true } artifacts: - imageName: stefanprodan/podinfo docker: dockerfilePath: ./Dockerfile.ci deploy: {} # no-op
  31. – CI setup # skaffold.yaml (continued) - name: production ##

    This profile pushes the image build: local: { skipPush: false } artifacts: - imageName: stefanprodan/podinfo docker: dockerfilePath: ./Dockerfile.ci deploy: {} # no-op
  32. – CI setup # .circleci/config.yml

  33. – CI setup # .circleci/config.yml version: 2 jobs: test: {}

    # <snip> deploy: {} # <snip> workflows: main: jobs: - test - deploy: requires: [test] filters: { branches: {only: [master]} }
  34. – CI setup # .circleci/config.yml (continued) test: docker: - image:

    errordeveloper/skaffold:66cc263e
 steps: - checkout - setup_remote_docker: {docker_layer_caching: true} - run: command: skaffold build --profile=test
  35. – CI setup # .circleci/config.yml (continued) deploy: docker: - image:

    errordeveloper/skaffold:66cc263e
 steps: - checkout - setup_remote_docker: {docker_layer_caching: true} - run: command: | scripts/docker_login.sh skaffold build —profile=production
  36. – Weaveworks GitOps operator

  37. URL: git@github.com:stefanprodan/podinfo path: deploy/skaffold/production branch: master

  38. None
  39. None
  40. None
  41. – Using Weave Flux (open-source) apiVersion: apps/v1 kind: Deployment spec.template.spec.containers:

    - name: flux image: quay.io/weaveworks/flux:1.4.0 args: - --git-url=git@github.com:stefanprodan/podinfo - --git-path=deploy/skaffold/production - --git-branch=master
  42. declarative deterministic extendable

  43. – dev toolkit

  44. None
  45. None
  46. None
  47. eksctl.io

  48. thanks!

  49. bit.ly/WeaveUG slack.weave.works

  50. @errordeveloper ilya@weave.work