{"id":28420716,"url":"https://github.com/redhat-developer/helm-dump","last_synced_at":"2025-06-26T17:31:49.161Z","repository":{"id":38310114,"uuid":"464428906","full_name":"redhat-developer/helm-dump","owner":"redhat-developer","description":"helm-dump is a Helm plugin to create a Helm chart from existing cluster resources","archived":false,"fork":false,"pushed_at":"2023-02-17T09:21:57.000Z","size":156,"stargazers_count":12,"open_issues_count":3,"forks_count":2,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-05T05:30:07.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-28T10:04:23.000Z","updated_at":"2025-04-14T12:02:55.000Z","dependencies_parsed_at":"2024-06-19T11:15:14.240Z","dependency_job_id":"9ca018ac-f7eb-4d5e-ad7a-554bba339836","html_url":"https://github.com/redhat-developer/helm-dump","commit_stats":{"total_commits":72,"total_committers":2,"mean_commits":36.0,"dds":"0.19444444444444442","last_synced_commit":"2b98f5d12515a8ccb90d78abd65ff135753dfc3e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-developer/helm-dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Fhelm-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Fhelm-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Fhelm-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Fhelm-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-developer","download_url":"https://codeload.github.com/redhat-developer/helm-dump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Fhelm-dump/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262113293,"owners_count":23261000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-05T03:49:25.465Z","updated_at":"2025-06-26T17:31:49.151Z","avatar_url":"https://github.com/redhat-developer.png","language":"Go","readme":"# helm-dump: a Helm plugin to create a Helm chart from existing cluster resources\n\n![](https://img.shields.io/github/v/release/redhat-developer/helm-dump)\n![](https://img.shields.io/github/workflow/status/redhat-developer/helm-dump/release)\n\n## Overview of the helm-dump plugin\n\nConsider a case where as a Helm chart developer, you have configured a workload on either a Kubernetes or an OpenShift cluster. The requirement is to have this workload replicated either in the same or another OpenShift cluster by using a Helm chart. Use the `helm-dump` plug-in to create and export Helm charts based on the resources of a deployed workload available in an OpenShift or Kubernetes cluster. You can run the `helm-dump` plug-in against a namespace and generate a Helm chart for resources in the namespace that match a particular filter.\n\nThe `helm-dump` plug-in helps you transfer scalar values such as numbers or strings from a Helm chart template into the chart's `values.yaml` file.\n\n## Quick start\n\nThe quickstart showcases the `helm-dump` plug-in. You must install the plug-in and use it to create and export Helm charts. The quickstart consists of the following procedures:\n\n1. Installing the `helm-dump` plug-in\n2. Installing the template deployment \n3. Labeling the `Deployment` resource\n4. Extracting a Helm chart\n5. Installing the newly created Helm chart into a cluster\n\n### Installing the `helm-dump` plug-in\n\nBinary downloads of the `helm-dump` plug-in are available on the Releases page.\n\n#### Prerequisites\n\nYou must have GoReleaser to manage the project's build process and compile this software.\n\n#### Procedure\n\n1. Download either the `helm-dump_\u003cVERSION\u003e.tar.gz` or `helm-dump_\u003cVERSION\u003e.zip` file.\n\n2. Unpack its contents in the `$HELM_PLUGINS` directory:\n```\n# for HELM_PLUGINS environment variable\neval $(helm env)\n\n# unpack the tarball\ntar xvfz ~/Downloads/helm-dump_0.2.1.tar.gz -C \"$HELM_PLUGINS\"\n# or the zip file\nunzip -d \"$HELM_PLUGINS\" ~/Downloads/helm-dump_0.2.1.zip\n```\n\n3. After the bundle file is unpacked, you should view an output similar to the following: \n```\n$ helm dump \nA Helm plugin that creates a chart from a cluster's existing resources\n\nUsage:\n  helm-dump [command]\n\nAvailable Commands:\n  completion  generate the autocompletion script for the specified shell\n  help        Help about any command\n  version     print the helm-dump plugin version information\n\nFlags:\n      --config string   config file (default is $HOME/.helm_dump.yaml)\n  -h, --help            help for helm-dump\n\nUse \"helm-dump [command] --help\" for more information about a command.\n```\nThe output verifies that the plugin is now available to use.\n\n4. Build the `helm-dump` binary:\n```\n$ make build\n```\n\n**Example output:**\n```\n   • building...      \n   • loading config file       file=.goreleaser.yaml\n   • loading environment variables\n   • getting and validating git state\n      • building...               commit=eb2f496ae94abcf135f0df3d6d05c258c1df8bde latest tag=v0.2.1\n      • pipe skipped              error=validation is disabled\n...\n   • building binaries\n      • building                  binary=dist/helm-dump_windows_arm64/helm-dump.exe\n      • building                  binary=dist/helm-dump_linux_arm64/helm-dump\n      • building                  binary=dist/helm-dump_linux_s390x/helm-dump\n      • building                  binary=dist/helm-dump_linux_arm_6/helm-dump\n      • building                  binary=dist/helm-dump_linux_386/helm-dump\n      • building                  binary=dist/helm-dump_darwin_amd64/helm-dump\n      • building                  binary=dist/helm-dump_darwin_arm64/helm-dump\n      • building                  binary=dist/helm-dump_linux_ppc64le/helm-dump\n      • building                  binary=dist/helm-dump_linux_amd64/helm-dump\n      • building                  binary=dist/helm-dump_windows_amd64/helm-dump.exe\n   • storing release metadata\n      • writing                   file=dist/artifacts.json\n      • writing                   file=dist/metadata.json\n   • build succeeded after 1.09s\n```\n5. Bundle the`helm-dump` plug-in:\n```\n$ make plugin\n```\n \n**Example output:**\n```\nBuilding plugin in /home/isuttonl/Documents/src/helm-dump/dist/plugin/dump... Done!\nCreating helm-dump_0.2.1.tar.gz... Done!\nCreating helm-dump_0.2.1.zip... Done!\nCalculating checksum for plugin bundles... Done!\n```\n\nThe plug-in bundle has been built and stored at the `./dist/plugin/dump` location and now you can install it in the system.\n\n6. Install the plug-in bundle:\n```\n$ make install\n```\n \n**Example output:**\n```\nInstalled plugin: dump\n```\n\n7. Verify that the plug-in installation is successful:\n```\n$ helm plugin list\n```\n \n**Example output:**\n```\nNAME    VERSION DESCRIPTION                                                           \ndump    0.2.1   A Helm plugin that creates a chart from a cluster's existing resources\n```\n\n### Installing the template deployment\nThis procedure uses the following example resource for the workload configuration in the form of a `nginx-deployment.yaml` file:\n```\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\n  namespace: default\n  labels:\n    app: nginx\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n        - name: nginx\n          image: nginx:1.14.2\n          ports:\n            - containerPort: 80\n```\n\nUse this workload configuration to install a template deployment. This workload serves as a deployment that can get replicated in other environments based on the requirements.\n\n#### Procedure\n\n1. Install a simple deployment resource to apply the workload configuration into an available cluster:\n\nFor Kubernetes cluster:\n```\nkubectl apply -f nginx-deployment.yaml\n```\n\nFor OpenShift cluster:\n```\noc apply -f nginx-deployment.yaml\n```\n\n**Example output:**\n```\ndeployment.apps/nginx-deployment created\n```\n\n2. Verify that the installation is successful:\n\nFor Kubernetes cluster:\n```\nkubectl get pods -n default\n```\n\nFor OpenShift cluster:\n```\noc get pods -n default\n```\n\n**Example output:**\n```\nNAME                    READY   STATUS    RESTARTS   AGE\nnginx-deployment-9456bbbf9-8wgjb   1/1     Running   0          9s\nnginx-deployment-9456bbbf9-bnmnk   1/1     Running   0          9s\nnginx-deployment-9456bbbf9-fmszw   1/1     Running   0          9s\n```\nThe output verifies that all pods are running.\n\n### Labeling the `Deployment` resource\n\nYou must label the `Deployment` resource so it can be included in the Helm chart that you are going to create and extract using the `helm-dump` plug-in.\n\n#### Prerequisites\n\n- You must have validated that the workload is properly running by exposing the deployment and the service.\n- You must have validated that the workload is indeed working by using the `curl` command. This validation ensures that the `nginx-deployment` web server is successfully installed and working, and you have accessed the web server. \n\n**Note:**\n- If you have exposed the deployment and service successfuly, you must see a route for the `nginx-deployment` service similar to the following example:\n\n**Example:**\n```\nroute.route.openshift.io/nginx exposed\n```\n- You can label multiple resources, but this quickstart only focuses on the `Deployment` resource.\n\n- Create a chart using helm dump and the labeled `Deployment` resource\n\nAfter the workload is confirmed to work, the resource can be labeled to be collected by helm-dump at a later stage. \n\n### Procedure\n\n- Label the `Deployment` resource:\n```\nkubectl label deployment nginx-deployment helm-dump=please\n```\nExample output:\n```\ndeployment.apps/nginx-deployment labeled\n```\nThe output verifies that you have labeled the resource successfully.\n\n### Extracting a Helm chart\nNow that the `Deployment` resource is installed in the cluster and properly labeled, you can now extract this resource bundled in a Helm chart.\n\n**Procedure**\n\n1. Use the `helm dump init` command to extract the `Deployment` resource to a Helm chart:\n```\nhelm dump init -l helm-dump=please my-chart /tmp/helm-dump-init-demo\n```\n**Note:**\n- When you use `-l helm-dump=please`, the `-l` option has the same semantics as the `kubectl` option, so refer to `kubectl --help` for more information regarding its usage and semantics.\n\nAfter extraction, the `my-chart-0.1.0.tgz` file is available at the `/tmp/helm-dump-init-demo/` directory with the following chart and resource templates as its contents:\n\n- Chart.yaml:\n```yaml\napiVersion: v2\nname: my-chart # (1)\nversion: 0.1.0\n```\n1. Specifies the chart name as informed by the user when generating a chart using the `helm-dump` plug-in.\n \n- templates/nginx-deployment_apps_v1.yaml:\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    deployment.kubernetes.io/revision: \"1\"\n    kubectl.kubernetes.io/last-applied-configuration: |\n      {\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app\":\"nginx\"},\"name\":\"nginx-deployment\",\"namespace\":\"default\"},\"spec\":{\"replicas\":3,\"selector\":{\"matchLabels\":{\"app\":\"nginx\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"nginx\"}},\"spec\":{\"containers\":[{\"image\":\"nginx:1.14.2\",\"name\":\"nginx\",\"ports\":[{\"containerPort\":80}]}]}}}}\n  labels: # (1)\n    app: nginx \n    app.kubernetes.io/instance: '{{ $.Release.Name }}'\n    app.kubernetes.io/name: '{{ template \"my-chart.fullname\" $ }}'\n    helm-dump: \"please\"\n  name: nginx-deployment-{{ .Release.Name }} # (2)\n  namespace: default\nspec:\n  progressDeadlineSeconds: 600\n  replicas: 3\n  revisionHistoryLimit: 10\n  selector:\n    matchLabels:\n      app: nginx\n  strategy:\n    rollingUpdate:\n      maxSurge: 25%\n      maxUnavailable: 25%\n    type: RollingUpdate\n  template:\n    metadata:\n      creationTimestamp: null\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - image: nginx:1.14.2\n        imagePullPolicy: IfNotPresent\n        name: nginx\n        ports:\n        - containerPort: 80\n          protocol: TCP\n        resources: {}\n        terminationMessagePath: /dev/termination-log\n        terminationMessagePolicy: File\n      dnsPolicy: ClusterFirst\n      restartPolicy: Always\n      schedulerName: default-scheduler\n      securityContext: {}\n      terminationGracePeriodSeconds: 30\n```\n1. Specifies the labels added by the `helm-dump` plug-in according to the Helm guidelines.\n2. Specifies the name field that is modified according to the Helm guidelines to include the release name at the time of deployment.\n\n### Installing the newly created Helm chart into a cluster\n\nAfter you create and extract the Helm chart, now proceed to install the modified Helm chart into the cluster. \n\n#### Procedure\n1. Use the Helm chart to install a new release:\n```\nhelm install my-app my-chart-0.1.0.tgz\n```\n\n**Example output:**\n```\nNAME: my-app\nLAST DEPLOYED: Mon Apr 11 12:33:33 2022\nNAMESPACE: default\nSTATUS: deployed\nREVISION: 1\nTEST SUITE: None\n```\n\n2. Verify that the release is successfully installed in the cluster:\n```\nhelm list\n```\n\n**Example output:**\n```\nNAME    NAMESPACE   REVISION    UPDATED                                     STATUS      CHART           APP VERSION\nmy-app  default     1           2022-04-11 12:33:33.854705256 +0200 CEST    deployed    my-chart-0.1.0\n```\n\n3. Verify the resources declared in the cluster:\n```\nkubectl get all\n```\n\n**Example output:**\n```\nNAME                                          READY   STATUS    RESTARTS   AGE\npod/nginx-deployment-9456bbbf9-4jgfc          1/1     Running   0          2m29s (1)\npod/nginx-deployment-9456bbbf9-mfpdc          1/1     Running   0          2m29s (1)\npod/nginx-deployment-9456bbbf9-w5h4f          1/1     Running   0          2m29s (1)\npod/nginx-deployment-my-app-9456bbbf9-4gkzx   1/1     Running   0          24s\n \npod/nginx-deployment-my-app-9456bbbf9-h2c2n   1/1     Running   0          24s\n \npod/nginx-deployment-my-app-9456bbbf9-rnmq2   1/1     Running   0          24s\n \nNAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE\nservice/kubernetes   ClusterIP   10.96.0.1    \u003cnone\u003e        443/TCP   6d1h\n \nNAME                                      READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nginx-deployment          3/3     3            3           2m29s (2)\ndeployment.apps/nginx-deployment-my-app   3/3     3            3           24s   (3)\n \nNAME                                                DESIRED   CURRENT   READY   AGE\nreplicaset.apps/nginx-deployment-9456bbbf9          3         3         3       2m29s\nreplicaset.apps/nginx-deployment-my-app-9456bbbf9   3         3         3       24s\n```\n1. Replicas from the resource that created the chart.\n2. The resource that created the chart.\n3. Resource created with the recently created Helm chart.\n\nThe output verifies that there is `nginx-deployment` deployment resource with three replicas that served as template, and `nginx-deployment-my-app` deployment resource with three replicas installed using the newly generated Helm chart.\n\nThe `nginx-deployment` deployment resource is extracted by the `helm dump init` command and the `nginx-deployment-my-app` deployment is managed by Helm.\n\n## License\nApache License Version 2.0","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer%2Fhelm-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-developer%2Fhelm-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer%2Fhelm-dump/lists"}