Package: idem-helm
The Idem Helm providerAboutAn Idem plug-in to manage Helm resources. Helm is a package manager for Kubernetes.What is POP?This project is built withpop, a Python-based implementation ofPlugin Oriented Programming (POP). POP seeks to bring together concepts and wisdom from the history of computing in new ways to solve modern computing problems.For more information:Intro to Plugin Oriented Programming (POP)pop-awesomepop-createGetting StartedPrerequisitesPython 3.7+git(if installing from source or contributing to the project)To contribute to the project and set up your local development environment, seeCONTRIBUTING.rstin the source repository for this project.InstallationYou can installidem-helmwith the Python package installer (PyPI) or from source.Install from PyPIpipinstallidem-helmInstall from Source# Clone repogitclonegit@<your-project-path>/idem-helm.gitcdidem-helm# Set up venvpython3-mvenv.venvsource.venv/bin/activatepipinstall-e.UsageSetupAfter installation,idem-helmexecution and state modules are accessible to the pophub.For more information:Intro to Plugin Oriented Programming (POP)pop hubTo useidem-helmexecution and state modules to manage cluster resources, you need to set up authentication in one of the following ways.With environment variablesSet KUBE_CONFIG_PATH and KUBE_CTX environment variables to the Kubernetes configuration file and context found in yourkube_configfile.In the Idem config fileEdit the Idem config file to include thekube_config_pathandcontextunder account extras. Use the following example as a guideline.acct:extras:helm:default:kube_config_path:~/.kube/configcontext:defaultIn a credentials.yaml fileCreate or edit an Idem credentials.yaml file to add thekube_config_pathandcontextto a Helm profile. Use the following example as a guideline.helm:default:kube_config_path:~/.kube/configcontext:kubernetes-admin@kubernetesFor more about Idem credentials files, including recommended steps for encryption and environment variables, seeAuthenticating with IdemYou are now ready to use idem-helm.StatesIdem SLS files use states to ensure that resources are in a desired configuration. An idem-helm SLS file supports three state functions:present,absent, anddescribe.presentThepresentfunction ensures that a resource exists. If a resource doesn’t exist, runningpresentcreates it. If the resource already exists, runningpresentmight leave it unchanged, or update it if there are any configuration changes.absentTheabsentfunction ensures that a resource does not exist. If the resource exists, runningabsentdeletes it. If the resource doesn’t exist, runningabsenthas no effect.describeThedescribefunction returns a list of all resources in the Kubernetes cluster of the same type as specified in the credential profile.Accessing StatesStates can be accessed by their relative location inidem-helm/idem_helm/states.For example, a Helm release state can be created with thepresentfunction as shown in the following SLS file.helm_release.sls:idem-helm-release-test:helm.release.present:-name:idem-redis-repository:https://charts.bitnami.com/bitnami-chart:redis-namespace:kube-system-resource_id:idem-redis-values:image:pullPolicy:IfNotPresentThe Idem command to create the preceding release state is:idemstate$PWD/helm_release.slsCurrent Supported Resourceshelmrelease