FORMAT: move helm chart definitions to separate files

This commit is contained in:
Sebastian Mark 2022-02-26 10:07:19 +01:00
parent 3f6b557c26
commit a9df322519
7 changed files with 95 additions and 94 deletions

View file

@ -4,25 +4,28 @@
gather_facts: no
connection: local
tasks:
- name: load carts list and definition
include_vars: helm.yml
- name: load charts list and definition
include_vars:
dir: vars/helm/
ignore_unknown_extensions: yes
name: helm_charts
- name: add chart repos
kubernetes.core.helm_repository:
name: "{{ item.chart.split('/')[0] }}"
repo_url: "{{ item.url }}"
loop: "{{ helm_charts }}"
name: "{{ item.value.chart.split('/')[0] }}"
repo_url: "{{ item.value.url }}"
loop: "{{ helm_charts | dict2items }}"
- name: update helm repos
command: helm repo update
changed_when: no
- name: install charts
kubernetes.core.helm:
name: "{{ item.name }}"
chart_ref: "{{ item.chart }}"
chart_version: "{{ item.version|default(omit) }}"
values: "{{ item.vals|default(omit) }}"
release_namespace: "{{ item.namespace | default(item.name) }}"
name: "{{ item.key }}"
chart_ref: "{{ item.value.chart }}"
chart_version: "{{ item.value.version|default(omit) }}"
values: "{{ item.value.vals|default(omit) }}"
release_namespace: "{{ item.value.namespace | default(item.key) }}"
create_namespace: true
loop: "{{ helm_charts }}"
loop: "{{ helm_charts | dict2items }}"
- name: apply post-install manifests
k8s:
src: "{{ item }}"

View file

@ -1,83 +0,0 @@
---
helm_charts:
- name: monitoring
url: https://prometheus-community.github.io/helm-charts
chart: prometheus-community/kube-prometheus-stack
namespace: metrics
vals:
kubeProxy:
enabled: false
kubeScheduler:
enabled: false
kubeControllerManager:
enabled: false
alertmanager:
config:
global:
resolve_timeout: 5m
route:
group_by: ['alertname', 'cluster']
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'pushover'
routes:
- receiver: 'null'
matchers:
- alertname="Watchdog"
receivers:
- name: 'null'
- name: 'pushover'
pushover_configs:
- user_key: x9PipXt1zGOU31OJH9Osv18BFrlRhw
token: aqvce1uukerhxhayxdq85wgtdh2c5r
templates:
- '/etc/alertmanager/config/*.tmpl'
prometheus:
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
- name: ingress-nginx
chart: ingress-nginx/ingress-nginx
url: https://kubernetes.github.io/ingress-nginx
vals:
controller:
image:
pullPolicy: Always
service:
externalTrafficPolicy: Local
metrics:
enabled: true
serviceMonitor:
enabled: true
additionalLabels:
release: monitoring # same as prometheus-community chart name
- name: cert-manager
url: https://charts.jetstack.io
chart: jetstack/cert-manager
vals:
installCRDs: true
- name: argocd
chart: argocd/argo-cd
url: https://argoproj.github.io/argo-helm
vals:
server:
replicas: 0
dex:
enabled: false
- name: keel
url: https://charts.keel.sh
chart: keel/keel
vals:
helmProvider:
enabled: false

View file

@ -0,0 +1,43 @@
---
monitoring:
chart: prometheus-community/kube-prometheus-stack
url: https://prometheus-community.github.io/helm-charts
namespace: metrics
vals:
kubeProxy:
enabled: false
kubeScheduler:
enabled: false
kubeControllerManager:
enabled: false
alertmanager:
config:
global:
resolve_timeout: 5m
route:
group_by: ['alertname', 'cluster']
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'pushover'
routes:
- receiver: 'null'
matchers:
- alertname="Watchdog"
receivers:
- name: 'null'
- name: 'pushover'
pushover_configs:
- user_key: x9PipXt1zGOU31OJH9Osv18BFrlRhw
token: aqvce1uukerhxhayxdq85wgtdh2c5r
templates:
- '/etc/alertmanager/config/*.tmpl'
prometheus:
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi

View file

@ -0,0 +1,6 @@
---
cert-manager:
chart: jetstack/cert-manager
url: https://charts.jetstack.io
vals:
installCRDs: true

View file

@ -0,0 +1,16 @@
---
ingress-nginx:
chart: ingress-nginx/ingress-nginx
url: https://kubernetes.github.io/ingress-nginx
vals:
controller:
image:
pullPolicy: Always
service:
externalTrafficPolicy: Local
metrics:
enabled: true
serviceMonitor:
enabled: true
additionalLabels:
release: monitoring # same as prometheus-community chart name

9
vars/helm/030-argocd.yml Normal file
View file

@ -0,0 +1,9 @@
---
argocd:
chart: argocd/argo-cd
url: https://argoproj.github.io/argo-helm
vals:
server:
replicas: 0
dex:
enabled: false

7
vars/helm/040-keel.yml Normal file
View file

@ -0,0 +1,7 @@
---
keel:
chart: keel/keel
url: https://charts.keel.sh
vals:
helmProvider:
enabled: false