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
360
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
270
Dive-In-Workshop: Kubernetes
bastianhofmann
0
450
Other Decks in Programming
See All in Programming
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
190
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
390
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
0
1.9k
関数型プログラミングのメリットって何だろう?
wanko_it
0
150
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
7
3.3k
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
15
3.1k
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
300
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
140
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
240
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
150
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
350
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
240
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
How STYLIGHT went responsive
nonsquared
100
6.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
First, design no harm
axbom
PRO
2
1.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Facilitating Awesome Meetings
lara
57
7k
Rails Girls Zürich Keynote
gr2m
96
14k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
The Pragmatic Product Professional
lauravandoore
37
7.4k
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