我已经配置了通过端口80上的apache公开的Web应用程序pod。我无法配置用于从Internet访问的服务+入口。问题在于后端服务始终报告为“不正常”。
pod Config:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: webapp
name: webapp
namespace: my-app
spec:
replicas: 1
selector:
matchLabels:
name: webapp
template:
metadata:
labels:
name: webapp
spec:
containers:
- image: asia.gcr.io/my-app/my-app:latest
name: webapp
ports:
- containerPort: 80
name: http-server
服务配置:
apiVersion: v1
kind: Service
metadata:
name: webapp-service
spec:
type: NodePort
selector:
name: webapp
ports:
- protocol: TCP
port: 50000
targetPort: 80
入口配置:
kind: Ingress
metadata:
name: webapp-ingress
spec:
backend:
serviceName: webapp-service
servicePort: 50000
这导致后端服务报告为不健康。
健康检查设置:
Path: /
Protocol: HTTP
Port: 32463
Proxy protocol: NONE
其他信息:我尝试了另一种方法来将部署作为具有外部IP的负载平衡器公开,并且效果很好。尝试使用NodePort + Ingress时,此问题仍然存在。