Related to the above - I’m still trying to extract...
# python
w
Related to the above - I’m still trying to extract the IP address of this LoadBalancer, and I keep getting an error during the preview phase of `pulumi up`:
Copy code
Diagnostics:
  kubernetes:core/v1:Service (argocd-server):
    error: Preview failed: resource 'blumeops-de4233d6/argocd-server' does not exist
This is the minimal amount of code I’m using which will generate the error… recall from above that argocd_install_manifest is derived from a yaml manifest file ingested by a
k8s.yaml.ConfigGroup
.
Copy code
argocd_service = k8s.core.v1.Service.get(
    "argocd-server",
    pulumi.Output.concat(namespace.metadata.name, "/argocd-server"),
    opts=pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(depends_on=argocd_install_manifest)),
)
Am I missing something here? How can I tell pulumi that it’s OK if the service doesn’t exist yet… it should just wait until the manifest is ready?
b
No necessarily, it’ll wait until the manifest resource returns an output. If you want to properly await the install of the service, use some logic inside an apply or convert the manifest to Pulumi code. I have an Argo cd example in python I can send in a few mins
w
Thanks. Yeah, I had originally wanted to stick with their upstream raw manifest for simplicity, but if converting it to pulumi is the easiest way then that’s fine by me, it’s not a particularly complex install other than perhaps the CRDs which should only need to be installed so should be handleable.
I generally only use the
ConfigFile
resource for install CRDs, everything else you can pipe through
kube2pulumi
w
It looks like this uses helm. I have weirdly managed to avoid learning anything about helm so far, not out of any opinion on helm of mine but just from circumstance. Is there anything I should know about needing it here? Is there any magic it’s adding beyond the creation of the necessary argocd resources in k8s?
b
nope, you can replace the helm part by just dojng
kube2pulumi
on that install manifest
w
Hrm, it looks like
kube2pulumi
has a bug related to lists of objects with only one key:
Copy code
❯ kube2pulumi python -f not-crds.yaml
Error: Error: Missing item separator

  on pcl-1017078102.pp line 1301:
1298: ports = [
1299: {
1300: containerPort = 5556
1301: }
1302: {

Expected a comma to mark the beginning of the next item.
The relevant section seems to be:
Copy code
ports:
        - containerPort: 5556
        - containerPort: 5557
        - containerPort: 5558
If I change this to:
Copy code
ports:
        - containerPort: 5556
          name: foo
        - containerPort: 5557
          name: bar
        - containerPort: 5558
          name: baz
then processing proceeds to the next section where this construct exists.
b
Could you file an issue?
w
Will do!
Hmm, I can’t tell, is it an extension of this? https://github.com/pulumi/kube2pulumi/issues/65 Added a comment there. Thanks again for the help 🙂 I’m going to move on and just leave this as a documented TODO… at the end of the day, exporting the LB’s IP is just a convenience for development and in practice all dev environments are going to just use
minikube tunnel
and localhost
b
that looks to be the same issue yeah