File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
ansible/roles/kube_prometheus_stack Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,17 @@ kube_prometheus_stack_loki_release_values:
198198 test_pod :
199199 image : " bats/bats:{{ kube_prometheus_stack_loki_test_pod_tag }}"
200200 loki :
201+ config :
202+ compactor :
203+ retention_enabled : true
204+ limits_config :
205+ retention_period : 72h
206+ persistence :
207+ enabled : true
208+ selector :
209+ matchLabels :
210+ app.kubernetes.io/name : loki-dir
211+ size : " {{ kube_prometheus_stack_loki_persistence_size }}"
201212 nodeSelector :
202213 clusterrole : server
203214 image :
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ kube_prometheus_stack_loki_chart_version: 2.10.2
2424kube_prometheus_stack_loki_image_tag : 2.9.3 # also promtail tag
2525kube_prometheus_stack_loki_test_pod_tag : 1.8.2
2626
27+ kube_prometheus_stack_loki_data_dir : " {{ appliances_state_dir }}/loki"
28+ kube_prometheus_stack_loki_persistence_size : " 10Gi"
29+
2730control_ip : " {{ hostvars[groups['control'].0].ansible_host }}"
2831
2932grafana_auth_anonymous : false
Original file line number Diff line number Diff line change 8282 path : " {{ prometheus_db_dir }}"
8383 type : DirectoryOrCreate
8484
85+ # Loki image seems to be hardcoded to use this uid/gid even when changed in
86+ # podSecurityContext
87+ - name : Create Loki group
88+ ansible.builtin.group :
89+ name : loki
90+ gid : 10001
91+
92+ - name : Create Loki user
93+ ansible.builtin.user :
94+ name : loki
95+ uid : 10001
96+ group : loki
97+
98+ - name : Create Loki data directory
99+ ansible.builtin.file :
100+ state : directory
101+ path : " {{ kube_prometheus_stack_loki_data_dir }}"
102+ owner : 10001
103+ group : 10001
104+ mode : ' 775'
105+
106+ - name : Create Loki hostPath volume in /var/lib/state
107+ kubernetes.core.k8s :
108+ namespace : " {{ kube_prometheus_stack_release_namespace }}"
109+ definition :
110+ apiVersion : v1
111+ kind : PersistentVolume
112+ metadata :
113+ name : loki-dir
114+ labels :
115+ app.kubernetes.io/name : loki-dir
116+ spec :
117+ capacity :
118+ storage : " {{ kube_prometheus_stack_loki_persistence_size }}" # not enforced but may be internally by loki?
119+ accessModes :
120+ - ReadWriteOnce
121+ hostPath :
122+ path : " {{ kube_prometheus_stack_loki_data_dir }}"
123+ type : Directory
124+
85125- name : Setting up k3s services for OnDemand Exporter
86126 when : groups['openondemand'] | count > 0
87127 block :
You can’t perform that action at this time.
0 commit comments