white-forest-65475
02/20/2023, 4:23 PM# Apply the Argo CD installation manifest from a URL
argocd_install_manifest = k8s.yaml.ConfigGroup(
"argocd-install-manifest",
files=["<https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/install.yaml>"],
transformations=[set_namespace],
opts=opts,
)
# Extract the argocd-server Service and register it's IP address as an output.
argocd_service = argocd_install_manifest.get_resource("service", "argocd-server")
argocd_service_ip = argocd_service.status.loadBalancer.ingress[0].ip
pulumi.export("argocd-service-ip", argocd_service_ip)
This code fails with an error saying that it can’t find a service by that name. I’ve also tried calling k8s.core.v1.Service.get(“argocd-server”, None, opts) but the second argument, ‘id’, it’s not clear to me what I should supply it an None does not work. The service definitely does exist, although to be fair I think it is currently a ClusterIP service, but the error seems to be directly related to service not being found as pulumi up
errors out with this final stack frame:
File "/Users/erich/Library/Caches/pypoetry/virtualenvs/blumeops-yejfY_2Q-py3.11/lib/python3.11/site-packages/pulumi/output.py", line 263, in lift
return UNKNOWN if isinstance(v, Unknown) else cast(Any, v)[key]
~~~~~~~~~~~~^^^^^
KeyError: 'service:argocd-server'
Can anyone help me figure out how to extract this service’s IP?billowy-army-68599
02/20/2023, 5:08 PM.get
is <namespace>/<service-name>
white-forest-65475
02/20/2023, 5:40 PMargocd_service = k8s.core.v1.Service.get(namespace.metadata.name, "argocd-server")
This produces an error about expecting a name.
I also tried:
argocd_service = k8s.core.v1.Service.get(pulumi.Output.concat(namespace.metadata.name, "/argocd-server"))
But this fails with a typerror as .get
requires at least 2 args - resource_name
and `id`: https://github.com/pulumi/pulumi-kubernetes/blob/3157468a01a22603ae0a2e618851929770c1b762/sdk/python/pulumi_kubernetes/core/v1/Service.py#L285-L286billowy-army-68599
02/20/2023, 5:52 PMargocd_service = k8s.core.v1.Service.get("argo-service", pulumi.Output.concat(namespace.metadata.name, "/argocd-server"))
white-forest-65475
02/20/2023, 6:02 PMbillowy-army-68599
02/20/2023, 6:06 PMwhite-forest-65475
02/20/2023, 6:56 PMbillowy-army-68599
02/20/2023, 6:56 PMwhite-forest-65475
02/20/2023, 6:57 PMbillowy-army-68599
02/20/2023, 6:57 PMwhite-forest-65475
02/20/2023, 6:57 PM