Can we configure private repo's from Github with A...
# general
a
Can we configure private repo's from Github with ArgoCD managed by Pulumi?
Copy code
argo_app1 = app.argoproj.v1alpha1.Application(
    app1_name,
    metadata=k8s.meta.v1.ObjectMetaArgs(name=app1_name, namespace=ns.metadata.name),
    spec=app.argoproj.v1alpha1.ApplicationSpecArgs(
        destination=app.argoproj.v1alpha1.ApplicationSpecDestinationArgs(
            namespace=app1_ns.metadata.name,
            server="<https://kubernetes.default.svc>"
        ),
        project="default",
        source=app.argoproj.v1alpha1.ApplicationSpecSourceArgs(
            path=app1_name,
            repo_url="<https://github.com/private/repo>",  # Private repo
            target_revision="HEAD",
        ),
        sync_policy=app.argoproj.v1alpha1.ApplicationSpecSyncPolicyArgs(
            automated={}
        )
    ),
    opts=pulumi.ResourceOptions(provider=provider, depends_on=[argo, app1_ns]),
)
m
a
The following is not working for me:
Copy code
secret = k8s.core.v1.Secret(
    "private-ssh-repo",
    metadata={
        "name": "private-ssh-repo",
        "labels": {
            "<http://argocd.argoproj.io/secret-type|argocd.argoproj.io/secret-type>": "repository"
            },
        "namespace": "openshift-gitops",
    },
    data={
        "sshPrivateKey": "<BASE64 ENCODED PRIVATE KEY>",
        "type": "Z2l0",
        "url":  "<BASE64 ENCODED URL>",
    },
    opts=pulumi.ResourceOptions(provider=provider, parent=cluster),
)
ArgoCD: rpc error: code = Unknown desc = authentication required
m
@ambitious-agent-35343, Iā€™m seeing that you are using Kubernetes Provider that uses, by default,
kubeconfig
if available; maybe you can check if in your Pulumi environment you give the proper to authentication to your K8s cluster access(https://www.pulumi.com/registry/packages/kubernetes/installation-configuration/)
a
m
Hi @ambitious-agent-35343 based on your screenshot you already have privileges to create a new secret(already created), your Pulumi code already did what you want to do, however, your ArgoCD is complaining about authentication. Looks like it is out of your Pulumi code, please check it into your ArgoCD logs to figure out your ArgoCD configuration error.
a
Is there an existing example of a private repo ArgoCD deployment using Pulumi?
I've got it working šŸ™‚
šŸ‘ 1
227 Views