Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
F5-NGINX-Ingress勉強会
成臣 Chengchen
January 07, 2020
Programming
0
220
F5-NGINX-Ingress勉強会
成臣 Chengchen
January 07, 2020
Tweet
Share
More Decks by 成臣 Chengchen
See All by 成臣 Chengchen
it2911
0
150
it2911
0
60
it2911
0
90
Other Decks in Programming
See All in Programming
morimorihoge
1
140
yasaichi
30
7.6k
takahi5
1
390
christianweyer
PRO
0
270
grapecity_dev
0
170
masui_masanori
1
250
danilop
0
220
mitohato14
0
110
sansuke05
1
110
korosuke613
2
240
hassaku63
1
700
osyo
0
280
Featured
See All Featured
holman
461
280k
shpigford
369
42k
gr2m
83
11k
62gerente
587
200k
brianwarren
83
4.7k
morganepeng
18
1.2k
denniskardys
220
120k
roundedbygravity
242
21k
robhawkes
52
2.8k
eitanlees
112
10k
tanoku
86
8.5k
samlambert
237
10k
Transcript
NGINX Ingress Controller F5ネットワークスジャパン合同会社 NGINX – テクニカルソリューションズアーキテクト 鈴木 孝彰
None
NGINX and NGINX Plus • NGINX – オープンソース, コミュニティ ◦
Web サーバーとコンテンツ キャッシュ ◦ レイヤー4/7 ロード バランシング ◦ 高負荷サイトはNGINXを選択してします ◦ DockerHubイメージ No1.ダウンロード • NGINX Plus – 商用版, F5ネットワークス ◦ 高度な機能と24x7サポート ◦ JWT 認証 ◦ 動的再構成用 NGINX PLUS REST API ◦ 動的 DNS 解決 ◦ アクティブヘルスチェック
MORE INFORMATION AT NGINX.COM • 下位互換性 – ALPN 使用、HTTP/1 と並んで
HTTP/2 をサポート (OpenSSL1.0.2 以降が必要です) • HTTP/2 ゲートウェイ– HTTP/2 を既存のアプリ サーバーが理解できるプロトコルに変換 NGINXをリバースプロキシとして利用する HTTP/3 *開発中 アプリケーション サーバ
NGINX OSS, NGINX Plus (商用版) WAF 機能 Web サーバ キャッシュ
ロード バランサ SSL リバース プロキシ 認証 ゲートウェイ API ゲートウェイ アプリケーション サーバ <··> <··> 5 OSS 商用 商用 商用 商用 商用 商用 OSS OSS OSS 商用 OSS Ingress Controller OSS Prometheus対応 Dashboard https://interact.f5.com/jp-products-nginxplus-acquisition.html https://docs.nginx.com/ ファイア ウォール
MORE INFORMATION AT NGINX.COM Kubernetes環境での利用 (Ingress Controller) https://github.com/nginxinc/kubernetes-ingress NGINX Plus
NGINX OSS NGINX Plusを入り口として Kubernetesアプリケーションを作成 • 高度な負荷分散とSSL/TLS 終端 • WebSocket と HTTP/2 のサポート • リクエストがアプリケーションに 転送される前にURI 書き換え • 設定変更 (Ingress, VS/VSR) • セッション維持 • JWT認証 • gRPC サポート • Prometheus/OpenTracingサポート • 24x7 商用サポート L4 L7
NGINX Ingress Controller 比較 機能等 kubernetes/ingress-nginx NGINX OSS + Lua
nginxinc/kubernetes-ingress NGINX OSS nginxinc/kubernetes- ingress NGINX Plus 開発者 Kubernetes コミュニティ F5 / NGINX Team,コミュニティ F5 / NGINX Team NGINX バージョン カスタム NGINX ビルド サードパーティモジュール 公式OSS NGINX (mainline) NGINX Plus (商用版) 商用サポート 無 無 有 Ingress対応 有 有 有 Annotations対応 有 有 有 ConfigMaps対応 有 有 有 TCP/UDP Extension対応 有 有 有 JSON Web Token認証 無 無 有 Prometheus/OpenTracing 対応 有 有 有 NGINX ダッシュボード 無 無 有
コンテナ環境でのベストプラクティス Ingress Kubernetes Cluster Ingress Kubernetes Cluster セキュリティ Attackers User
• アプリ開発者はアプリの開発に注力 • セキュリティはBIG-IPで統合処理 • SSLをBIG-IPで集中管理することで 証明書管理負荷の低減も可能
Public Cloudでの利用 https://cloud.google.com/community/tutorials/nginx-ingress-gke
Public Cloudでの利用 https://www.brandonbarnett.io/blog/2018/05/how-kubernetes-ingress-and-loadbalancer-resources-work-together/ https://docs.microsoft.com/ja-jp/azure/aks/ingress-basic
Public Cloudでの利用 https://cloud.ibm.com/docs/containers?topic=containers-ingress&locale=ja#user_managed https://www.nginx.com/partners/ibm/
Public Cloudでの利用 https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/
どのようにIngress利用するか?
Ingress Example – URL ベースのルーティング
NGINX Ingress Controller [URLベースルーティング] http://example.com/foo Upstream: foo-svc:80 NGINX Ingress Controller
http://example.com/bar Upstream: bar-svc:80
NGINX Ingress Controller [URLベースルーティング] http://example.com/foo Upstream: foo-svc:80 NGINX Ingress Controller
http://example.com/bar Upstream: bar-svc:80 http://example.com/HelloWorld.Greeter Upstream: grpc-svc:5001 http://example.com/ws Upstream: ws-svc:8008
Ingress Example – [ホストベースのルーティング]
NGINX Ingress Controller [ホストベースルーティング] http://foo.example.com/ Upstream: foo-service:80 http://bar.example.com/ Upstream: bar-service:80
NGINX Ingress Controller
MORE INFORMATION AT NGINX.COM Kubernetes IngressでのNGINX関連設定 Annotations ConfigMap https://github.com/nginxinc/kubernetes- ingress/blob/master/docs/configmap-and-annotations.md
• AnnotationsはConfigMapよりも優先されます。
Route Resource *お持ちのNGINXコンフィグをserver/locationブロックに追加していただけます。 Annotations: server-snippets, location-snippets server { listen <parameters>;
location <url> { ---------------- } } upstream { ------------------- } server { listen <parameters>; location <url> { ---------------- } } upstream { ------------------- } nginx-service.conf server { listen <parameters>; location <url> { ---------------- } } upstream { ------------------- }
NGINX Plusだと使える機能ある?
Ingress Example – セッション維持 NGINX Ingress Controller https://cafe.example.com/v1.0 Upstream: v1-service:80
Upstream: v1-service:80 NGINX Plus Cookie NGINX Ingress Controller
Ingress Example – Active Health Check NGINX Ingress Controller https://cafe.example.com/v1.0
Upstream: v1-service:80 NGINX Plus Header: Content-Type = text/html Body: ”Welcome to nginx!” NGINX Ingress Controller
Ingress Example – JWT/OpenID認証 NGINX Ingress Controller https://cafe.example.com/v1.0 Upstream: v1-service:80
Upstream: v1-service:80 NGINX Plus JWT 認証 NGINX Ingress Controller
Ingress Example - External Name NGINX Ingress Controller https://cafe.example.com/v2.0 Upstream:
v1-service:80 https://cafe.example.com/v1.9 Service Type: ExternalName ec2-3-112-127-6.ap-northeast-1.compute.amazonaws.com:80 NGINX Plus Ingress Kubernetes Cluster Amazon EC2 Elastic Beanstalk AWS Fargate Amazon S3
Ingress Example - External Name NGINX Ingress Controller https://cafe.example.com/v2.0 Upstream:
v1-service:80 https://cafe.example.com/v1.9 Service Type: ExternalName old-api.nginx.co.jp NGINX Plus Ingress Kubernetes Cluster オンプレ環境 • 物理FW/LB • 物理サーバ/ストレージ
NGINX Custom Resources?
NGINX Custom Resources 設定変更 VirtualServer VirtualServerRoute apiVersion: k8s.nginx.org/v1 kind: VirtualServer
metadata: name: vs spec: host: virtual.example.com tls: secret: cafe-secret upstreams: - name: tea service: tea-svc port: 80 routes: - path: /aaa upstream: tea - path: /ccc route: default/ccc 新しいL7ルーティング構成のご提案です。 トラフィック分割や高度なコンテンツ ベースのルーティングなど、 Ingressでサポートされていないユース ケースが有効になります。 Custom Resources of NGINX
Custom Resources: URLベースルーティング http://example.com/foo Upstream: foo-service:80 Upstream: bar-service:80 Virtual Server
http://example.com/bar
Custom Resources: ホストベースルーティング http://foo.example.com/ Upstream: foo-service:80 Upstream: bar-service:80 NGINX Ingress
Controller http://bar.example.com/ Virtual Server
CustomResources 設定例 (Request Method) https://example.com/app/ Upstream: Backend-A Upstream: Backend-B GET
POST VirtualServer VirtualServerRoute
CustomResources 設定例 (Weight) https://example.com/app/ weight:90 weight:10 Upstream: Backend-Stable Upstream: Backend-Canary
VirtualServer VirtualServerRoute
Micro Services, Service Mesh, Now What?
MORE INFORMATION AT NGINX.COM サイドカーアーキテクチャ • アウトバウンド ロードバランシング • サービスディスカバリー
• 認証/認可 • SSL ターミネーション(mTLS)
MORE INFORMATION AT NGINX.COM Red Hat OpenShift Service Mesh (Istio)
Config設定 Policy管理 mTLS 証明書管理 サービス間通信
MORE INFORMATION AT NGINX.COM • 下位互換性 – ALPN 使用、HTTP/1 と並んで
HTTP/2 をサポート (OpenSSL1.0.2 以降が必要です) • HTTP/2 ゲートウェイ– HTTP/2 を既存のアプリ サーバーが理解できるプロトコルに変換 NGINXをリバースプロキシとして利用する HTTP/3 *開発中 アプリケーション サーバ
まとめ - NGINX Ingress Controllerを様々なk8s環境(GKE, AWS, Azure)で利用できます. - 既存NGINX Configをk8s環境へ持ち込んでいただけます.
- 柔軟なリバースプロキシ (GKE→AWS/物理) - F5 NetworksによりNGINXを作成しているチームが商用サポートします.
ありがとうございました. Thank you!