I have a setup that is not too much different than the user guide与k8s一起使用。出于某种原因,我只能访问http://app.minikube
而不是https://app.minikube
。
有人可以查看我的设置,看看我显然缺少什么吗?
apiVersion: v1
kind: Service
metadata:
name: myapp
labels:
app: myapp
spec:
ports:
- name: http
port: 80
targetPort: 7777
selector:
app: myapp
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myingress
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: app.minikube
http:
paths:
- path: /
backend:
serviceName: myapp
servicePort: http
tls:
- secretName: mytls
仅供参考,根据Traefik user guide,hosts
中的tls
定义是不必要的,这就是我将其删除的原因。
忽略TLS配置中的字段主机。相反,证书提供的域用于此目的。建议不要使用通配符证书,因为它们将全局匹配)
答案 0 :(得分:0)
您错过了hosts
部分:
tls:
- hosts:
- my-host.example.com
secretName: my-secret