Add ansible files
This commit is contained in:
60
ansible/04_setup_monitoring.yaml
Normal file
60
ansible/04_setup_monitoring.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
- name: Setup Monitoring
|
||||
vars_files:
|
||||
- config/config_vars.yaml
|
||||
hosts:
|
||||
- localhost
|
||||
tasks:
|
||||
- name: Add Prometheus chart repo
|
||||
kubernetes.core.helm_repository:
|
||||
name: prometheus
|
||||
repo_url: "https://prometheus-community.github.io/helm-charts"
|
||||
|
||||
- name: Setup Prometheus
|
||||
kubernetes.core.helm:
|
||||
name: prometheus
|
||||
chart_ref: prometheus/kube-prometheus-stack
|
||||
update_repo_cache: true
|
||||
create_namespace: true
|
||||
release_namespace: monitoring
|
||||
|
||||
# - name: Setup OneDev service
|
||||
# kubernetes.core.k8s:
|
||||
# template: files/onedev_svc.template.yaml
|
||||
# state: present
|
||||
|
||||
- name: Create IngressRoute for Grafana
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: grafana-ingress
|
||||
namespace: monitoring
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`monitor.vanespen.dev`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: prometheus-grafana
|
||||
port: 80
|
||||
tls:
|
||||
certResolver: letsencrypt_dns
|
||||
|
||||
- name: Add Grafana chart repo
|
||||
kubernetes.core.helm_repository:
|
||||
name: grafana
|
||||
repo_url: "https://grafana.github.io/helm-charts"
|
||||
|
||||
- name: Install Loki
|
||||
kubernetes.core.helm:
|
||||
name: loki
|
||||
chart_ref: grafana/loki
|
||||
update_repo_cache: true
|
||||
create_namespace: true
|
||||
release_namespace: monitoring
|
||||
chart_version: 5.35.0
|
||||
values_files:
|
||||
- files/loki_values.yaml
|
||||
Reference in New Issue
Block a user