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:
198
198
test_pod :
199
199
image : " bats/bats:{{ kube_prometheus_stack_loki_test_pod_tag }}"
200
200
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 }}"
201
212
nodeSelector :
202
213
clusterrole : server
203
214
image :
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ kube_prometheus_stack_loki_chart_version: 2.10.2
24
24
kube_prometheus_stack_loki_image_tag : 2.9.3 # also promtail tag
25
25
kube_prometheus_stack_loki_test_pod_tag : 1.8.2
26
26
27
+ kube_prometheus_stack_loki_data_dir : " {{ appliances_state_dir }}/loki"
28
+ kube_prometheus_stack_loki_persistence_size : " 10Gi"
29
+
27
30
control_ip : " {{ hostvars[groups['control'].0].ansible_host }}"
28
31
29
32
grafana_auth_anonymous : false
Original file line number Diff line number Diff line change 82
82
path : " {{ prometheus_db_dir }}"
83
83
type : DirectoryOrCreate
84
84
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
+
85
125
- name : Setting up k3s services for OnDemand Exporter
86
126
when : groups['openondemand'] | count > 0
87
127
block :
You can’t perform that action at this time.
0 commit comments