Skip to content

Commit f2e1c23

Browse files
authored
Merge pull request #934 from lsst-it/IT-6060_deploy_loki_on_kueyen
(kueyen) Add Loki to Kueyen
2 parents a87e69e + a62a617 commit f2e1c23

File tree

8 files changed

+291
-76
lines changed

8 files changed

+291
-76
lines changed

fleet/lib/kube-prometheus-stack/aggregator/values.yaml

Lines changed: 8 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -167,81 +167,13 @@ grafana:
167167
jsonData:
168168
handleGrafanaManagedAlerts: false
169169
implementation: prometheus
170-
- name: logs-kube
171-
type: grafana-opensearch-datasource
172-
uid: os-logs-kube
173-
basicAuth: true
174-
basicAuthUser: $OS_LOGGING_USERNAME
175-
url: https://opensearch.${ get .ClusterLabels "management.cattle.io/cluster-display-name" }.${ .ClusterLabels.site }.lsst.org
170+
- name: loki
171+
type: loki
172+
uid: loki
173+
url: http://loki-gateway.loki
176174
access: proxy
177175
jsonData:
178-
database: logs-kube*
179-
flavor: opensearch
180-
logLevelField: ""
181-
logMessageField: log
182-
maxConcurrentShardRequests: 5
183-
oauthPassThru: true
184-
pplEnabled: true
185-
timeField: "@timestamp"
186-
version: 2.11.0
187-
secureJsonData:
188-
basicAuthPassword: $OS_LOGGING_PASSWORD
189-
- name: logs-hosts
190-
type: grafana-opensearch-datasource
191-
uid: os-logs-hosts
192-
basicAuth: true
193-
basicAuthUser: $OS_LOGGING_USERNAME
194-
url: https://opensearch.${ get .ClusterLabels "management.cattle.io/cluster-display-name" }.${ .ClusterLabels.site }.lsst.org
195-
access: proxy
196-
jsonData:
197-
database: logs-hosts*
198-
flavor: opensearch
199-
logLevelField: ""
200-
logMessageField: message
201-
maxConcurrentShardRequests: 5
202-
oauthPassThru: true
203-
pplEnabled: true
204-
timeField: "@timestamp"
205-
version: 2.11.0
206-
secureJsonData:
207-
basicAuthPassword: $OS_LOGGING_PASSWORD
208-
- name: logs-firewall
209-
type: grafana-opensearch-datasource
210-
uid: os-logs-firewall
211-
basicAuth: true
212-
basicAuthUser: $OS_LOGGING_USERNAME
213-
url: https://opensearch.${ get .ClusterLabels "management.cattle.io/cluster-display-name" }.${ .ClusterLabels.site }.lsst.org
214-
access: proxy
215-
jsonData:
216-
database: logs-firewall*
217-
flavor: opensearch
218-
logLevelField: ""
219-
logMessageField: message
220-
maxConcurrentShardRequests: 5
221-
oauthPassThru: true
222-
pplEnabled: true
223-
timeField: "@timestamp"
224-
version: 2.11.0
225-
secureJsonData:
226-
basicAuthPassword: $OS_LOGGING_PASSWORD
227-
- name: logs-network
228-
type: grafana-opensearch-datasource
229-
uid: os-logs-network
230-
basicAuth: true
231-
basicAuthUser: $OS_LOGGING_USERNAME
232-
url: https://opensearch.${ get .ClusterLabels "management.cattle.io/cluster-display-name" }.${ .ClusterLabels.site }.lsst.org
233-
access: proxy
234-
jsonData:
235-
database: logs-network*
236-
flavor: opensearch
237-
logLevelField: ""
238-
logMessageField: message
239-
maxConcurrentShardRequests: 5
240-
oauthPassThru: true
241-
pplEnabled: true
242-
timeField: "@timestamp"
243-
version: 2.11.0
244-
secureJsonData:
245-
basicAuthPassword: $OS_LOGGING_PASSWORD
246-
envFromSecrets:
247-
- name: grafana-opensearch-credentials
176+
maxLines: 1000
177+
httpMethod: POST
178+
timeout: 60
179+
timeInterval: 60s

