clusterpedia
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
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
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

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
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"}
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
@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.
/assign
@feeltimeQ Do you have some ideas on how to solve this bug?
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
This issue only affects the display when kubectl gets, and will be fixed in the future