Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Creating a fast Kubernetes Development Workflow
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Bastian Hofmann
November 13, 2019
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Creating a fast Kubernetes Development Workflow
Bastian Hofmann
November 13, 2019
More Decks by Bastian Hofmann
See All by Bastian Hofmann
Monitoring in Kubernetes with Prometheus and Grafana
bastianhofmann
0
370
Highly available cross-region deployments with Kubernetes
bastianhofmann
1
170
From source to Kubernetes in 30 minutes
bastianhofmann
0
200
Introduction to Kubernetes
bastianhofmann
1
140
CI/CD with Kubernetes
bastianhofmann
0
250
Creating a fast Kubernetes Development Workflow
bastianhofmann
1
290
Deploying your first Micro-Service application to Kubernetes
bastianhofmann
2
210
Creating a fast Kubernetes Development Workflow
bastianhofmann
0
280
Dive-In-Workshop: Kubernetes
bastianhofmann
0
460
Other Decks in Programming
See All in Programming
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
860
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
230
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
410
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.9k
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
910
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
360
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
340
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
270
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
550
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
460
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Designing for Timeless Needs
cassininazir
1
400
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Embracing the Ebb and Flow
colly
88
5.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
350
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
The Cost Of JavaScript in 2023
addyosmani
55
10k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Transcript
@BastianHofmann Creating a fast Kubernetes Development Workflow Bastian Hofmann
None
Container orchestration platform
Deploy, run and scale your services in isolated containers
No vendor lock in
Runs on
Your laptop
Bare metal
Cloud Providers
And if you don't want to install and maintain Kubernetes
yourself
Managed Kubernetes
None
Standardized APIs
It works the same everywhere*
It works the same everywhere* *mostly
This talk is about how to use Kubernetes
Not only for production workloads
But in your development workflows
Goal: Development environment as close to production as possible
Kubernetes' standardized API makes this easier
Agenda
Deployment of a micro-service application
Some tools to help with local development of this application
on Kubernetes
Let's have a look at the sample application
None
OpenStack Cloud LoadBalancer NGINX Ingress Controller NGINX Ingress Controller NGINX
Ingress Controller web-application web-application MySQL Primary MySQL Secondary quote-svc quote-svc hello-svc hello-svc
external-dns to create DNS entries automatically
cert-manager to retrieve Let's Encrypt certificates automatically
Database is managed by an Operator
MySQL Operator MySQLCluster MySQL pods MySQL statefulset Kubernetes controller manager
Discovers Creates Creates Discovers Monitors and manages
If you are interested in the code and how to
set it up: https:/ /github.com/syseleven/ golem-workshop
Demo
Writing this YAML files is tedious
YAML files are tied to a specific version and a
specific environment
Production
Staging
Development
Per Development team
Per branch
Per developer
We need to maintain multiple, very similar YAML files with
slightly different versions and configuration
"Templating"
Great tools because of standardized Kubernetes API
Helm
None
Allows to install applications
So called "charts"
$ helm install stable/wordpress \ --name my-blog \ --namespace blog
Charts can depend on other charts
Multiple deployments of one chart possible
Different release names
Different namespaces
Configuration with values
None
$ helm install stable/wordpress \ --name my-blog \ --namespace blog
\ -f my-config-values.yaml
Demo
Writing your own charts is fairly easy
Scaffolding to get started
$ helm create quote-svc
Helm lint
Helm kubeval
Helm test
Demo
Alternatives: Kustomize
This works now great for production or staging or CI
Still, for development:
Make a code change
Build docker image
Push docker image
Run helm install/upgrade with new image version
Can this be quicker?
Run everything locally
docker-compose
Duplication of the definition of how to run a container
Inconsistencies
If you have a lot of services, you have to
run a lot locally
Some services locally, some remote
Service Discovery
Not every service is exposed to the Internet
Shared resources with other developers?
Other options?
Tilt
$ tilt up
Watches for code changes
Rebuilds docker image
Deploys to Kubernetes
Sets up port-forwarding
Can sync changed files directly into a running container
Demo
Alternatives: Skaffold Garden
Debugging containers
Most containers do not have all the debugging tools included
Kubectl debug
Debugging network traffic between containers
Kubectl sniff
Demo
Another approach
None
Creates a two-way proxy between the Kubernetes cluster and you
$ telepresence T: Starting proxy with method 'vpn-tcp'... @fhgbvx65xg|bash-3.2$ curl
http://quote-svc/quote | jq '.' [ { "ID": 503, "title": "stefan sagmeister", "content": "<p>...</p>\n", "link": "https://quotesondesign.com/stefan- sagmeister-2/" } ]
Swap a running deployment in the cluster with a local
process
... or a locally running docker container
$ telepresence --swap-deployment quote-svc --namespace dev-flow-demo --expose 3000 --run npm
run debug T: Starting proxy with method 'vpn-tcp',... T: Forwarding remote port 3000 to local port 3000.... >
[email protected]
debug /Users/bhofmann/forge_test/quote- svc > nodemon --inspect quote-svc.js [nodemon] watching: *.* [nodemon] starting `node --inspect quote-svc.js` Debugger listening on ws://127.0.0.1:9229/83aa27ac- d879-4b50-a228-440354cca791 quote svc listening on port 3000!
Demo
Summary
Powerful
Great tooling because of common APIs
Especially great if you have multiple services and don't want
to run everything locally
Test it 30 days For free Visit us at our
booth
[email protected]
https:/ /twitter.com/BastianHofmann http:/ /speakerdeck.com/u/bastianhofmann https:/ /github.com/syseleven/golem-workshop