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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
(技術的には)社内システムもOKなブラウザエージェントを作ってみた!
har1101
0
350
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
1
170
プレビュー版のDevOpsエージェントを現段階で触ってみた
ad_motsu
1
100
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
3
230
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
260
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
480
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
530
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
250
22nd ACRi Webinar - ChipTip Technology Eric-san's slide
nao_sumikawa
0
100
AWS DevOps Agent x ECS on Fargate検証 / AWS DevOps Agent x ECS on Fargate
kinunori
2
250
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
99
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
430
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
My Coaching Mixtape
mlcsv
0
52
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.6k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Curious Case for Waylosing
cassininazir
0
240
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Accessibility Awareness
sabderemane
0
58
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
400
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
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