Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Cncf k8s_network_03 (Ingress introduction)

664 vues

Publié le

為了能夠讓使用者能夠順利的存取到 kubernetes 眾多運行的 Pods, kubernetes 花了很大把的精力在網路架構與使用這方面,之前已經詳細介紹過 Kubernetes Service 的用法以及原理。

這篇要來跟大家介紹另外一個相輔相成且好用的概念,也就是所謂的 Ingress。

透過 Ingress 我們能夠提供一些更方便的伺服器存取,不論是基於 URL 的存取導向,亦或是簡化整個 SSL 憑證部署的方式。

本文主要從 Ingress 的基本概念出發,介紹其基本架構並且從最常用的 Ingress Nginx 作為Ingress controller來介紹實際上Ingress是如何運作的。

Youtube: https://youtu.be/AagmJwWwvps

Publié dans : Technologie
  • Soyez le premier à commenter

Cncf k8s_network_03 (Ingress introduction)

  1. 1. Cloud Native: Kubernetes Network Kubernetes Part#3 (Ingress & Ingress Controller) 1
  2. 2. • 5 / • 3 MES/SFC • 3 ERP (SAP-MM )/EAI Leader • 2 End-To-End Business Integration Analyst • 1 OEM Sales Team Leader • 4 / • 6 / • IT – • 4.0 / - erhwenkuo@gmail.com 2
  3. 3. • , Kubernetes I : • Part#1 - Kubernetes • Part#2 - Kubernetes Service Deployment Pod • Part#3 - Kubernetes Ingress
  4. 4. • ” ” • https://www.hwchiu.com/ingress-1.html
  5. 5. • kubectl D SDK • T b O tT Provision r RBAC Quota PSP NetworkPolicy • e f s DNS g • Kubernetes h t K API i t n • t O Tt • Kubernetes u CI CD Workflow FaaS OTS ChatOps • Kubernetes CRI CNI CVI Cloud Provider t
  6. 6. Agenda 1. Kubernetes Ingress 2. Kubernetes, Ingress Ingress Controller 3. 6
  7. 7. • kubernetes Pods, kubernetes Kubernetes Service • Ingress • Ingress URL SSL • Ingress Ingress Nginx Ingress controller Ingress
  8. 8. Ingress • Kubernetes Service Pod IP • Kubernetes NodePort LoadBalancer Service Ingress • Ingress http http
  9. 9. Ingress controller Ingress • Ingress Resource Ingress Yaml • Backend server Ingress Host/Path Backend server
  10. 10. Ingress controller (Cont.) Ingress- Controller Ingress-Server • Ingress-Server HTTP/HTTPS Nginx • nginx.conf nginx server
  11. 11. Ingress controller (Cont.) • kubernetes ingress nginx.conf Kubernetes Ingress • Ingress Resource Ingress-Server (Nginx) (nginx.conf ) • Ingress-Controller
  12. 12. Ingress 1. yaml ingress kubernetes 2. Ingress-Controller Ingress Resource Nginx.conf Ingress- Server 3. Ingress-Server(Nginx) 4. Ingrss-Server(Nginx) nginx.conf backend server
  13. 13. I 3 1 Ingress 1. Kubernetes Ingress 2. Ingress- Server Ingress-Controller
  14. 14. Kubernetes ingress controller 14
  15. 15. Nginx Ingress Controller • Ingress Controller Traefik, Kong, Nginx (GKE/AKS/EKS) • Kubernates ingress-nginx • Github: https://github.com/kubernetes/ingress-nginx
  16. 16. Nginx Ingress Controller • Kubernetes • : https://kubernetes.github.io/ingr ess-nginx/deploy/
  17. 17. kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress- nginx/master/deploy/mandatory.yaml Nginx Ingress Controller • : Docker for Mac : 1. ”mandatory.yaml”
  18. 18. kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress- nginx/master/deploy/provider/cloud-generic.yaml Nginx Ingress Controller (Cont.) 2. ”cloud-generic.yaml”
  19. 19. kubectl get all –n ingress-nginx Nginx Ingress Controller • ”ingress-nginx”
  20. 20. Annotation (NIGINX Ingress Controller) • Ingress-Server Ingress Resource Ingress-Controller/Ingress-Server Annotation • nginx-ingress ingress controller, nginx- ingress annotation : • https://kubernetes.github.io/ingress-nginx/user-guide/nginx- configuration/annotations/
  21. 21. Annotation (NIGINX Ingress Controller)
  22. 22. Kubernetes ingress controller 22
  23. 23. Kubernetes ingress controller • Yaml gist • https://gist.github.com/erhwenkuo/cf289bcb437 b1354ee94f5f773571e12 Service App App App App Service Ingress Controller Pod Pod Pod Ingress https://gist.github.com/erhwenkuo/cf289bcb437b1354ee94f5f773571e12
  24. 24. Kubernetes ingress controller • Kubernetes • Deployment 3 Nginx pods • Service Deployment • Ingress, • test.example.com Nginx web • Service App App App App Service Ingress Controller Pod Pod Pod Ingress https://gist.github.com/erhwenkuo/cf289bcb437b1354ee94f5f773571e12
  25. 25. Deployment apiVersion: apps/v1beta2 kind: Deployment metadata: name: test-web-deployment namespace: default labels: app: test-web spec: replicas: 3 selector: matchLabels: app: test-web template: metadata: labels: app: test-web spec: containers: - name: test-web image: nginx imagePullPolicy: IfNotPresent ports: - name: http containerPort: 80 protocol: TCP • 3 Nginx pod deployment Service App App App App Service Ingress Controller Pod Pod Pod Ingress
  26. 26. Service App App App App Service Ingress Controller Pod Pod Pod Ingress Service apiVersion: v1 kind: Service metadata: name: test-web-service namespace: default labels: app: test-web spec: type: ClusterIP ports: - port: 80 targetPort: http protocol: TCP name: http selector: app: test-web • Service 3 Nginx pods
  27. 27. Service App App App App Service Ingress Controller Pod Pod Pod Ingress Ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test-web-ingress namespace: default spec: rules: - host: test.example.com http: paths: - backend: serviceName: test-web-service servicePort: 80 path: / • Ingress K8S - web
  28. 28. Hosts • Kubernetes Ingress hostname http/https • Host hostname(FQDN) IP address Service App App App App Service Ingress Controller Pod Pod Pod Ingress sudo vi /etc/hosts
  29. 29. • Chrome http://test.example.com Service App App App App Service Ingress Controller Pod Pod Pod Ingress
  30. 30. • Kubernetes Ingress Nginx Ingress Ingress • Ingress Controller
  31. 31. • 2 H K 3K: H I 2 ?H II ? N P • @ I @ @ K D ?H II @ DC • 1 0 I 6@ 3K: H I H ? 7 H - 9H • @ I D KD D . 9 8(() @ I @ K: H I H ? H 9H 9 • 3K: H I / 2 ?H II • @ I K: H I I I I H I H ? ?H II
  32. 32. 32 https://www.facebook.com/groups/dataengineering.tw/

×