我在 Redhat 7.9 机器上使用 k8s v19 部署 Jenkins 应用程序。我可以使用端口号连接到应用程序 URL(jenkins-test-ci.xyz.com:32419(节点端口)。)但无法登录通过jenkins-test-ci.xyz.com。
我已经配置了 Nodeport 服务和 Ingress 规则,如下所示
---
apiVersion: v1
kind: Service
metadata:
labels:
run: jenkins-test-svc
name: jenkins-test-svc
namespace: ci-cd
spec:
type: NodePort
ports:
- name: webui
port: 8080
protocol: TCP
targetPort: 8080
- name: jnlp
port: 50000
protocol: TCP
targetPort: 50000
selector:
app: jenkins-test
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: jenkins-test
namespace: ci-cd
spec:
tls:
- hosts:
- jenkins-test-ci.xyz.com
secretName: qa-pss-ci
rules:
- host: jenkins-test-ci.xyz.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: jenkins-test-svc
port:
number: 8080
[root@xyz 部署]# kubectl 记录 haproxy-ingress-snkjc -n ingress-controller
I0105 09:13:06.968207 6 launch.go:142]
Name: HAProxy
Release: v0.7.1
Build: git-5dc0d6f
Repository: https://github.com/jcmoraisjr/haproxy-ingress
I0105 09:13:06.968268 6 launch.go:145] Watching for ingress class: haproxy
I0105 09:13:06.969008 6 launch.go:345] Creating API client for https://x.x.x.x:443
I0105 09:13:06.977711 6 launch.go:357] Running in Kubernetes Cluster version v1.19 (v1.19.6) - git (clean) commit fbf646b339dc52336b55d8ec85c181981b86331a - platform linux/amd64
I0105 09:13:06.979849 6 launch.go:169] validated ingress-controller/ingress-default-backend as the default backend
I0105 09:13:06.984382 6 controller.go:1496] starting Ingress controller
I0105 09:13:06.992673 6 event.go:218] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"ci-cd", Name:"jenkins-test", UID:"b06bb11c-427c-4fe6-a543-8f6d1705237c", APIVersion:"extensions", ResourceVersion:"1230711", FieldPath:""}): type: 'Normal' reason: 'CREATE' Ingress ci-cd/jenkins-test
I0105 09:13:12.322064 6 controller.go:1504] running initial sync of secrets
I0105 09:13:12.323590 6 backend_ssl.go:71] adding secret ci-cd/qa-pss-ci to the local store
I0105 09:13:12.323760 6 leaderelection.go:174] attempting to acquire leader lease...
W0105 09:13:12.325376 6 controller.go:521] service ingress-controller/ingress-default-backend does not have any active endpoints
I0105 09:13:12.325579 6 controller.go:332] backend reload required
I0105 09:13:12.330463 6 leaderelection.go:184] successfully acquired lease ingress-controller/ingress-controller-leader-haproxy
I0105 09:13:12.330511 6 status.go:199] new leader elected: haproxy-ingress-snkjc
I0105 09:13:12.358898 6 controller.go:341] ingress backend successfully reloaded...
I0105 09:13:16.360882 6 controller.go:332] backend reload required
I0105 09:13:16.394526 6 controller.go:341] ingress backend successfully reloaded...
请建议解决此问题。谢谢