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
190
実践/先取り「入門 Kubernetes Validating/Mutating Admission Policy」 / CloudNative Days Winter 2024
superbrothers
0
56
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
150
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
12
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
Amazon S3 Filesについて
yama3133
2
210
社内エンジニア勉強会の醍醐味と苦しみ/tamadev
nishiuma
0
190
扱える不確実性を増やしていく - スタートアップEMが考える「任せ方」
kadoppe
0
290
Introduction to Bill One Development Engineer
sansan33
PRO
0
410
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.3k
EBS暗号化に失敗してEC2が動かなくなった話
hamaguchimmm
2
200
KGDC_13_Amazon Q Developerで挑む! 13事例から見えたAX組織変革の最前線_公開情報
kikugawa
0
120
Good Enough Types: Heuristic Type Inference for Ruby
riseshia
0
190
[最強DB講義]推薦システム | 基礎編
recsyslab
PRO
1
170
AIエージェントの権限管理 1: MCPサーバー・ツールの Fine grained access control 編
ren8k
3
490
Code Interpreter で、AIに安全に コードを書かせる。
yokomachi
0
7.1k
Practical TypeProf: Lessons from Analyzing Optcarrot
mame
0
260
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
130
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
94
Evolving SEO for Evolving Search Engines
ryanjones
0
180
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
110
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
770
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
330
Designing for Performance
lara
611
70k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
260
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
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