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
クラスタ外から ClusterIP の Service に いい感じにアクセスする / How...
Search
Kazuki Suda
November 27, 2019
Technology
1.3k
3
Share
クラスタ外から ClusterIP の Service に いい感じにアクセスする / How to connect to ClusterIP Service from the outside of Kubernetes cluster
【前夜祭】CloudNative Days Kansai 2019 Meetup /
https://cloudnativedays.connpass.com/event/152321/
Kazuki Suda
November 27, 2019
More Decks by Kazuki Suda
See All by Kazuki Suda
"なるべくスケジューリングしない" を実現する "PreferNoSchedule" taint
superbrothers
0
200
実践/先取り「入門 Kubernetes Validating/Mutating Admission Policy」 / CloudNative Days Winter 2024
superbrothers
0
61
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
160
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1.5k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.5k
コミュニティ/ 勉強会紹介
superbrothers
0
260
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
13
6.5k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
92
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
8.6k
Other Decks in Technology
See All in Technology
セキュリティ対策、何からはじめる? CloudNative環境の脅威モデリングと リスク評価実践入門 #cloudnativekaigi
varu3
5
850
AI-Assisted Contributions and Maintainer Load - PyCon US 2026
pauloxnet
1
120
ワールドカフェ再び、そしてゴール・ルール・ロール・ツール / World Café Revisited, and the Goals-Rules-Roles-Tools
ks91
PRO
0
150
Sociotechnical Architecture Reviews: Understanding Teams, not just Artefacts
ewolff
1
170
2026年春のAgentCoreアプデ 細かいやつ全部まとめ
minorun365
4
230
AWS運用におけるAI Agent活用術 / JAWS-UG 神戸 #11 LT大会
genda
1
110
「強制アップデート」か「チームの自律」か?エンタープライズが辿り着いたプラットフォームのハイブリッド運用/cloudnative-kaigi-hybrid-platform-operations
mhrtech
0
190
Swift Sequence の便利 API 再発見
treastrain
1
270
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
450
OWASP APTSを眺めてみた
su3158
0
130
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.4k
クラウドネイティブ DB はいかにして制約を 克服したか? 〜進化歴史から紐解く、スケーラブルアーキテクチャ設計指針〜
hacomono
PRO
6
940
Featured
See All Featured
Scaling GitHub
holman
464
140k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
43
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.3k
Amusing Abliteration
ianozsvald
1
160
How to Think Like a Performance Engineer
csswizardry
28
2.6k
How to build a perfect <img>
jonoalderson
1
5.5k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
300
Transcript
【前夜祭】CloudNative Days Kansai 2019 Meetup (2019/11/27) Kazuki Suda, @superbrothers クラスタ外から
ClusterIP の Service に いい感じにアクセスする
Kazuki Suda / @superbrothers ▶ Kubernetes Meetup Tokyo, Prometheus Tokyo
Meetup, Cloud Native Deep Dive 共同主催者 ▶ Kubernetes Active Contributor ▶ CNCF Ambassador
Kubernetes Service リソース ▶ 仮想 IP とポート ▶ L4 ロードバランサに相当
▶ いくつかのタイプ + ClusterIP (Internal) + NodePort + LoadBalancer (External) + Service my-svc タイプ: ClusterIP セレクタ: app=nginx ポート: 8080/tcp→80/tcp clusterIP: 10.0.171.239 Pod A Pod B ReplicaSet app: nginx app: nginx
ClusterIP で作成した Service にクラスタ外からアクセスしたい ▶ がしかし、ClusterIP はクラスタ内からしかアクセスできない
アクセスできないならじゃあどうする $ kubectl port-forward svc/nginx $ kubectl run busybox --rm
--it --image=busybox --restart=Never \ --command -- wget -O- nginx
でもやっぱりクラスタ外からいい感じにアクセスしたい Service リソースの proxy サブリソース
Kubernetes Service proxy サブリソース ▶ /api/v1/namespaces/<namespace>/services/<scheme>:<service>:<port>/proxy
$ kubectl proxy & $ curl 127.0.0.1:8001/api/v1/namespaces/default/services/nginx/proxy/
Service proxy サブリソースをもっともいい感じに使いたい ▶ kubectl open-svc プラグイン
None
# Open service/nginx in namespace/default $ kubectl open-svc nginx -n
default
# How to install kubectl open-svc plugin $ kubectl krew
install open-svc * https://github.com/kubernetes-sigs/krew