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

Cloud Native Coding

Cloud Native Coding

This repository contains some tools and concepts for Cloud Native Coding

Christopher Schmidt

September 23, 2020
Tweet

More Decks by Christopher Schmidt

Other Decks in Programming

Transcript

  1. topics today • software development • debugging running containers •

    CI/CD • application container design • the future of managed service 2
  2. Cloud Native Applications adopting the principles of Microservices, packaged and

    delivered as Containers, orchestrated by Kubernetes, running on top of Cloud infrastructure Cloud-native software is highly distributed, must operate in a constantly changing environment, and is itself constantly changing Cloud is about where we’re computing. Cloud-native is about how. KubeCon 2017 Cornelia Davis, Manning: Cloud Native Patterns 3
  3. Issues Cloud Software Development • more and more modules &

    Microservices • more complex systems • container and platforms • SEO still important databases? managed services? service discovery? Canary releases? 4
  4. Issues Cloud Software Development • source code on a laptop

    • test and Integration system in a cloud using container or binaries? Cycle too long? mocks? Cluster on laptop? how is the development cycle? 5
  5. Dev for the Cloud - General Categories Sources & Services

    VPN Services Source & Services Sources 6
  6. Dev for the Cloud - General Categories Sources & Services

    VPN Services Source & Services Sources 7
  7. Sources and Services on Laptop Docker for Windows • seems

    to be awesome with WSL 2 backend Docker for MacOS Kind • uses curated container images and • kubeadm to provision K8s in a Container 8
  8. Dev for the Cloud - General Categories Sources & Services

    VPN Services Source & Services Sources 10
  9. Services in Cluster • kubefwd bulk port forwarding Kubernetes services

    • telepresence fast, local development for Kubernetes 11
  10. Dev for the Cloud - General Categories Sources & Services

    VPN Services Source & Services Sources 12
  11. Source and Service in Cloud VSCode / Theia based Gitpod

    • organized by workspaces • pre de ined images • short lifecycle Cloud Native Coding IDE • management UI as SaaS (optional) • IDEs managed by an operator • more VM like Github Codespaces • instant DEV environment Coder • software development to the cloud 13
  12. Pros, Issues and Dif iculties • many, very speci ic

    Development Envs • server side control (security) • cluster resource pool • Visual Studio Code • Resource Limits and Requests? • container isolation? • updates? -> Cloud VMs per Virtual Kubelet (Kip) 14
  13. Debugging Tools kubectl plugins • open-svc: open the Kubernetes URL(s)

    for the speci ied service in your browser through a local proxy server • spy: pod debugging tool for kubernetes clusters with docker runtimes • sniff: Perform network snif ing on a container running in a kubernetes cluster 16
  14. kubespy How does it work? kubectl -n "${ns}" run --generator=run-pod/v1

    --overrides=' { "spec": { "hostNetwork": true, "hostPID": true, "hostIPC": true, "nodeName": "'"${no}"'", "containers": [ { "name": "spy", "image": "busybox", "command": [ "/bin/chroot", "/host"], "args": [ "docker", "run", "--network=container:'"${cid}"'", "--pid=container:'"${cid}"'", "--ipc=container:'"${cid}"'", "'"${ep}"'" ], "stdin": true, "stdinOnce": true, "tty": true, "volumeMounts": [ { "mountPath": "/host", "name": "node" } ] } ], "volumes": [ { "name": "node", "hostPath": { "path": "/" } } ] } } ' --image=busybox --restart=Never "${spyid}" 17
  15. Release Strategies • with downtime • recreate • without downtime

    • rolling update • blue green • canary - based on • location • device • traf ic share • technical/business metrics • . . . Kubernetes build-in means? Service Meshes? 19
  16. Canary Release Flagger (progressive delivery) • deployment strategies like Canary

    releases, A/B testing, Blue/Green • can query Prometheus, Datadog or CloudWatch 20
  17. Cluster Setup management cluster • Jira/GitLab/etc. Dev/Int/Stage/... cluster • IDEs

    • Pull Requests/feature branches performance test cluster prod cluster 23
  18. Cluster Deployments • dedicated server • build runner • cloud

    native CI/CD Tools • Tekton CD • Argo CD • . . . runner 24
  19. Task apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: argo-deploy spec: params:

    - name: APP description: Name of ArgoCD App to sync - name: TOKEN description: Authentication token for ArgoCD - name: SERVER description: AgroCD Server location resources: inputs: - name: source type: git - name: image type: image steps: - name: argo-deploy image: argoproj/argocd:v1.6.1 script: | argocd app set $(inputs.params.APP) \ --kustomize-image $(resources.inputs.image.url):$(resources.inputs.source.revision) \ --auth-token $(inputs.params.TOKEN) --server $(inputs.params.SERVER) --insecure argocd app sync $(inputs.params.APP) \ --auth-token $(inputs.params.TOKEN) --server $(inputs.params.SERVER) --insecure 26
  20. ACD Proxy App Pod • rate limiting • circuit breaking

    • TLS • Cache & CORS header • routing • . . . 30
  21. ACD • NFRs to the platform • scaling, self healing,

    placement, jobs, cronjobs etc. • CQRS • different scaling needs • different releasing requirements (Recreate instead of Canary) • smaller components • -> better test-ability 32
  22. Managed Services • goal: environment independence • (not feature-set) •

    what about your Dev-laptop setup? • many APIs with different semantics (User, Role, Network, ACL, Cost control etc) • Different Monitoring/Alerting? 35
  23. Danke! Fragen? Christopher Schmidt [email protected] @fakod www.innoq.com innoQ Schweiz GmbH

    Hardturmstrasse 253 8005 Zürich Gewerbestr. 11 6330 Cham 39