fleet/lib/loki/fleet.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
# XXX automate provisioning of buckets and rgw user
3+
defaultNamespace: &name loki
4+
labels:
5+
bundle: *name
6+
namespaceLabels:
7+
lsst.io/discover: "true"
8+
helm:
9+
chart: &chart loki
10+
releaseName: *chart
11+
repo: https://grafana.github.io/helm-charts
12+
version: 6.30.1
13+
timeoutSeconds: 600
14+
waitForJobs: true
15+
valuesFiles:
16+
- values.yaml
17+
18+
targetCustomizations:
19+
- name: kueyen
20+
clusterSelector:
21+
matchExpressions:
22+
- key: management.cattle.io/cluster-display-name
23+
operator: In
24+
values:
25+
- kueyen
26+
helm:
27+
valuesFiles:
28+
- overlays/kueyen/values.yaml
29+
- overlays/rke2/values.yaml
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
loki:
2+
storage:
3+
s3:
4+
endpoint: http://rook-ceph-rgw-o11y.rook-ceph.svc.cluster.local:80
5+
6+
limit_config:
7+
query_timeout: 60s
8+
9+
compactor:
10+
replicas: 1
11+
persistence:
12+
enabled: true
13+
storageClassName: rook-ceph-block
14+
15+
ingester:
16+
replicas: 1
17+
persistence:
18+
enabled: true
19+
size: 15Gi
20+
storageClassName: rook-ceph-block
21+
22+
distributor:
23+
replicas: 1
24+
25+
querier:
26+
replicas: 1
27+
28+
queryFrontend:
29+
replicas: 1
30+
31+
queryScheduler:
32+
replicas: 1
33+
34+
indexGateway:
35+
replicas: 1
36+
37+
gateway:
38+
service:
39+
type: LoadBalancer
40+
port: 80
41+
ingress:
42+
hosts:
43+
- host: loki.kueyen.dev.lsst.org
44+
paths:
45+
- path: /
46+
pathType: Prefix
47+
tls:
48+
- secretName: loki-dashboard-ingress-tls
49+
hosts:
50+
- loki.kueyen.dev.lsst.org
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
global:
3+
dnsService: rke2-coredns-rke2-coredns

