k8s配置好了,要对外服务,怎么办,

参考:
https://cloud.tencent.com/developer/article/1903063

用官方提供的ingress-nginx:

ingress with tls:
https://kubernetes.io/docs/concepts/services-networking/ingress/#tls

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tls-example-ingress
spec:
  tls:
  - hosts:
      - https-example.foo.com
    secretName: testsecret-tls
  rules:
  - host: https-example.foo.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: service1
            port:
              number: 80

参考:
k8s 对外服务之ingress

使用 Kubernetes Ingress 对外暴露服务

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