0

我在我的 kubernetes 集群中部署了一个基本服务。我使用这个 Ingress 处理路由:

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: owncloud
spec:
  rules:
    - host: example.com
      http:
        paths:
          - backend:
              serviceName: owncloud
              servicePort: 80

我使用生成的密钥和证书在默认命名空间中生成了一个 kubernetes 机密。我将其命名并将其example-tls添加到规范下的 Ingress 配置中:

tls:
- secretName: example-tls
  hosts: 
    - example.com  

当我使用 https ( curl -k https://example.com) 获取服务时,它会超时:

curl: (7) Failed to connect to example.com port 443: Connection timed out

它使用http工作。

这里可能有什么问题?

这是describe有关方面的输出ingress

Name:             owncloud
Namespace:        default
Address:
Default backend:  default-http-backend:80 (<none>)
Rules:
  Host                      Path  Backends
  ----                      ----  --------
  example.com
                               owncloud:80 (10.40.0.4:80)
Annotations:
  kubectl.kubernetes.io/last-applied-configuration:  {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{},"name":"owncloud","namespace":"default"},"spec":{"rules":[{"host":"example.com","http":{"paths":[{"backend":{"serviceName":"owncloud","servicePort":80}}]}}]}}

Events:  <none>

我的入口控制器服务:

$ kubectl describe service traefik-ingress-service -n kube-system

Name:                     traefik-ingress-service
Namespace:                kube-system
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"traefik-ingress-service","namespace":"kube-system"},"spec":{"port...
Selector:                 k8s-app=traefik-ingress-lb
Type:                     NodePort
IP:                       10.100.230.143
Port:                     web  80/TCP
TargetPort:               80/TCP
NodePort:                 web  32001/TCP
Endpoints:                10.46.0.1:80
Port:                     admin  8080/TCP
TargetPort:               8080/TCP
NodePort:                 admin  30480/TCP
Endpoints:                10.46.0.1:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>
4

0 回答 0