开发 k8s 管理平台 - k8sailor 20. 为 Deployment 创建 Ingress 原文地址: https://tangx.in/posts/books/k8sailor/chapter02/01-install-k3s-cluster/ tag: https://github.com/tangx/k8sailor/tree/feat/20-create-ingress k8s ingress https://kubernetes.io/zh/docs/concepts/services-networking/ingress/ 1 2 3 4 # Create an ingress with a default backend kubectl create ingress ingdefault --class=default \ --default-backend=defaultsvc:http \ --rule="foo.com/*=svc:8080,tls=secret1" --dry-run -o yaml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 apiVersion: networking.k8s.io/v1 kind: Ingress metadata: creationTimestamp: null name: ingdefault spec: defaultBackend: service: name: defaultsvc port: name: http ingressClassName: default rules: - host: foo.com http: paths: - backend: service: name: svc port: number: 8080 path: / pathType: Prefix # 匹配方式 tls: - hosts: - foo.com secretName: secret1 status: loadBalancer: {} 路径类型 Ingress 中的每个……
阅读全文