Skip to content

Commit 8490743

Browse files
committed
Playbook to install kube-prometheus-stack
1 parent 2fdcb58 commit 8490743

File tree

4 files changed

+5529
-0
lines changed

4 files changed

+5529
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
- name: Ensure kubernetes.core collection is installed
3+
hosts: masters
4+
gather_facts: no
5+
tasks:
6+
- name: Install required Ansible collection
7+
ansible.builtin.command:
8+
cmd: ansible-galaxy collection install kubernetes.core
9+
changed_when: false
10+
delegate_to: "{{ groups['masters'][0] }}"
11+
12+
- name: Install Helm
13+
hosts: masters
14+
become: yes
15+
tasks:
16+
- name: Download Helm install script
17+
ansible.builtin.get_url:
18+
url: https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
19+
dest: /tmp/get_helm.sh
20+
mode: '0700'
21+
delegate_to: "{{ groups['masters'][0] }}"
22+
23+
- name: Run Helm install script
24+
ansible.builtin.command: /tmp/get_helm.sh
25+
args:
26+
chdir: /tmp
27+
delegate_to: "{{ groups['masters'][0] }}"
28+
29+
- name: Deploy kube-prometheus-stack to Kubernetes
30+
hosts: masters
31+
become: yes
32+
roles:
33+
- install-monitoring
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
---
3+
helm_release_name: k8s-monitoring
4+
helm_chart_name: prometheus-community/kube-prometheus-stack
5+
helm_chart_version: "78.4.0"
6+
helm_namespace: monitoring
7+
helm_repo_name: prometheus-community
8+
helm_repo_url: https://prometheus-community.github.io/helm-charts
9+
helm_custom_values: "power-custom-values.yaml"

0 commit comments

Comments
 (0)