【发布时间】:2021-12-12 13:21:47
【问题描述】:
我正在根据document1 和document2 配置GKE Multi-Cluster Service,并受到multi-cluster-serice-communication-in-gke tutorial 的启发。
不知何故,我在“Registering a Service for export”上失败了 在第二个集群上。
我正在使用以下 YAML 文件在第一个(舰队集群)上导出 ngnix 服务
# export.yaml
kind: ServiceExport
apiVersion: net.gke.io/v1
metadata:
namespace: multy-service-poc
name: ngnix-service
并且导出良好 - 可从另一个集群访问,并且 ServiceExport 在第一个集群上的状态为 True
k describe serviceexport ngnix-service
Name: ngnix-service
Namespace: multy-service-poc
Labels: <none>
Annotations: <none>
API Version: net.gke.io/v1
Kind: ServiceExport
Metadata:
Creation Timestamp: 2021-12-11T11:22:37Z
Finalizers:
serviceexport.net.gke.io
Generation: 2
Managed Fields:
API Version: net.gke.io/v1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.:
f:kubectl.kubernetes.io/last-applied-configuration:
Manager: kubectl-client-side-apply
Operation: Update
Time: 2021-12-11T11:22:37Z
API Version: net.gke.io/v1alpha1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:finalizers:
.:
v:"serviceexport.net.gke.io":
f:spec:
f:status:
.:
f:conditions:
Manager: Google-GKE-MCS
Operation: Update
Time: 2021-12-11T11:22:39Z
Resource Version: 58873
UID: a42dc51c-93ff-4526-9c04-9702ed7ba95d
Spec:
Status:
Conditions:
Last Transition Time: 2021-12-11T11:22:38Z
Status: True
Type: Initialized
Last Transition Time: 2021-12-11T11:22:40Z
Status: True
Type: Exported
Events: <none>
当我使用相同的 YAML 文件在第二个集群上导出相同的服务时,它失败并且状态为 False
kubectl describe serviceexport ngnix-service
Name: ngnix-service
Namespace: multy-service-poc
Labels: <none>
Annotations: <none>
API Version: net.gke.io/v1
Kind: ServiceExport
Metadata:
Creation Timestamp: 2021-12-13T07:29:36Z
Finalizers:
serviceexport.net.gke.io
Generation: 2
Managed Fields:
API Version: net.gke.io/v1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.:
f:kubectl.kubernetes.io/last-applied-configuration:
Manager: kubectl-client-side-apply
Operation: Update
Time: 2021-12-13T07:29:36Z
API Version: net.gke.io/v1alpha1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:finalizers:
.:
v:"serviceexport.net.gke.io":
f:spec:
f:status:
.:
f:conditions:
Manager: Google-GKE-MCS
Operation: Update
Time: 2021-12-13T07:31:10Z
Resource Version: 1191220
UID: 45bb42a8-effc-4a9d-95e8-22ff736a54af
Spec:
Status:
Conditions:
Last Transition Time: 2021-12-13T07:30:03Z
Status: True
Type: Initialized
Last Transition Time: 2021-12-13T07:31:10Z
Message: Conflicting "Project". Using from oldest service export in cluster "projects/mssp-eugene-mcs1/locations/us-east1/clusters/mssp-eugene-mcs-k8s-cluster1"
Reason: Conflict
Status: False
Type: Exported
Events: <none>
我也看到了中心成员中的集群:
gcloud container hub memberships list --project eugene-mcs1
NAME EXTERNAL_ID
eugene-mcs-k8s-cluster2 e943ed80-6a49-4781-897c-57ae3266fb37
eugene-mcs-k8s-cluster1 074d59f2-fce2-491e-a99e-6d2b8587803c
预期的行为是从两个集群导出 ngnix-service 并相应地从两个集群公开 ngnix pod。
我的配置是 使用来自第三个宿主项目的共享 VPC 的不同项目中的 2 个 K8S 集群。
谢谢
【问题讨论】:
-
当您尝试在第二个集群中导出相同的服务并失败时,系统显示的消息是什么?能否请您分享错误消息的详细信息?
-
没有错误,我只是看到流量导向器没有添加“网络端点组”,所以我检查了第二个集群描述上的serviceexport,发现冲突消息和状态。跨度>
-
您是否按照google官方文档配置MCS?此外,请确保在两个集群中创建相同的命名空间。 cloud.google.com/kubernetes-engine/docs/how-to/…
-
Google Cloud 支持团队正在调查的问题。没有 ETA 的解决方案。
标签: google-kubernetes-engine kubernetes-service gke-networking