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 to connect to ClusterIP Service from the outside of Kubernetes cluster
Search
Kazuki Suda
November 27, 2019
Technology
3
1.1k
クラスタ外から 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 の最新注目機能! (2024年5月版)
superbrothers
0
17
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.3k
コミュニティ/ 勉強会紹介
superbrothers
0
200
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
9
4.4k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
29
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
6.7k
わかる!metadata.managedFields
superbrothers
4
1.7k
Local ephemeral-storage のメトリクスを取得するのに kube-summary-exporter がべんり / kube-summary-exporter is useful to get the metrics of local ephemeral-storage
superbrothers
0
490
Other Decks in Technology
See All in Technology
LLM評価の落とし穴~開発者目線で気をつけるポイント~
rishigami
10
3.1k
生成AIと産業向けソフトウェアの自動生成 〜 ハノーバーメッセ2024より〜
kioto
2
420
開発スピードの維持向上を支える、テスト設計の 漸進的進化への取り組み / Continuous Test Design Development for Speed of Product Development
ropqa
0
180
テストコードを書きながらCompose Multiplatformを乗りこなす
subroh0508
0
140
Real World Type Puzzle and Code Generation
yukukotani
4
620
PhpStorm超絶技巧40分集中講義 #phpconkagawa
yusuke
4
710
AWS アーキテクチャ作図入門/aws-architecture-diagram-101
ma2shita
16
6.7k
グイグイ系QAエンジニアでやっていくよ!
____rina____
0
720
エンジニアゼロの組織から内製開発の DX をどう実現したのか / How did we achieve DX in in-house development in an organization with zero engineers?
genkiogasawara
6
2k
AWS Observability ベストプラクティス 大紹介
o11yfes2023
0
150
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
36k
Documentação de Produtos: Artefatos essenciais na prática
rigolon
1
290
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
12
1.1k
Fireside Chat
paigeccino
22
2.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
The Power of CSS Pseudo Elements
geoffreycrofte
62
5k
What's in a price? How to price your products and services
michaelherold
238
11k
Bash Introduction
62gerente
605
210k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
7k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
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