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
600
Kubernetes and Weave.net on bare metal
bregor
1
480
Other Decks in Technology
See All in Technology
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
720
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
メルカリのAI活用を支えるAIセキュリティ
s3h
8
5.9k
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
210
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
860
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
1
450
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
5
1.7k
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
1
110
エンジニアとマネジメントの距離/Engineering and Management
ikuodanaka
3
700
SREの仕事を自動化する際にやっておきたい5つのポイント
jacopen
6
1.2k
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
400
DatabricksホストモデルでAIコーディング環境を構築する
databricksjapan
0
220
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
1.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Claude Code のすすめ
schroneko
67
210k
Technical Leadership for Architectural Decision Making
baasie
1
230
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
54
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?