Friday, June 9, 2023

helm activity

 Run the following command to get the list of deployed Helm releases:

 
helm list --all-namespaces
 



If you want to filter the list by a specific namespace, you can specify the --namespace flag followed by the desired namespace.

 
helm list --namespace default
 

[root@node]# helm list --all-namespaces
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
mysql default 1 2023-06-08 14:35:36.121173384 +0000 UTC deployed mysql-9.10.2 8.0.33
valut-test default 1 2023-06-08 16:39:35.916887124 +0000 UTC deployed vault-0.2.2 1.13.2
vault-testing default 1 2023-06-09 02:55:52.502603722 +0000 UTC deployed vault-0.2.2 1.13.2 what is the release in this example


If you want to retrieve the chart details of a specific release, you can use the helm get command followed by the release name.

 
helm get mysql --namespace default
  



To download a running Helm release to your local machine, you can use the helm get manifest command followed by the release name. This command will retrieve the manifest file for the specified release.

 
helm get manifest mysql --namespace default > manifest.yaml
  

The command will redirect the output to a file named manifest.yaml in your current directory. You can specify a different file name or path if desired.


After running this command, you will have the manifest file manifest.yaml containing the YAML representation of the deployed resources in the specified release.

Download Running Helm chart

To download the running MySQL Helm chart, you can follow these steps:
1. Retrieve the values used for the MySQL release by running the following command:

 
helm get values mysql > values.yaml
 


This command will save the values in a file called values.yaml.

2. Create a new Helm chart directory structure. You can use the helm create command to generate the basic structure for a new chart. For example:

 
helm create my-mysql-chart
 



3. Replace the values.yaml file in the newly created chart directory with the one you retrieved in step 1:

 
cp values.yaml my-mysql-chart/values.yaml
 



4. You can further customize the chart by modifying the other template files in the my-mysql-chart directory according to your requirements.
By following these steps, you will have a new Helm chart (my-mysql-chart) with the same configuration as the running MySQL release.
 

How to download running pod/deployment yaml file

Export Pod Data: If you want to back up specific files or directories within a running pod, you can export the data using kubectl cp command. For example, to copy the contents of a directory named data within a pod named my-pod to your local machine, you can use the following command:

 
kubectl cp my-pod:/path/to/data /local/path
 
kubectl cp jenkins-test-64c77f4595-d769p:/home/jenkins /root/myfolder
 



you can also use the kubectl get pod <pod-name> -o yaml command to retrieve the YAML configuration of a pod.

 
kubectl get pod vault-testing-injector-64c77f4595-d769p -o yaml
 


To fetch the YAML file used to deploy a running pod or deployment,. Here's how you can do it:

 
kubectl get pod vault-testing-injector-64c77f4595-d769p --namespace default -o yaml > pod.yaml 
 

It will store the configuration in pod.yaml file on your local, same way if you want to store deployment/service or any kind of running yaml in kubernetes just put after get and ID, and after that all same like above

No comments:

Post a Comment