【发布时间】:2020-05-27 16:15:54
【问题描述】:
我已使用此 Ingress-Nginx-Doc 将入口 nginx 控制器部署到 Aws EKS 集群
问题:
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-ingress
namespace: mynamespace
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
spec:
- path: /
backend:
serviceName: my-app
servicePort: 7300
当我访问我的应用程序时。 http://load-balancer-url/nginx 抛出 503。
[27/May/2020:15:27:40 +0000] "GET / HTTP/1.1" 503 600 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36" 662 0.000 [namespace-serviceName-7300] [] - - - - 21eb2db883548292ce20a71ddf45df99
W0527 15:39:07.037844 6 controller.go:909] Service "mynamespace/service" does not have any active Endpoint.
我是否遗漏了任何注释?
---
apiVersion: v1
kind: Service
metadata:
name: my-app
labels:
app: my-app
spec:
type: ClusterIP
ports:
- protocol : TCP
port: 7300
targetPort: 7300
selector:
name: my-app
namespace: my-namespace
【问题讨论】:
-
分享 kubectl describe svc my-app 的输出
-
Name: my-app Namespace: my-namespace Labels: app=myname Annotations: Selector: name=my-app,namespace=mynamespace Type: ClusterIP IP: 172.20.26.* Port: <unset> 7300/TCP TargetPort: 7300/TCP Endpoints: <none> Session Affinity: None Events: <none> -
通过不在 cmets 中编辑来共享有问题的服务和 pod yaml
-
@ArghyaSadhu 分享
标签: kubernetes amazon-eks