Ingress-nginx资源清单

  • http
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-http
  namespace: test
spec:
  ingressClassName: nginx
  rules:
  - host: test.nginx.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: service
            port:
              number: 3017
		  
  • https

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-http
  namespace: test
spec:
  tls:
   - hosts:
     - test.nginx.com
     secretName: my-tls
  ingressClassName: nginx
  rules:
  - host: test.nginx.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: service
            port:
              number: 80

image

测试

  • 在本机,进入C:\Windows\System32\drivers\etc,修改hosts文件
  • 增加域名解析
    image
posted @ 2022-11-09 19:44  弩哥++  阅读(58)  评论(0编辑  收藏  举报