O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

My kubernetes toolkit

My favorite tools used when developing and deploying Kubernetes applications

  • Entre para ver os comentários

  • Seja a primeira pessoa a gostar disto

My kubernetes toolkit

  1. 1. 1 My Kubernetes toolkit - Sreenivas Makam
  2. 2. Developing Kubernetes applications is frustrating. Too much configuration. Debugging is a pain. Applications have so many moving parts. I spend too much time outside of my code.
  3. 3. Helpers Kubectx kubens Config Mgmt Kustomize Pkg Mgmt Helm Build Dockerfile Kaniko Jib CI/CD Skaffold IDE Cloud code for VSCODE My favorite tools
  4. 4. Kubectx and Kubens ● kubectx - Utility to manage and switch between Kubernetes contexts of different clusters ● Easy to manage dealing with multiple Kubernetes clusters(including GCP, AWS, Azure, Docker for desktop, minikube) ● Kubens - Utility to switch between Kubernetes namespaces smoothly ● Kubectx and kubens - combination saves a lot of time https://github.com/ahmetb/kubectx
  5. 5. Kustomize Overview Additional Features ● Apply common: ○ Labels ○ Annotations ● Add a prefix to all resource names ● Easily manage ConfigMaps and Secrets System for managing and applying patches on top of existing Kubernetes YAML Easier to maintain than templates Integrated with kubectl
  6. 6. Overlays for Kubernetes Manifests Security overlay Production Overlay Base Manifests 2O LOC 40 LOC 500 LOC Merge in overrides at each layer
  7. 7. Kustomize example1 apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app: myapp spec: containers: - name: myapp image: busybox command: ['app'] apiVersion: v1 kind: Pod metadata: name: myapp-pod spec: containers: - name: myapp command: ['app', '--dev'] apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app: myapp spec: containers: - name: myapp image: busybox command: ['app', '--dev'] base.yaml patch.yaml output.yaml Skaffold build
  8. 8. Kustomize example2 apiVersion: apps/v1 kind: Deployment metadata: name: the-deployment spec: replicas: 1 template: metadata: labels: deployment: hello spec: containers: - name: the-container image: monopole/hello:1 apiVersion: apps/v1 kind: Deployment metadata: name: the-deployment spec: replicas: 3 apiVersion: apps/v1 kind: Deployment metadata: name: prod-the-deployment spec: replicas: 3 template: metadata: labels: deployment: hello Stage: production spec: containers: - name: the-container image: monopole/hello:1 base.yaml patch.yaml output.yaml namePrefix: prod- bases: - ../base-manifest commonLabels: stage: production patches: - patch.yml kustomization.yaml Skaffold build
  9. 9. Helm ● Package manager for Kubernetes applications ● Charts are easy to create, version, share, and publish ● Helm 3 removes server side component Tiller and this makes Helm very easy to use ● Helm can also help as template manager for Kubernetes, but using templates can get complex helm search wordpress helm install stable/wordpress
  10. 10. Jib ● Creates Container images for Java without Dockerfile ○ Don’t need to worry about Dockerfile best practises ○ Daemonless ● Available as plugins for Maven and Gradle ● Optimized for fast builds Steps: Apply plugin Mvn jib:build (or) gradle jib
  11. 11. Skaffold ● Fast local kubernetes development ● Works with any build(Dockerfile, Jib), test and deploy tools(helm, kubectl, kustomize) ● Backend for cloud code ● Client side lightweight tool ● Supports profiles that allows extension into different environments Skaffold init Skaffold run - single deploy Skaffold dev - continuous deploy
  12. 12. Skaffold stages
  13. 13. Cloud Code Building highly scalable applications with Kubernetes can be hard, Google Cloud Code extends your IDE so that you can continuously deploy to a cluster, and edit/debug just like you were working with local code. Available for VS code and Intellij
  14. 14. Cloud Code for IDEs Features 1 32 Debugging Cluster browsingKubernetes inner development loop 4 65 Integrations with popular tools and libraries Google Cloud Platform integrations Templates and editing
  15. 15. The tools you need for Cloud Native development, leveraging your favorite OS, IDE, language and cloud. Available in the Visual Studio Code Marketplace. Support for 1 2 3 4 Getting Started Local Development Deploy to Remote Cluster Troubleshooting - Debugging & logs Cloud Code for Visual Studio Code
  16. 16. Demo
  17. 17. Voting Application Node.js Node.js Frontend Service index.html results.html Voting Service /get /post https://github.com/smakam/voting-app
  18. 18. Voting Application Kustomization Base manifest Replicas: 1 stage: staging Staging manifest Replicas: 2 stage: production Prod manifest https://github.com/smakam/voting-app

×