使用主机,tls和IP

时间:2019-03-28 08:47:12

标签: kubernetes-ingress azure-kubernetes nginx-ingress azure-traffic-manager

我正在使用AKS,并且需要使主机和IP(要访问的流量管理器)可以访问入口控制器,我在使用Nginx入口规则,如下所示: 例如使用https://foo.bar.comhttps://14.15.16.222

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: foo
  namespace: default
spec:
  tls:
  - hosts:
    - foo.bar.com
    secretName: foo-secret
  rules:
  - host: foo.bar.com
    http:
      paths:
      - backend:
          serviceName: echoheaders-x
          servicePort: 80
        path: /

1 个答案:

答案 0 :(得分:0)

即使我在访问IP时遇到证书错误,也可以通过以下配置来解决问题。

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: foo
  namespace: default
spec:
  tls:
  - hosts:
    - foo.bar.com
    secretName: foo-secret
  rules:
  - host: foo.bar.com
    http:
      paths:
      - backend:
          serviceName: echoheaders-x
          servicePort: 80
        path: /
    http:
      paths:
      - backend:
          serviceName: echoheaders-x
          servicePort: 80
        path: /