我在 GKE 上设置了 Istio(Kubernetes Ingress 模式,不是 Istio 网关)。但是,我无法使用 curl 从外部访问
kubectl get svc -n istio-system | grep ingressgateway
istio-ingressgateway LoadBalancer 10.48.11.240 35.222.111.100 15020:30115/TCP,80:31420/TCP,443:32019/TCP,31400:31267/TCP,15029:30180/TCP,15030:3105226/TCP,150313: TCP,15032:30437/TCP,15443:31792/TCP 41h
curl 35.222.111.100
curl: (7) 无法连接到 35.222.111.100 端口 80: Connection refused
这是 Ingress 的配置:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: istio
name: ingress
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: in-keycloak
port:
number: 8080
这是服务的配置:
apiVersion: v1
kind: Service
metadata:
name: in-keycloak
labels:
app: keycloak
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: keycloak
type: ClusterIP
如果我在本地机器(MacOS)上为 Docker Desktop 使用相同的配置,它工作正常。