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
Using external services inside Kubernetes
Search
Maxim Filatov
June 17, 2018
Technology
0
94
Using external services inside Kubernetes
Video:
https://youtu.be/W5wgl1WSDGI
Maxim Filatov
June 17, 2018
Tweet
Share
More Decks by Maxim Filatov
See All by Maxim Filatov
Kubernetes on bare metal: SSL
bregor
1
610
Kubernetes and Weave.net on bare metal
bregor
1
480
Other Decks in Technology
See All in Technology
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
タスク管理も1on1も、もう「管理」じゃない ― KiroとBedrock AgentCoreで変わった"判断の仕事"
yusukeshimizu
0
190
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
14k
【SLO】"多様な期待値" と向き合ってみた
z63d
2
310
Devinを導入したら予想外の人たちに好評だった
tomuro
0
900
AI時代にエンジニアはどう成長すれば良いのか?
recruitengineers
PRO
1
140
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
72k
オンプレとGoogle Cloudを安全に繋ぐための、セキュア通信の勘所
waiwai2111
3
1.1k
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
22k
20260305_【白金鉱業】分析者が地理情報を武器にするための軽量なアドホック分析環境
yucho147
1
180
Secure Boot 2026 - Aggiornamento dei certificati UEFI e piano di adozione in azienda
memiug
0
140
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
84
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
310
Embracing the Ebb and Flow
colly
88
5k
What does AI have to do with Human Rights?
axbom
PRO
1
2k
Building Applications with DynamoDB
mza
96
6.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
240
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
300
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Amusing Abliteration
ianozsvald
0
120
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Site-Speed That Sticks
csswizardry
13
1.1k
Transcript
Using external services inside Using external services inside Kubernetes Kubernetes
None
Components Components
Networks Networks Host network: 192.168.0.0/24 Service network: 10.0.0.0/16 Pod network:
172.16.0.0/16
Hosts Hosts master01: 192.168.0.1 master02: 192.168.0.2 master03: 192.168.0.3 pgsql-master: 192.168.0.10
pgsql-slave: 192.168.0.11
Services Services kubernetes: 10.0.0.1 dns: 10.0.0.254
“Normal” ow “Normal” ow
External services External services
Con guration way Con guration way export DATABASE_URL='postgresql://
[email protected]
:5432/production_db'
WRONG WRONG
Database failure Database failure export DATABASE_URL='postgresql://
[email protected]
:5432/production_db' You should resetup ALL
related deployments and restart ALL theirs pods for hosted service address recon guration
DNS way DNS way postgres IN A 192.168.0.10 export DATABASE_URL="postgresql://
[email protected]
:5432/production_db"
WRONG! WRONG!
Database failure Database failure update DNS record Remember about DNS
cache Actually it is easier to kill all related pods
External services. The right External services. The right way way
Use force , Luke! endpoints and services
Obvious example Obvious example $ kubectl get endpoints kubernetes NAME
ENDPOINTS AGE kubernetes 192.168.0.1:8443,192.168.0.2:8443,192.168.0.3:8443 1y $ kubectl get service kubernetes NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.0.0.1 none 443/TCP 1y
In YAML: endpoint In YAML: endpoint apiVersion: v1 kind: Endpoints
metadata: name: kubernetes namespace: default subsets: - addresses: - ip: 192.168.0.1 - ip: 192.168.0.2 - ip: 192.168.0.3 ports: - name: https port: 8443 protocol: TCP
In YAML: service In YAML: service apiVersion: v1 kind: Service
metadata: labels: component: apiserver provider: kubernetes name: kubernetes namespace: default spec: clusterIP: 10.0.0.1 ports: - name: https port: 443 protocol: TCP targetPort: 8443 type: ClusterIP
Back to PostgreSQL Back to PostgreSQL
Endpoint Endpoint apiVersion: v1 kind: Endpoints metadata: name: postgres namespace:
hosted subsets: - addresses: - ip: 192.168.0.10 ports: - name: postgres port: 5432 protocol: TCP
Service Service apiVersion: v1 kind: Service metadata: name: postgres namespace:
hosted spec: ports: - name: postgres port: 5432 protocol: TCP targetPort: 5432 type: ClusterIP
Con guration Con guration export DATABASE_URL='postgresql://
[email protected]
:5432/produc
RIGHT! RIGHT! Service address is rock solid Service IP can
be preserved in service manifest Any host network recon guration is just endpoint upgrade Endpoint upgrade is rocket fast - kube-proxy rocks!
Questions? Questions?