0

I have installed below helm chart with helm v2 with below command.

helm2 install stable/tensorflow-notebook -n tf2

It created below resources.


NAME                                           READY   STATUS              RESTARTS   AGE
pod/tf2-tensorflow-notebook-67c5df968b-rlhsm   0/2     ContainerCreating   0          89s

NAME                              TYPE           CLUSTER-IP     EXTERNAL-IP    PORT(S)                         AGE
service/tf2-tensorflow-notebook   LoadBalancer   10.0.148.137   13.83.244.95   6006:32351/TCP,8888:32147/TCP   89s

NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/tf2-tensorflow-notebook   0/1     1            0           90s

NAME                                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/tf2-tensorflow-notebook-67c5df968b   1         1         0       90s

This release created revision in kube-system namespace as configmap.

tf2.v1                               1      114s

took backup of configmap using below command.

kubectl get configmap -n kube-system -l "OWNER=TILLER" -o yaml > mychart/template/helm_release.yaml

deleted helm "tf2" release.

helm2 delete tf2
helm2 delete --purge tf2

I tried below command for recreating resources. reference ref1.

helm2 install --name tf3 ./mychart 

getting below error:

Error: no Chart.yaml exists in directory "/home/username/mychart"

Now, I want to create/restore resources/release "tf2" from configmap backup. I'm less sure about this, If we can create resouces out of this configmap.

ref1 ref2

  • The ref2 link suggests it's theoretically possible, but it's not a standard path, and I'm not immediately aware of a tool that can do it. The ConfigMap you saved is not, in itself, a complete Helm chart (hence the error you get). You can [`helm fetch`](https://v2.helm.sh/docs/helm/#helm-fetch) the original chart, and save the values you used to install it in source control, and then `helm install` it in an identical way in a different environment. – David Maze Nov 16 '20 at 15:38
  • Now, I could able to install the chart. but not able to recreate/restore resources. this time, I've created below dir. structure. and It created configmap resouuce in cluser and another new release helm. created Charts.yaml under mychart dir. with below content. apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes name: mychart version: 0.1.0 mychart/ ├── Chart.yaml ├── charts └── templates └── helm_releases_configmaps_backup.yaml – navnath bagade Nov 16 '20 at 17:32
  • What resources do you think need to be recreated, that reinstalling the original chart won't do? – David Maze Nov 16 '20 at 17:48
  • when the original chart got installed i.e. ```helm2 install stable/tensorflow-notebook -n tf2```, It created deployment and service. Currently under kube-system below are created configmaps. tf2.v1 10s When I deploy the release from configmap backup, i.e. ```helm2 install --name tf3 ./mychart``` which creates the helm release for configmap. Which is nature of K8S. Currently under kube-system below are created configmaps. tf3 5s tf2.v1 5s What I am looking for is deployment and service under tf2.v1 release. – navnath bagade Nov 17 '20 at 09:24

1 Answers1

1

The ConfigMap in the kube-system namespace is internal state used by Helm. You can't really do anything with it, and it's not something you need to back up or otherwise extract from the cluster. (The "ref2" link in the question notes that it exists but you can't decompile it in any useful way.) Similarly, there's no way to restore it, and it doesn't make sense to add it to a different Helm chart.

If you want to make a second duplicate installation of a chart, there are two commands that can help. helm fetch stable/tensorflow-notebook will give you a local tar file that contains the upstream chart, so even if it changes in the upstream repository, you'll have a local copy of it. helm get values tf2 will write out the combined set of YAML configuration that was used to install the chart.

In practice, this should work to duplicate an installation:

# Get the existing values from the installed release
helm get values tf2 > tf.yaml

# Reinstall using those values
helm install --name tf4 stable/tensorflow-notebook -n tf4 -f tf.yaml

If it's important to use a fixed version of the chart:

helm fetch stable/tensorflow-notebook
helm install --name tf5 ./tensorflow-notebook-*.tgz -n tf5 -f tf.yaml
David Maze
  • 130,717
  • 29
  • 175
  • 215