https://pulumi.com logo
#general
Title
# general
a

ambitious-agent-35343

08/08/2022, 8:34 AM
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

mammoth-electrician-64525

08/08/2022, 8:36 AM
a

ambitious-agent-35343

08/08/2022, 11:31 AM
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

mammoth-electrician-64525

08/08/2022, 11:38 AM
@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

ambitious-agent-35343

08/08/2022, 11:44 AM
m

mammoth-electrician-64525

08/08/2022, 11:59 AM
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

ambitious-agent-35343

08/08/2022, 1:04 PM
Is there an existing example of a private repo ArgoCD deployment using Pulumi?
I've got it working šŸ™‚
šŸ‘ 1
160 Views