INDEX
########################################################### 2024-01-04 17:30 ########################################################### Devops Toolkit... Helmfile https://www.youtube.com/watch?v=qIJt8Iq8Zb0 Working with Helm at small scale is fine - meant to be used to build packages Helmfile is used to define the full environment of a release # helmfile-prometheus.yaml repositories: - name: prometheus url: ... # Prometheus github helm-charts url releases: - name: prometheus namespace: prometheus chart: prometheus/prometheus helmfile --file helmfile-prometheus.yaml apply --wait # Deploys this release What if you want to set a couple more arguments? # (extending) helmfile-prometheus-rbac.yaml ... # Extension of helmfile-prometheus.yaml releases: - name: prometheus ... set: - name: rbac.create value: false helmfile --interactive --file helmfile-prometheus-rbac.yaml apply --wait # Calculates diff # --interactive lets you manually choose whether to apply changes helmfile --interactive --file helmfile-prometheus-rbac.yaml destroy # Also queries changes Now look at writing larger, multi-service scripts # helmfile-multi.yaml repositories: - name: prometheus url: ... # As before releases: - name: prometheus # Main release namspace: prometheus chart: prometheus/prometheus set: - name: rbac.create value: false - name: devops-toolkit # Alt release namespace: production chart: devops-toolkit set: - name: image.tag value: "2.9.10" - name: ingress.host value: devops-toolkit.{{ requiredEnv "BASE_HOST" }} - name: devops-paradox namespace: production # Alt release 2 chart: devops-paradox set: - name: image.tag value: "1.71" value: {{ env "DEVOPS_PARADOX_HOST" | default "devops-paradox.acme.com" }} helmfile --file helmfile-multi.yaml apply --wait # Gives error due to required env variable export BASE_HOST=localhost helmfile --file helmfile-multi.yaml --interactive apply --wait # Shows diff kubectl --namespace production get ingresses # Shows multiple releases exist Can use templates to remove repeated code # helmfile.yaml (Same as helmfile-multi.yaml but extended) ... # Repository info templates: default: &default namespace: production chart: "{{`{{ .Release.Name }}`}}" missingFileHandler: Warn releases: ... - name: devops-toolkit <<: *default # Whatever is in the "default" template is injected ... - name: devops-paradox <<: *default ... helmfile --interactive apply --wait # Uses known files to apply helmfile destroy # Deletes everything