234581d01c08fce3ba7a3ccf68929824e8f4e6bc
[osm/devops.git] /
1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #    http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
17
18 ---
19 # Source: loki/templates/serviceaccount.yaml
20 apiVersion: v1
21 kind: ServiceAccount
22 metadata:
23   name: loki
24   namespace: istio-system
25   labels:
26     helm.sh/chart: loki-4.8.0
27     app.kubernetes.io/name: loki
28     app.kubernetes.io/instance: loki
29     app.kubernetes.io/version: "2.7.3"
30     app.kubernetes.io/managed-by: Helm
31 automountServiceAccountToken: true
32 ---
33 # Source: loki/templates/configmap.yaml
34 apiVersion: v1
35 kind: ConfigMap
36 metadata:
37   name: loki
38   namespace: istio-system
39   labels:
40     helm.sh/chart: loki-4.8.0
41     app.kubernetes.io/name: loki
42     app.kubernetes.io/instance: loki
43     app.kubernetes.io/version: "2.7.3"
44     app.kubernetes.io/managed-by: Helm
45 data:
46   config.yaml: |
47     auth_enabled: false
48     common:
49       compactor_address: 'loki'
50       path_prefix: /var/loki
51       replication_factor: 1
52       storage:
53         filesystem:
54           chunks_directory: /var/loki/chunks
55           rules_directory: /var/loki/rules
56     limits_config:
57       enforce_metric_name: false
58       max_cache_freshness_per_query: 10m
59       reject_old_samples: true
60       reject_old_samples_max_age: 168h
61       split_queries_by_interval: 15m
62     memberlist:
63       join_members:
64       - loki-memberlist
65     query_range:
66       align_queries_with_step: true
67     ruler:
68       storage:
69         type: local
70     runtime_config:
71       file: /etc/loki/runtime-config/runtime-config.yaml
72     schema_config:
73       configs:
74       - from: "2022-01-11"
75         index:
76           period: 24h
77           prefix: loki_index_
78         object_store: filesystem
79         schema: v12
80         store: boltdb-shipper
81     server:
82       grpc_listen_port: 9095
83       http_listen_port: 3100
84     storage_config:
85       hedging:
86         at: 250ms
87         max_per_second: 20
88         up_to: 3
89     table_manager:
90       retention_deletes_enabled: false
91       retention_period: 0
92 ---
93 # Source: loki/templates/runtime-configmap.yaml
94 apiVersion: v1
95 kind: ConfigMap
96 metadata:
97   name: loki-runtime
98   namespace: istio-system
99   labels:
100     helm.sh/chart: loki-4.8.0
101     app.kubernetes.io/name: loki
102     app.kubernetes.io/instance: loki
103     app.kubernetes.io/version: "2.7.3"
104     app.kubernetes.io/managed-by: Helm
105 data:
106   runtime-config.yaml: |
107     {}
108 ---
109 # Source: loki/templates/service-memberlist.yaml
110 apiVersion: v1
111 kind: Service
112 metadata:
113   name: loki-memberlist
114   namespace: istio-system
115   labels:
116     helm.sh/chart: loki-4.8.0
117     app.kubernetes.io/name: loki
118     app.kubernetes.io/instance: loki
119     app.kubernetes.io/version: "2.7.3"
120     app.kubernetes.io/managed-by: Helm
121 spec:
122   type: ClusterIP
123   clusterIP: None
124   ports:
125     - name: tcp
126       port: 7946
127       targetPort: http-memberlist
128       protocol: TCP
129   selector:
130     app.kubernetes.io/name: loki
131     app.kubernetes.io/instance: loki
132     app.kubernetes.io/part-of: memberlist
133 ---
134 # Source: loki/templates/single-binary/service-headless.yaml
135 apiVersion: v1
136 kind: Service
137 metadata:
138   name: loki-headless
139   namespace: istio-system
140   labels:
141     helm.sh/chart: loki-4.8.0
142     app.kubernetes.io/name: loki
143     app.kubernetes.io/instance: loki
144     app.kubernetes.io/version: "2.7.3"
145     app.kubernetes.io/managed-by: Helm
146     variant: headless
147     prometheus.io/service-monitor: "false"
148 spec:
149   clusterIP: None
150   ports:
151     - name: http-metrics
152       port: 3100
153       targetPort: http-metrics
154       protocol: TCP
155   selector:
156     app.kubernetes.io/name: loki
157     app.kubernetes.io/instance: loki
158 ---
159 # Source: loki/templates/single-binary/service.yaml
160 apiVersion: v1
161 kind: Service
162 metadata:
163   name: loki
164   namespace: istio-system
165   labels:
166     helm.sh/chart: loki-4.8.0
167     app.kubernetes.io/name: loki
168     app.kubernetes.io/instance: loki
169     app.kubernetes.io/version: "2.7.3"
170     app.kubernetes.io/managed-by: Helm
171 spec:
172   type: ClusterIP
173   ports:
174     - name: http-metrics
175       port: 3100
176       targetPort: http-metrics
177       protocol: TCP
178     - name: grpc
179       port: 9095
180       targetPort: grpc
181       protocol: TCP
182   selector:
183     app.kubernetes.io/name: loki
184     app.kubernetes.io/instance: loki
185     app.kubernetes.io/component: single-binary
186 ---
187 # Source: loki/templates/single-binary/statefulset.yaml
188 apiVersion: apps/v1
189 kind: StatefulSet
190 metadata:
191   name: loki
192   namespace: istio-system
193   labels:
194     helm.sh/chart: loki-4.8.0
195     app.kubernetes.io/name: loki
196     app.kubernetes.io/instance: loki
197     app.kubernetes.io/version: "2.7.3"
198     app.kubernetes.io/managed-by: Helm
199     app.kubernetes.io/component: single-binary
200     app.kubernetes.io/part-of: memberlist
201 spec:
202   replicas: 1
203   podManagementPolicy: Parallel
204   updateStrategy:
205     rollingUpdate:
206       partition: 0
207   serviceName: loki-headless
208   revisionHistoryLimit: 10
209   persistentVolumeClaimRetentionPolicy:
210     whenDeleted: Delete
211     whenScaled: Delete
212   selector:
213     matchLabels:
214       app.kubernetes.io/name: loki
215       app.kubernetes.io/instance: loki
216       app.kubernetes.io/component: single-binary
217   template:
218     metadata:
219       annotations:
220         checksum/config: a9239b6352e34bbfc748669ed46cb24211fc3491ee7f2c6381af805f8f08fe29
221       labels:
222         app.kubernetes.io/name: loki
223         app.kubernetes.io/instance: loki
224         app.kubernetes.io/component: single-binary
225         app.kubernetes.io/part-of: memberlist
226     spec:
227       serviceAccountName: loki
228       automountServiceAccountToken: true
229       enableServiceLinks: true
230       securityContext:
231         fsGroup: 10001
232         runAsGroup: 10001
233         runAsNonRoot: true
234         runAsUser: 10001
235       terminationGracePeriodSeconds: 30
236       containers:
237         - name: loki
238           image: docker.io/grafana/loki:2.7.3
239           imagePullPolicy: IfNotPresent
240           args:
241             - -config.file=/etc/loki/config/config.yaml
242             - -target=all
243           ports:
244             - name: http-metrics
245               containerPort: 3100
246               protocol: TCP
247             - name: grpc
248               containerPort: 9095
249               protocol: TCP
250             - name: http-memberlist
251               containerPort: 7946
252               protocol: TCP
253           securityContext:
254             allowPrivilegeEscalation: false
255             capabilities:
256               drop:
257               - ALL
258             readOnlyRootFilesystem: true
259           readinessProbe:
260             httpGet:
261               path: /ready
262               port: http-metrics
263             initialDelaySeconds: 30
264             timeoutSeconds: 1
265           volumeMounts:
266             - name: tmp
267               mountPath: /tmp
268             - name: config
269               mountPath: /etc/loki/config
270             - name: runtime-config
271               mountPath: /etc/loki/runtime-config
272             - name: storage
273               mountPath: /var/loki
274           resources:
275             {}
276       affinity:
277         podAntiAffinity:
278           requiredDuringSchedulingIgnoredDuringExecution:
279             - labelSelector:
280                 matchLabels:
281                   app.kubernetes.io/name: loki
282                   app.kubernetes.io/instance: loki
283                   app.kubernetes.io/component: single-binary
284               topologyKey: kubernetes.io/hostname
285       volumes:
286         - name: tmp
287           emptyDir: {}
288         - name: config
289           configMap:
290             name: loki
291         - name: runtime-config
292           configMap:
293             name: loki-runtime
294   volumeClaimTemplates:
295     - metadata:
296         name: storage
297       spec:
298         accessModes:
299           - ReadWriteOnce
300         resources:
301           requests:
302             storage: "10Gi"