Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to allow import of helm release #2136

Merged
merged 3 commits into from
Aug 15, 2022
Merged

Fixes to allow import of helm release #2136

merged 3 commits into from
Aug 15, 2022

Conversation

viveklak
Copy link
Contributor

Proposed changes

Since helm release don't record any information about the corresponding helm chart, some of the preview functionality in Helm release runs up against some rough edges. This change declares bankruptcy on generating a link to underlying resources specified in the chart if the helm chart can't be resolved.

Note: imported helm release resources will by default not contain repositoryOpts field since its not recorded in Helm itself. So the CLI will generate code similar to this:

ulumi import kubernetes:helm.sh/v3:Release nvidia-device-plugin nvidia-device-plugin/nvdp
Previewing import (dev)

...

Please copy the following code into your Pulumi application. Not doing so
will cause Pulumi to report that an update will happen on the next update command.

Please note that the imported resources are marked as protected. To destroy them
you will need to remove the `protect` option and run `pulumi update` *before*
the destroy will take effect.

import * as pulumi from "@pulumi/pulumi";
import * as kubernetes from "@pulumi/kubernetes";

const nvidia_device_plugin = new kubernetes.helm.v3.Release("nvidia-device-plugin", {
    atomic: false,
    chart: "nvidia-device-plugin",
    cleanupOnFail: false,
    createNamespace: false,
    dependencyUpdate: false,
    description: "",
    devel: false,
    disableCRDHooks: false,
    disableOpenapiValidation: false,
    disableWebhooks: false,
    forceUpdate: false,
    keyring: "",
    lint: false,
    name: "nvdp",
    namespace: "nvidia-device-plugin",
    postrender: "",
    recreatePods: false,
    renderSubchartNotes: false,
    replace: false,
    resetValues: false,
    resourceNames: {
        "DaemonSet.apps/apps/v1": ["nvdp-nvidia-device-plugin"],
    },
    reuseValues: false,
    skipAwait: false,
    skipCrds: false,
    timeout: 0,
    values: {},
    verify: false,
    version: "0.12.2",
    waitForJobs: false,
}, {
    protect: true,
});

or for imports from within pulumi code, the code will look something like this:

new k8s.helm.v3.Release("nvidia-device-plugin", {
    chart: "nvidia-device-plugin",
    version: "0.12.2",
    name: "nvdp",     
    namespace: "nvidia-device-plugin",
    // Not supported in import
    // repositoryOpts: { repo: "https://nvidia.github.io/k8s-device-plugin" },
    resourceNames: {
                "DaemonSet.apps/apps/v1": ["nvdp-nvidia-device-plugin"],
    },
    timeout: 0,                                                                  
  }, { 
    import: "nvidia-device-plugin/nvdp",
  });

Related issues (optional)

Fixes #2014

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

1 similar comment
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!!

@viveklak viveklak merged commit 5277945 into master Aug 15, 2022
@pulumi-bot pulumi-bot deleted the vl/2014 branch August 15, 2022 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to import Helm Release
3 participants