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
3
1.2k
クラスタ外から 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
Tweet
Share
More Decks by Kazuki Suda
See All by Kazuki Suda
実践/先取り「入門 Kubernetes Validating/Mutating Admission Policy」 / CloudNative Days Winter 2024
superbrothers
0
4
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
92
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1.3k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.5k
コミュニティ/ 勉強会紹介
superbrothers
0
220
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
12
5.5k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
54
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
7.8k
わかる!metadata.managedFields
superbrothers
4
2k
Other Decks in Technology
See All in Technology
わたしがEMとして入社した「最初の100日」の過ごし方 / EMConfJp2025
daiksy
14
5.2k
手を動かしてレベルアップしよう!
maruto
0
230
OPENLOGI Company Profile
hr01
0
60k
生成AI “再”入門 2025年春@WIRED TUESDAY EDITOR'S LOUNGE
kajikent
0
130
スキルだけでは満たせない、 “組織全体に”なじむオンボーディング/Onboarding that fits “throughout the organization” and cannot be satisfied by skills alone
bitkey
0
190
DevinでAI AWSエンジニア製造計画 序章 〜CDKを添えて〜/devin-load-to-aws-engineer
tomoki10
0
170
エンジニアリング価値を黒字化する バリューベース戦略を用いた 技術戦略策定の道のり
kzkmaeda
7
3k
入門 PEAK Threat Hunting @SECCON
odorusatoshi
0
170
Amazon Aurora のバージョンアップ手法について
smt7174
2
150
自分だけの仮想クラスタを高速かつ効率的に作る kubefork
donkomura
0
110
EDRの検知の仕組みと検知回避について
chayakonanaika
12
5k
Охота на косуль у древних
ashapiro
0
110
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Agile that works and the tools we love
rasmusluckow
328
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Bash Introduction
62gerente
611
210k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
260
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
We Have a Design System, Now What?
morganepeng
51
7.4k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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