This script automates the process of downloading and decompressing Helm charts based on specifications from a values.yaml file. It ensures that the specified versions of Helm charts are pulled from their repositories, downloaded to a compressed directory, and then extracted into a charts directory within the current working directory.
kuberise is an application that deploys several helm charts to kubernetes cluster. pullcharts pulls all those helm chart source code into a folder and makes it easier to check the source codes or search for a specific word among all of them.
Before running this script, ensure you have the following installed:
- Helm 3: The script uses
helm pullto download chart archives. yq(version 4 or above): Used for parsing thevalues.yamlfile.- Bash environment: The script is a Bash script, requiring a Unix-like environment to run.
-
Clone the repository or download the script to your local machine where you intend to manage Helm charts.
-
Ensure
helmandyqare installed and accessible from your command line. You can verify their installation by runninghelm versionandyq --version. -
Prepare your
values.yamlfile according to your Helm chart requirements. The file should follow the structure outlined below:helmCharts: keycloak: repoURL: https://charts.bitnami.com/bitnami chart: keycloak targetRevision: 18.4.0 airflow: repoURL: https://airflow.apache.org chart: airflow targetRevision: 1.12.0
Ensure the file is located at
../kuberise/app-of-apps/values.yamlrelative to the script or adjust thevaluesFilevariable in the script to match your file's location.
To run the script, navigate to the directory containing the script and execute it from the terminal:
./pullcharts.sh- The script checks if a chart is already downloaded and up-to-date before proceeding with the download and extraction. This behavior minimizes unnecessary network usage and disk operations.
- If you encounter permissions issues, ensure the script is executable by running
chmod +x pullcharts.sh. - The script assumes connectivity to the Helm chart repositories specified in your
values.yamlfile.
Feel free to fork the repository and submit pull requests to improve the script or extend its capabilities.