diff --git a/baseline.yml b/baseline.yml index c682336..ef65c6a 100644 --- a/baseline.yml +++ b/baseline.yml @@ -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 }}" diff --git a/vars/helm.yml b/vars/helm.yml deleted file mode 100644 index 5a76026..0000000 --- a/vars/helm.yml +++ /dev/null @@ -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 diff --git a/vars/helm/000-monitoring.yml b/vars/helm/000-monitoring.yml new file mode 100644 index 0000000..a47b292 --- /dev/null +++ b/vars/helm/000-monitoring.yml @@ -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 diff --git a/vars/helm/010-cert-manager.yml b/vars/helm/010-cert-manager.yml new file mode 100644 index 0000000..a0dc657 --- /dev/null +++ b/vars/helm/010-cert-manager.yml @@ -0,0 +1,6 @@ +--- +cert-manager: + chart: jetstack/cert-manager + url: https://charts.jetstack.io + vals: + installCRDs: true diff --git a/vars/helm/020-ingress-nginx.yml b/vars/helm/020-ingress-nginx.yml new file mode 100644 index 0000000..947014d --- /dev/null +++ b/vars/helm/020-ingress-nginx.yml @@ -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 diff --git a/vars/helm/030-argocd.yml b/vars/helm/030-argocd.yml new file mode 100644 index 0000000..6b7e314 --- /dev/null +++ b/vars/helm/030-argocd.yml @@ -0,0 +1,9 @@ +--- +argocd: + chart: argocd/argo-cd + url: https://argoproj.github.io/argo-helm + vals: + server: + replicas: 0 + dex: + enabled: false diff --git a/vars/helm/040-keel.yml b/vars/helm/040-keel.yml new file mode 100644 index 0000000..fc2e303 --- /dev/null +++ b/vars/helm/040-keel.yml @@ -0,0 +1,7 @@ +--- +keel: + chart: keel/keel + url: https://charts.keel.sh + vals: + helmProvider: + enabled: false