Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

オンプレでのNginx Ingress利用事例について

466 views

Published on

オンプレミスのk8s環境におけるNginx Ingressの利用事例について紹介しています。

Published in: Engineering
  • Be the first to comment

オンプレでのNginx Ingress利用事例について

  1. 1. Nginx Ingress
  2. 2. ● – : – : ● Kubernetes : 1 ● : 1 – : ● : 2
  3. 3. ● Kubernetes ● Ingress ● 3
  4. 4. 1. Kubernetes 4
  5. 5. Kubernetes 👋 5
  6. 6. Kubernetes ● OSS – ● – Clustering Self Healing Scaling/Auto Scaling 6
  7. 7. 1. Kubernetes 2. Pub/Sub Producer Producer Queue System Consumer Consumer Kubernetes 7
  8. 8. ( ) LB client client Producer API Proxy NIC Producer API Consumer NIC Ser vic e Proxy Proxy Producer API Consumer 8
  9. 9. ( ) LB client client :80 :80 :30080 :30080 Producer API Proxy NIC Producer API Consumer NIC Ser vic e Proxy Proxy Producer API 1. 2. NodePort Consumer 9 😊
  10. 10. ( ) LB client client :80 :80 :30080 :30080 Producer API Proxy NIC Producer API Consumer NIC Ser vic e Proxy Proxy Producer API 1. 2. NodePort Consumer Admin Other :30081,30082, 30083… :30081,30082, 30083… Admin Other 10 😢
  11. 11. 1. 2. Cluster A 30001 API, Cluster A 30002 Cluster A 30003 … Cluster B … LB … … 11
  12. 12. 2. Ingress 12
  13. 13. : Ingress Ingress Controller ● Ingress – Nginx Apache VirtualHost+L7LB – Ingress->Service->Pod ● Ingress Controller – – • Controller – • 😀 Hoge Hoge Foo Foo Ingress hoge.example.com foo.example.com Service Service 13
  14. 14. 😀 Y^Y^Y^Y^Y^Y^Y^Y 14
  15. 15. Ingress Controller Treafik Ingress Controller Nginx Ingress Controller HAProxy Ingress Controller Kubernetes ※ Nginx -> 15 ※ nginxinc
  16. 16. Nginx Ingress Controller nginxinc (OSS) kubernetes nginxinc ( ) Nginx Nginx 
 -> 16
  17. 17. Nginx Ingress Kustomize 1. Custom &Bundle 2. Sync 3. Deploy Kubernetes CD Kubernetes 17
  18. 18. Nginx Ingress Nginx Nginx Ingress annotations: nginx.org/rewrites: serviceName=coffee-svc rewrite=/ coffee/" nginx.org/server-snippets: | location / { return 302 /coffee; } location / { return 302 /coffee; } server { server_name hoge.com; } spec: rules: - host: hoge.com 18
  19. 19. LB client client :80 :80 :30080 :30080 Producer API Proxy Producer API Consumer NIC Ser vic e Proxy Proxy Producer API 1. 2. NodePort Consumer Admin Other :30081,30082, 30083… :30081,30082, 30083… Admin Other NIC 19 😢
  20. 20. LB client client :80 :80 :80 :80 Producer API Proxy NIC Producer API Consumer NIC Ser vic e Producer API 1. Consumer Admin Other Admin Other Ing res s 2. Ingress 20 😊
  21. 21. Nginx Ingress 1. Pod 2. 21 Cluster A 30001 API, Cluster A 30002 Cluster A 30003 … Cluster B … LB … … ❌
  22. 22. Nginx Ingress 1. 2. / Prometheus etc… 22
  23. 23. Nginx Ingress 3. gRPC 2. Controller Controller class 1. Service OK,Ingress NG k8s Ingress Service Pod 23 4. exporter OK nginx.org/grpc-services: ”svc” -ingress-class “nginx” Kubernetes.io/ingress.class: nginx -enable-prometheus-metrics ❌ ⭕
  24. 24. 24 1. Ingress 2. Controller 3. Nginx Ingress Nginx Service / Nginx Ingress … Treafik Ingress nginx.org/server-snippets: | location / { return 302 /coffee; }
  25. 25. Shall We Ingress 25
  26. 26. Appendix 26
  27. 27. Resource Controller ● Resource – k8s – Ex. Deployment,Ingress – ● Controller – – Ex. Deployment Controller, Ingress Controller – (Reconcile) 27
  28. 28. Resource Controller ● Deployment Controller – Replicaset – Deployment Controller Replicaset Deployment Deployment Controller Deployment Controller Deployment Controller 28
  29. 29. ● – – https://www.pakutaso.com/userpolicy.html – https://www.pakutaso.com/20190636158post-21176.html 29

×