我在Google Cloud上运行Kubernetes的网站。目前,一切运作良好 - 通过http。但我需要https。我有几个服务,其中一个是暴露给外面的世界,我们称之为网络。据我所知,这是唯一需要修改的服务。我尝试在GCP的网络部分创建静态IP和TCP / SSL负载均衡器ssl-LB,并在我创建的web.yaml中使用该LB.创建服务时遇到困难:
Error creating load balancer (will retry): Failed to create load
balancer for service default/web: requested ip <IP> is
neither static nor assigned to LB
aff3a4e1f487f11e787cc42010a84016(default/web): <nil>
根据GCP,我的IP是静态的。哈希LB在任何地方都找不到,无论如何都应该分配给ssl-LB.如何正确分配?
更多细节:
以下是web.yaml的内容
apiVersion: v1
kind: Service
metadata:
name: web
labels:
...
spec:
type: LoadBalancer
loadBalancerIP: <RESERVED STATIC IP>
ports:
- port: 443
targetPort: 7770
selector:
...
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: web
spec:
replicas: 1
template:
metadata:
labels:
...
spec:
containers:
- name: web
image: gcr.io/<PROJECT>/<IMAGE NAME>
ports:
- containerPort: 7770