Thread
#kubernetes
    s

    square-car-84996

    7 months ago
    i have a helm release i'm deploying with pulumi. Does anyone have a good pattern for making API calls to configure the service after it is created/updated? This helm chart is severely lacking in the ability to configure it decoratively in the chart values, so I need to configure it post-deployment.
    q

    quiet-wolf-18467

    7 months ago
    Helm Release doesn't support transformations, but if you don't need Helm Release you can use Helm Chart resource which does.
    Failing that, you'd need to fork the chart or deploy a separate service and use that instead of the Helm one
    If you really really wanna go nuts, use a mutating admission controller; perhaps via Kyverno
    s

    square-car-84996

    7 months ago
    ... no what i want to do is use the service's REST API to configure the software, but i need to wait until after it's created/updated, and then ideally just invoke a whole bunch of
    fetch()
    requests to it.
    i've thought about spawning k8s jobs to configure it which would "work" but, also invoking the requests from within the pulumi/typescript process may be simpler by removing the container/job layer
    q

    quiet-wolf-18467

    7 months ago
    Apologies, I misunderstood 🙂
    HelmRelease
    will wait for resources to be healthy, so you should be able to start configuring via the API with any REST client using
    release.apply(release => {})
    s

    square-car-84996

    7 months ago
    oh, thats nice... thats super nice
    so... i
    so, the Release object doesn't have an apply method, and if i wrap it in
    pulumi.output()
    it executes the code during preview
    q

    quiet-wolf-18467

    7 months ago
    I'll try and do something similar today. Worst case, we can wrap arbitrary code into a component resource that has the release as a dependency
    s

    square-car-84996

    7 months ago
    i'm trying to use a componentresource, but the pulumi.all([release]).apply() code executes during preview, and it hard errors inside...
    q

    quiet-wolf-18467

    7 months ago
    Apply code shouldn't run in preview 😲
    Can you share code?
    s

    square-car-84996

    7 months ago
    i can't easily share what i'm doing... let me see if i can make a simple reproduction of what i'm trying to do