fleet/lib/loki/values.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
global:
2+
extraEnvFrom:
3+
- secretRef:
4+
name: loki-s3
5+
6+
loki:
7+
image:
8+
repository: grafana/loki
9+
auth_enabled: false
10+
11+
storage:
12+
type: s3
13+
s3:
14+
access_key_id: ${`${AWS_ACCESS_KEY_ID}`}
15+
secret_access_key: ${`${AWS_SECRET_ACCESS_KEY}`}
16+
s3ForcePathStyle: true
17+
region: o11y
18+
bucketNames:
19+
chunks: logs-chunks
20+
ruler: logs-ruler
21+
admin: logs-admin
22+
23+
commonConfig:
24+
replication_factor: 1
25+
26+
schemaConfig:
27+
configs:
28+
- from: "2025-03-01"
29+
store: tsdb
30+
object_store: s3
31+
schema: v13
32+
index:
33+
prefix: loki_index_
34+
period: 24h
35+
36+
compactor:
37+
retention_enabled: true
38+
retention_delete_delay: 2h
39+
working_directory: /var/loki/compactor
40+
delete_request_store: s3
41+
42+
deploymentMode: Distributed
43+
44+
gateway:
45+
enabled: true
46+
service:
47+
type: LoadBalancer
48+
port: 80
49+
ingress:
50+
enabled: true
51+
ingressClassName: nginx
52+
annotations:
53+
cert-manager.io/cluster-issuer: letsencrypt
54+
nginx.ingress.kubernetes.io/backend-protocol: HTTP
55+
nginx.ingress.kubernetes.io/client-body-buffer-size: 10m
56+
nginx.ingress.kubernetes.io/proxy-read-timeout: "60"
57+
nginx.ingress.kubernetes.io/proxy-send-timeout: "60"
58+
59+
ruler:
60+
enabled: false
61+
62+
read:
63+
replicas: 0
64+
write:
65+
replicas: 0
66+
backend:
67+
replicas: 0
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
apiVersion: objectbucket.io/v1alpha1
2+
kind: ObjectBucketClaim
3+
metadata:
4+
name: logs-chunks-storage
5+
namespace: rook-ceph
6+
spec:
7+
generateBucketName: logs-chunks-storage
8+
storageClassName: lfa
9+
additionalConfig:
10+
bucketOwner: s3-loki
11+
bucketPolicy: |
12+
{
13+
"Version": "2012-10-17",
14+
"Statement": [
15+
{
16+
"Sid": "AllowReadAccess",
17+
"Effect": "Allow",
18+
"Principal": {
19+
"AWS": "arn:aws:iam:::user/s3-loki"
20+
},
21+
"Action": [
22+
"s3:ListBucket",
23+
"s3:GetObject",
24+
"s3:GetObjectVersion"
25+
],
26+
"Resource": [
27+
"arn:aws:s3:::logs-chunks-storage",
28+
"arn:aws:s3:::logs-chunks-storage/*"
29+
]
30+
}
31+
]
32+
}
33+
---
34+
apiVersion: objectbucket.io/v1alpha1
35+
kind: ObjectBucketClaim
36+
metadata:
37+
name: logs-ruler-storage
38+
namespace: rook-ceph
39+
spec:
40+
generateBucketName: logs-ruler-storage
41+
storageClassName: lfa
42+
additionalConfig:
43+
bucketOwner: s3-loki
44+
bucketPolicy: |
45+
{
46+
"Version": "2012-10-17",
47+
"Statement": [
48+
{
49+
"Sid": "AllowReadAccess",
50+
"Effect": "Allow",
51+
"Principal": {
52+
"AWS": "arn:aws:iam:::user/s3-loki"
53+
},
54+
"Action": [
55+
"s3:ListBucket",
56+
"s3:GetObject",
57+
"s3:GetObjectVersion"
58+
],
59+
"Resource": [
60+
"arn:aws:s3:::logs-ruler-storage",
61+
"arn:aws:s3:::logs-ruler-storage/*"
62+
]
63+
}
64+
]
65+
}
66+
---
67+
apiVersion: objectbucket.io/v1alpha1
68+
kind: ObjectBucketClaim
69+
metadata:
70+
name: logs-admin-storage
71+
namespace: rook-ceph
72+
spec:
73+
generateBucketName: logs-admin-storage
74+
storageClassName: lfa
75+
additionalConfig:
76+
bucketOwner: s3-loki
77+
bucketPolicy: |
78+
{
79+
"Version": "2012-10-17",
80+
"Statement": [
81+
{
82+
"Sid": "AllowReadAccess",
83+
"Effect": "Allow",
84+
"Principal": {
85+
"AWS": "arn:aws:iam:::user/s3-loki"
86+
},
87+
"Action": [
88+
"s3:ListBucket",
89+
"s3:GetObject",
90+
"s3:GetObjectVersion"
91+
],
92+
"Resource": [
93+
"arn:aws:s3:::logs-admin-storage",
94+
"arn:aws:s3:::logs-admin-storage/*"
95+
]
96+
}
97+
]
98+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
apiVersion: ceph.rook.io/v1
3+
kind: CephObjectStoreUser
4+
metadata:
5+
name: s3-loki
6+
namespace: rook-ceph
7+
spec:
8+
store: lfa
9+
clusterNamespace: rook-ceph
10+
quotas:
11+
maxBuckets: 3
12+
---
13+
apiVersion: external-secrets.io/v1alpha1
14+
kind: PushSecret
15+
metadata:
16+
name: rook-ceph-object-user-lfa-loki
17+
namespace: rook-ceph
18+
spec:
19+
secretStoreRefs:
20+
- kind: ClusterSecretStore
21+
name: onepassword
22+
selector:
23+
secret:
24+
name: rook-ceph-object-user-lfa-loki
25+
data:
26+
- match:
27+
secretKey: AccessKey
28+
remoteRef:
29+
remoteKey: s3-loki
30+
property: username
31+
- match:
32+
secretKey: SecretKey
33+
remoteRef:
34+
remoteKey: s3-loki
35+
property: credential

fleet/s/dev/c/kueyen/loki

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/loki

0 commit comments

Comments
 (0)