DevOps Classroom Series -18/Apr/2021

Package management

  • Package managers are used to simplify the process of installing, upgrading, reverting and removing system’s applications.
  • The application is defined as package, which contains metadata around target software and its dependencies
dnf install htop
dnf upgrade htop
dnf downgrade htop
dnf remove htop

Helm: The Kubernetes Package manager

  • In the above-mentioned examples dnf operates on RPM package and apt operates on deb packages that provide executables, dependency information, and metadata.
  • Helm works with charts. This chart can be thought of k8s package.
  • Charts contain declarative k8s resource files that are required to deploy an applications
  • Example: let’s assume you want to deploy Redis as memory cache in k8s, using helm we can perform this
# install
helm install redis bitnami/redis --namespace=redis
# upgrade
helm upgrade redis bitnami/redis --namespace=redis
# downgrade
helm rollback redis 1 --namespace=redis
# uninstall
helm uninstall redis --namespace=redis
  • Lets search for WordPress
helm search hub WordPress
  • add wordpress repository Preview
  • Lets install wordpress chart Preview Preview Preview
  • Using helm charts is extremely simple and convinient

Creating Helm Chart

  • Helm chart has the following files
File/Directory Definition Required?
Chart.yaml A file that contains metadata about the Helm chart yes
templates/ A directory that contains k8s resources in YAML yes
templates/NOTES.txt A file that can be generated to provide usage instructions no
values.yaml A file that contains charts default values no
.helmignore A file that contains a list of files or directories to be omitted from Helm charts packaging no
charts/ A directory that contains charts that the helm chart depends on Does no need to explicity provided
Chart.lock A file used to see previously applied dependency version no

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin