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
96
0
Share
Using external services inside Kubernetes
Video:
https://youtu.be/W5wgl1WSDGI
Maxim Filatov
June 17, 2018
More Decks by Maxim Filatov
See All by Maxim Filatov
Kubernetes on bare metal: SSL
bregor
1
660
Kubernetes and Weave.net on bare metal
bregor
1
490
Other Decks in Technology
See All in Technology
【新卒研修】ライブデモ + compose.yaml読解_講義資料
dip_tech
PRO
0
130
TSKaigi 2026 - enumよ、さようなら
teamlab
PRO
2
310
なぜ、IAMロールのプリンシパルに*による部分マッチングが使えないのか? / 20260518-ssmjp-iam-role-principal
opelab
2
150
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.6k
10サービス以上のメール到達率改善を地道に継続的に進めている話 / Continue to improve email delivery rates across multiple services
yamaguchitk333
6
2.3k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.5k
The Making of AI Chips
pfn
PRO
0
660
TypeScriptはどのようにどこまで推論できるのか ─ とにかく as は禁止で
ypresto
1
310
エムスリーテクノロジーズ株式会社 エンジニア向け紹介資料 / M3 Technologies Company Deck
m3_engineering
0
210
AIAgentと取り組むKaggle
508shuto
2
480
ソフトウェアサプライチェーン攻撃対策として今からサクッとできること
flatt_security
2
110
AWS WAFの運用を地道に改善し、自社で運用可能にするプラクティス
andpad
1
660
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Into the Great Unknown - MozCon
thekraken
41
2.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
930
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Faster Mobile Websites
deanohume
310
31k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
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?