clusterpedia icon indicating copy to clipboard operation
clusterpedia copied to clipboard

When searching by specifying a resource name through clusterpedia, the CLUSTER-IP of the svc searched out is None, and the fuzzy search is the same problem

Open busy-tester opened this issue 2 years ago • 6 comments

What happened?

Search svc directly, service-nodeport has CLUSTER-IP

[root@dce-10-6-215-215 ~]# kubectl get svc -n zouzou NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service-clusterip ClusterIP 172.31.88.88 8080/TCP 4h44m service-headliness ClusterIP None 9090/TCP 4h44m service-nodeport NodePort 172.31.132.180 8888:30033/TCP 4h44m

By specifying a name search in clusterpedia, the cluster IP is not searched

[root@dce-10-6-215-215 ~]# kubectl --cluster clusterpedia get svc -n zouzou -l "search.clusterpedia.io/names=service-nodeport" CLUSTER NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cluster-215-215 service-nodeport NodePort 8888:30033/TCP 4h44m

image

What did you expect to happen?

SVC searched through clusterpedia also shows CLUSTER-IP

How can we reproduce it (as minimally and precisely as possible)?

[root@dce-10-6-215-215 ~]# kubectl get svc -n zouzou NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service-clusterip ClusterIP 172.31.88.88 8080/TCP 4h44m service-headliness ClusterIP None 9090/TCP 4h44m service-nodeport NodePort 172.31.132.180 8888:30033/TCP 4h44m [root@dce-10-6-215-215 ~]# kubectl --cluster clusterpedia get svc -n zouzou -l "search.clusterpedia.io/names=service-nodeport" CLUSTER NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cluster-215-215 service-nodeport NodePort 8888:30033/TCP 4h44m

Anything else we need to know?

No response

Clusterpedia Version

# replace the pod name of clusterpedia apiserver
$ kubectl -n clusterpedia-system exec {clusterpedia-apiserver-pod-name} -- apiserver --version=raw
# paste output here

# replace the pod name of clusterpedia clustersynchro-manager
$ kubectl -n clusterpedia-system exec {clustersynchro-manager-pod-name} -- clustersynchro-manager --version=raw
# paste output here

Host Kubernetes version

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.20", GitCommit:"1f3e19b7beb1cc0110255668c4238ed63dadb7ad", GitTreeState:"clean", BuildDate:"2021-06-16T12:58:51Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.20", GitCommit:"7c28a83e67cb506f9df948d7b23698f8f9c279b8", GitTreeState:"clean", BuildDate:"2021-07-15T08:58:53Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

busy-tester avatar Apr 18 '22 07:04 busy-tester

This is indeed an issue on 1.18 kube, due to the 1.22 dependency.

In 1.22 the service will use field .spec.clusterIPs to print CLUSTER-IP https://github.com/kubernetes/kubernetes/blob/7061dbbf75f9f82e8ab21f9be7e8ffcaae8e0d44/pkg/printers/internalversion/printers.go#L1154-L1163

But in 1.18 service does not have .spec.clusterIPs.

# 1.18 kube
kubectl get svc -o json

Iceber avatar Apr 18 '22 07:04 Iceber

@liuzouzou Thank you very much for discovering the issue.

Can you change the description to English so that others can view the issue?

We will fix this issue in 0.3.0, welcome to find more issues like this.

Iceber avatar Apr 18 '22 08:04 Iceber

/assign

feeltimeQ avatar Apr 27 '22 18:04 feeltimeQ

@feeltimeQ Do you have some ideas on how to solve this bug?

Iceber avatar Apr 28 '22 02:04 Iceber

I didn't reproduce this in k8s 1.21, do I need to reproduce it in 1.18. Sorry, I don't think I have a good idea, do you have any suggestions? @Iceber

feeltimeQ avatar May 05 '22 02:05 feeltimeQ

This issue only affects the display when kubectl gets, and will be fixed in the future

Iceber avatar May 30 '22 09:05 Iceber