Mais conteúdo relacionado

Similar a "Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko (20)

Mais de Fwdays(20)


"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko

  1. Who Am I?  Engineer<T> where T : Azure | DevOps | C#  Microsoft® Most Valuable Professional  Solutions Architect @ SoftServe, Inc.  Spend time in the cloud  More… go to
  2. Agenda  DNS  Versioning  GitOps & ArgoCD  GitHub Actions for CI/CD
  3. Context
  4. DNS
  5. It’s Always DNS
  6. DNS. Lessons Learned  Do NOT use {env}.{app} as a naming convention  Do {app}.{env}  Use {internal}.{env} DNS zone if you have resources that are not exposed to public internet  CNAME records will help during potential migration if you use them
  7. Versioning
  8. Versioning
  9. Semantic Versioning (SemVer) & Branch Strategy  Given a version number MAJOR.MINOR.PATCH, increment the:  MAJOR version when you make incompatible API changes  MINOR version when you add functionality in a backwards compatible manner  PATCH version when you make backwards compatible bug fixes
  10. Calendar-Based Versioning (CalVer)  YYYY.MM.Sequence(.Patch)  Breaking changes are for changelog  Ship feature and fix as soon as possible  Gregorian calendar and UTC time are only dependencies  If you have support cycle each user can easily check if it is supported
  11. Versioning. Lessons Learned  Ensure calendar-based version is generated per a run and only once  Always leave traces to correlate build number with commit id  Git tag  Version metadata  You should be able to generate new version number on any platform
  12. GitOps & ArgoCD
  13. GitOps
  14. GitOps. Repository Layout  .github/  azure/ - definitions related to policy as code  cluster/ - all files related to AKS  argocd/ - Application of Applications (cluster bootstrapping)  non-prod/  apps/  projects/  prod/  apps/  projects/  rabbitmq/ - RabbitMQ Helm chart  stunnel/ - stunnel Helm chart  docs/ - runbooks, scripts, decision records, etc.  terraform/ - Terraform files to manage infrastructure
  15. ArgoCD. App Of Apps Pattern  When ArgoCD is deployed  create a new app “root”  that consists other apps and projects  PATH: cluster/argocd/non-prod  Apps  definitions of 1st party and 3rd party apps  Projects  we use ArgoCD projects as environments
  16. projects/dev.yaml apiVersion: kind: AppProject metadata: name: dev spec: clusterResourceWhitelist: - group: "*" kind: "*" description: Dev Environment destinations: - name: "*" namespace: "*-dev" server: "*" sourceRepos: - "*" status: {}
  17. apps/rabbitmq.yaml apiVersion: kind: ApplicationSet metadata: name: rabbitmq spec: generators: - list: elements: - env: dev - env: sqa - env: uat template: metadata: name: "rabbitmq-{{env}}" spec: project: "{{env}}" source: repoURL: targetRevision: HEAD path: cluster/rabbitmq helm: valueFiles: - common/values-common.yaml - variants/non-prod/values-non-prod.yaml - "envs/{{env}}-eastus/values-settings.yaml" - "envs/{{env}}-eastus/values-replicas.yaml" destination: namespace: "rabbitmq-{{env}}" server: https://kubernetes.default.svc syncPolicy: syncOptions: - CreateNamespace=true
  18. ArgoCD. Helm Chart Layout  common/ - configuration which is common to all envs  envs/ - holds environment specific configuration  templates/ - Helm chart files  variants/ - holds characteristics between similar envs
  19. GitHub Actions for CI/CD
  20. GitHub Actions or “Count to 10”
  21. GitHub Actions Layout  Build  Code Analysis  Deploy  PRs  *Reusable workflows to build, test and publish
  22. “CommitOps” in Action skip-ci skip-tests
  23. “EmojiOps” in Action  Use as a symbol system to highlight important steps
  24. GitHub Actions & Release Management
  25. deploy.yaml deploy: runs-on: ubuntu-latest name: deploy to ${{ inputs.env-id }} environment: name: ${{ inputs.env-id }} env: VERSION_FILE_PATH: cluster/product-services/envs/${{ inputs.env-id }}-eastus/values-version.yaml steps: - name: Checkout org/ops-product repository uses: actions/checkout@v3 with: repository: org/ops-product path: ops-product ssh-key: ${{ secrets.OPS_PRODUCT_SSH_PRIVATE_KEY }} - name: Update container image version to ${{ }} uses: fjogeleit/yaml-update-action@main with: valueFile: ${{ env.VERSION_FILE_PATH }} propertyPath: "image.tag" value: "${{ }}" commitChange: false updateFile: true workDir: ops-product branch: deployment masterBranchName: main targetBranch: dev repository: org/ops-product - name: Commit and push changes run: | git config "${GITHUB_ACTOR}" git config "${GITHUB_ACTOR}" git add . git commit -m "Bump image version to ${{ }} for ${{ inputs.env-id }} environment" git push working-directory: ops-product
  26. Keep Up To Date Your Actions & Charts  Dependabot or Renovate
  27. GitHub Actions. Lessons Learned  Be careful when sharing state between Jobs via GitHub Artifacts  Do not publish build artifacts to GitHub Artifacts  Allow a subsequently queued workflow run to interrupt previous runs. GitHub Docs  Limit number of open pull requests for version updates  Cache dependencies  Nested workflows and secrets scope
  28. Questions? @ky7m |

Notas do Editor

  1. Сучасний ДевОпс та Реальність Його Застосування
  2. ```mermaid sequenceDiagram participant PI as Public Internet participant CF as Cloudflare participant Prod as Azure DNS (Prod) participant NonProd as Azure DNS (Non-Prod) PI->>CF: CF->>Prod: Prod->>NonProd: Prod->>NonProd: Prod->>NonProd: ```
  3. How it works If the current commit has a version tag: The version is used as-is If the current commit does not have a version tag: The commit history is searched for the latest commit with a version tag. If a commit with a version tag is found: If the version is a pre-release: The version is used as-is, with height added. If the version is RTM (not pre-release): The patch number is incremented. Default pre-release identifiers are added. Height is added. If no commit with a version tag is found: The default version0.0.0-preview.0 is used, with height added. Height If the current commit does not have a version tag, another number is added to the pre-release identifiers. This is the number of commits since the latest commit with a version tag or, if no commits have a version tag, since the root commit. This is known as "height". For example, if the latest version tag found is 2022.11.0-rc.1, at a height of 42 commits, the calculated version is 2022.11.0-rc.1.42. Example: 2022.11.1-preview.7+f52c82b -> 2022.11.1-rc.1+e42c32b -> 2022.11.1+9693551