Open exocode opened 1 year ago
Hi @exocode, I guess the problem in this case is the change in the crossplane's created secret's type. I haven't tested this operator with latest crossplane version. I have limited access to my PC right now. I will fix this in the upcoming days and ping you. In addition to that some operator basics have to be handled to use this operator in production. Some changes are also needed for new service account secret updates coming with kubernetes 1.24. I will try to look at these issues too.
This sounds great :-) I faced the same problem which your code seems to solve (Synchronizing and creation of Secrets which can consumed by ArgoCD).
I must admit, that I am not a Kubernetes or Go dev. But I tried to solve that problem and came up with that solution (which is a modified Repo) https://github.com/exocode/crossargo-sync/blob/master/main.go
What it does:
Namespace
for secrets containing a "kubeconfig"-key. secret
in a namespace
of your taste.provider-argo
Although "name" keys in "provider-argo" and ArgoCD are intended to not have to enter IP addresses (you can apparently use the cluster name https://github.com/crossplane-contrib/provider-argocd/blob/e15ad2fe53ded2d60324f8ed4ecddd761062724a/package/crds/cluster.argocd.crossplane.io_clusters.yaml#L201 ) but this didn't worked for me, maybe because I dont know how to use it properly. Only pitfall (because I am not a Go/Kubernetes dev) if the cluster is recreated, the new kubeconfig is not picked up, so I simply have to delete my secret and pod "crossargo-sync"-pod.
The main problem I have with all that, "automation" tasks are, that all ArgoCD resources which uses the cluster, must get assigned with that new IP in their manifests. Anyways, adding IP works at least for my needs.
Maybe everything I wrote is nonsense, ony want to share my difficulties and problems :-D I do not understand why it's so hard to have such function "out-of-the-box". I miss this gap-filler in GitOPs world. All is automatable, only that one isn't.
I am full of hope and expectation on your outcome 😇
best regards
Hi @exocode again, You can give it a try now. After your approval I will close this issue. There may be a problem on kubernetes v1.24(I will test this in an appropriate time). Except this, your problem has to be solved.
To be honest, I am not a go expert either. I am trying to learn more about go coding and kubernetes insights. You are totally right from the automation point. In this case problem is caused by the format of the secrets Argo CD expects for the cluster definition. Argo CD doesn't use raw kubeconfig so there has to be a conversion mechanism in between Argo CD and IaC tools like Crossplane. This can be added to Argo CD since this is a common use case. Keep in touch :)
@a1tan awesome. I will give a try at the end of the week. Maybe you can give me some instructions how to use your extension properly :-)
BTW: Here is my open issue at ArgoCD regarding the kubeconfig consumption: https://github.com/argoproj/argo-cd/issues/8107
It is so simple right now. There are some customizations that can be added but they are not implemented yet, so it is not complicated. :) After running two mentioned kubectl commands it has to work for Crossplane. By the way, I have fixed the problem for Kubernetes 1.24 too.
Hi @a1tan,
I wanna give your synchronizer a shot, but struggle a bit how to setup and use it correctly. I did the two commands in the readme but there are no secrets created.
Some information how my setup looks like:
demo-cluster
kubeconfig
is created automatically created and namedkubeconfig-demo-cluster
in thecrossplane-system
namepsacethat is my
secret
:This is my log:
Thank you very much in advance