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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
190
Introduction to Kubernetes
bastianhofmann
1
140
CI/CD with Kubernetes
bastianhofmann
0
240
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
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
100
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
540
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
230
New "Type" system on PicoRuby
pocke
1
930
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
6
1.1k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
340
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
340
Vite+ Unified Toolchain for the Web
naokihaba
0
310
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
240
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
130
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
11
38k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
780
Into the Great Unknown - MozCon
thekraken
41
2.6k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Google's AI Overviews - The New Search
badams
0
1k
How to make the Groovebox
asonas
2
2.2k
Writing Fast Ruby
sferik
630
63k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
230
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