Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When we use karmadactl to initialize the cluster, the specified ca certificate is not supported #5103

Closed
guozheng-shen opened this issue Jun 26, 2024 · 10 comments · Fixed by #5127
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@guozheng-shen
Copy link
Contributor

guozheng-shen commented Jun 26, 2024

What would you like to be added:
When we use karmadactl to initialize the cluster, we can use the specified ca certificate

Why is this needed:
We want access multiple karmada cluster using one kubeconfig, but now when we use karmadactl init cluster, it will create new ca certificate every times.
caCert, caKey, err := NewCACertAndKey("karmada")

Our karmada manages many clusters,If karmada is deployed in only one cluster, it is not highly available。So we deployed karmada in two k8s clusters, but using a common etcd cluster。
image

When a cluster is unavailable, we can remove its load in vip。So we need access multiple karmada cluster using one kubeconfig

@guozheng-shen guozheng-shen added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 26, 2024
@guozheng-shen guozheng-shen changed the title karmadactl When we use karmadactl to initialize the cluster, the specified ca certificate is not supported Jun 27, 2024
@RainbowMango
Copy link
Member

I think this is a reasonable use case that enables specifying each component's certificate.

@guozheng-shen Do you mean you want to specify the ETCD certificate?

Have you noticed the following options which provided at v1.10?

    --external-etcd-ca-cert-path='':
	The path of CA certificate of the external etcd cluster in pem format.

    --external-etcd-client-cert-path='':
	The path of client side certificate to the external etcd cluster in pem format.

    --external-etcd-client-key-path='':
	The path of client side private key to the external etcd cluster in pem format.

    --external-etcd-key-prefix='':
	The key prefix to be configured to kube-apiserver through --etcd-prefix.

    --external-etcd-servers='':
	The server urls of external etcd cluster, to be used by kube-apiserver through --etcd-servers.

@guozheng-shen
Copy link
Contributor Author

Not specify the ETCD certificate, I want specify root ca, now is
func GenCerts(pkiPath string, etcdServerCertCfg, etcdClientCertCfg, karmadaCertCfg, apiserverCertCfg, frontProxyClientCertCfg *CertsConfig) error { caCert, caKey, err := NewCACertAndKey("karmada")}

@RainbowMango
Copy link
Member

Yeah, I get it.
@liangyuanpeng @chaosi-zju what do you think?

@guozheng-shen
Copy link
Contributor Author

If this issue is approved, I can complete it, as this change has already been made and applied to the production environment in our company's usage.

@RainbowMango
Copy link
Member

Glad to hear that.
I'm interested in how you do it. How many options were introduced to karmadactl init?

By the way, as you mentioned, Karmada is already in your production environment, I wonder if your company is present on the adopter list?

@guozheng-shen
Copy link
Contributor Author

I added two options to karmadactl init, '--ca-cert-path /tmp/ca.crt' and '--ca-key-path /tmp/ca.key', If the options is exists , will directly copy rather then gen new certs。 adopter list is in preparation

@RainbowMango
Copy link
Member

I added two options to karmadactl init, '--ca-cert-path /tmp/ca.crt' and '--ca-key-path /tmp/ca.key', If the options is exists , will directly copy rather then gen new certs

Yeah, I think you can send a PR for this. Thanks in advance.

adopter list is in preparation

For the adopter things, all you need is to leave a comment on #4540, the community member will help to get you onboard after that, like karmada-io/community#75.

@liangyuanpeng
Copy link
Contributor

i agree with add some new option for it befor we have a karmadactl init configuration file. PR is welcome !

@chaosi-zju
Copy link
Member

I think this feature makes sense, and I'd be interested in reviewing this PR~

@guozheng-shen
Copy link
Contributor Author

I added two options to karmadactl init, '--ca-cert-path /tmp/ca.crt' and '--ca-key-path /tmp/ca.key', If the options is exists , will directly copy rather then gen new certs

Yeah, I think you can send a PR for this. Thanks in advance.

adopter list is in preparation

For the adopter things, all you need is to leave a comment on #4540, the community member will help to get you onboard after that, like karmada-io/community#75.

The adopter list has been submitted by my colleagues
#4540 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants