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.3k
クラスタ外から 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
"なるべくスケジューリングしない" を実現する "PreferNoSchedule" taint
superbrothers
0
160
実践/先取り「入門 Kubernetes Validating/Mutating Admission Policy」 / CloudNative Days Winter 2024
superbrothers
0
47
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
140
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.3k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
82
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
8.5k
Other Decks in Technology
See All in Technology
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
170
ECS障害を例に学ぶ、インシデント対応に備えたAIエージェントの育て方 / How to develop AI agents for incident response with ECS outage
iselegant
4
430
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
200
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.6k
Agent Skils
dip_tech
PRO
0
140
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
130
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
110
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
ランサムウェア対策としてのpnpm導入のススメ
ishikawa_satoru
0
230
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
610
Greatest Disaster Hits in Web Performance
guaca
0
290
Webhook best practices for rock solid and resilient deployments
glaforge
2
310
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
1.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
77
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
GitHub's CSS Performance
jonrohan
1032
470k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
590
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7k
The Curse of the Amulet
leimatthew05
1
8.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
180
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
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