【发布时间】:2021-08-02 20:00:41
【问题描述】:
希望你一切都好,
我目前正在尝试将 awx-operator 推广到 Kubernetes 集群,但在从集群外部访问服务时遇到了一些问题。
目前我设置了以下服务:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
awx NodePort 10.102.30.6 <none> 8080:32155/TCP 110m
awx-operator NodePort 10.110.147.152 <none> 80:31867/TCP 125m
awx-operator-metrics ClusterIP 10.105.190.155 <none> 8383/TCP,8686/TCP 3h17m
awx-postgres ClusterIP None <none> 5432/TCP 3h16m
awx-service ClusterIP 10.102.86.14 <none> 80/TCP 121m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 17h
我确实设置了一个名为awx-operator 的NodePort。我确实尝试创建应用程序的入口。您可以在下面看到:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: awx-ingress
spec:
rules:
- host: awx.mycompany.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: awx
port:
number: 80
当我创建入口,然后运行 kubectl describe ingress 时,我得到以下输出:
Name: awx-ingress
Namespace: default
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
awx.mycompany.com
/ awx:80 (10.244.1.8:8080)
Annotations: <none>
Events: <none>
现在我不太确定 default-http-backend:80 错误是否是一个红鲱鱼,因为我在很多地方都看到了这一点,他们似乎并不太担心,但如果我错了,请纠正我。
请让我知道是否还有其他方法可以解决此问题,我会尽快回复您。
【问题讨论】:
-
您可以忽略默认后端。您可能为入口选择了错误的服务/端口。尝试
awx-service与端口80或awx与端口8080。 -
谢谢你,我现在就试试,但在我做之前。我见过几个使用
kubectl create而不是kubectl apply的地方。有什么区别? -
嗨,在
awx-service和端口 80 上运行入口,当我运行kubectl get ingress时,我得到以下输出:NAME CLASS HOSTS ADDRESS PORTS AGE awx-ingress <none> awx.mycompany.com 80 72s我感觉地址为空白是问题所在。
标签: kubernetes ansible ansible-awx