clusterpedia
clusterpedia copied to clipboard
Apiserver address is null when pediacluster is applied by kubeconfig
What would you like to be added?
Apiserver always be the real address.
Why is this needed?
1、apiserver set to “”
2、apiserver set to “dddd”
Hi @wuyingjun-lucky, Thanks for opening an issue! We will look into it as soon as possible.
Details
Instructions for interacting with me using comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.
@Iceber
Did you change the apiserver from the correct one to the wrong one?
apiserver set to “dddd”
The conditoins and printer column were changed in v0.4.1, it will make the output look better, you can update the image version and crd yaml.
Also the string may be a domain name, maybe it doesn't work now, but it may work in the future, so we will allow the user to set any value, but if there is an exception, we will tell the user via conditons
apiserver set to “”
The apiserver is allowed to be empty because the user can just provide kubeconfig. since we don't provide a multation webhook to parse the kubeconfig, the apiserver will be empty.
Here are some discussions in https://github.com/clusterpedia-io/clusterpedia/pull/115#discussion_r828847480
#115 (comment)
What I am confused about is why don`t we set the apiserver to the real address during reconcile cluster
Did you change the apiserver from the correct one to the wrong one? I do not start AA but just use kube-apiserver
#115 (comment)
What I am confused about is why don`t we set the apiserver to the real address during reconcile cluster
Extracting the apiserver address from kubeconfig seems like a good way to let the mutation webhook do the work. Try to only update the status when reconciling the cluster.
But we don't have a mutation webhook yet, so if it feels important to not have an spec.apiserver
fields, we can check and set this field when reconciling the cluster.
Add a mutation webhook for spec.apiserver, I'm not sure it's necessary
But we don't have a mutation webhook yet, so if it feels important to not have an
spec.apiserver
fields, we can check and set this field when reconciling the cluster.
I think you are right, let webhook do the work is more appropriately.
May be we need a clusterpedia-ctl which can fix it easily.
I found https://github.com/c-bata/go-prompt and may consider using it to create a kubectl plugin in the future.
This also means that the user does not need to execute the script to generate cluster shortcut for kubectl
#115 (comment)
What I am confused about is why don`t we set the apiserver to the real address during reconcile cluster
Extracting the apiserver address from kubeconfig seems like a good way to let the mutation webhook do the work. Try to only update the status when reconciling the cluster.
But we don't have a mutation webhook yet, so if it feels important to not have an
spec.apiserver
fields, we can check and set this field when reconciling the cluster.Add a mutation webhook for spec.apiserver, I'm not sure it's necessary
How about to place a field named apiserver
to pediacluster.status and we can fill the apiserver
just like fill the Version
@Iceber
But it may have same field in spec
and status
@Iceber
Until we support webhook, I think this is a good way to make sure the apiserver is displayed.