Hi everyone. I'm trying to implement argocd as a ...
# general
d
Hi everyone. I'm trying to implement argocd as a CD main tool. Currently, I have all the k8s definitions (Deployments/svc/ing/ etc ) in pulumi. Is there any documentation or example on how to deploy these k8s objects combining argocd and pulumi? According to the official documentation, I see that Pulumi Kubernetes Operator works with Flux. Important note: I am trying to avoid converting all the typescript code to helm charts or Kustomize files. Thanks in advance.
m
Hi You can use the Pulumi Operator with ArgoCD too. ArgoCD does not have the concept of
GitRepositories
as own resource.
b
@delightful-terabyte-60652 argoCD is just an operator, so you can define all the custom resources with pulumi using crd2pulumi. Here’s an example in Python: https://github.com/jaxxstorm/pulumi-examples/blob/main/python/aws/eks_helm_argo/__main__.py
s
It's worth looking at Pulumi features to generate K8s YAML as a side effect of executing the Pulumi app code i.e. don't call K8s API directly - https://www.pulumi.com/blog/kubernetes-yaml-generation/ By doing this, the interface between ArgoCD and Pulumi remains the Git repo containing YAML, so it works well with GitOps. One benefit of using this 'fully instantiated YAML' model (relative to Kustomize files) is that you can use normal Pulumi code to parameterise everything, like with direct API calls, but still see exactly what should be on the cluster in YAML terms. If you want to use third-party Helm charts from within Pulumi that's a different problem - often it's better to use those directly from upstream rather than try to convert them into Pulumi or Kustomize.
We already use Argo with Kustomize so we will probably still support running Kustomize to handle existing app YAML with overlays by Kustomize, but I'd like to use Pulumi for all new code in this 'render to YAML' mode.