Skip to content

Commit 388144b

Browse files
committed
Add loki files
rename lokistack
1 parent 506f214 commit 388144b

File tree

6 files changed

+186
-0
lines changed

6 files changed

+186
-0
lines changed

cloudkitty-loki/README

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# CloudKitty Loki Deployment with Red Hat Loki Operator
2+
3+
1. Create the internal certificate
4+
```
5+
$ oc apply -f certificate-internal.yaml
6+
$ oc apply -f certificate-public.yaml
7+
```
8+
9+
2. Create ConfigMap
10+
```
11+
$ kubectl create configmap lokistack-mtls --from-literal=ca.crt="$(kubectl get secret cert-loki-public-route -n openstack -o jsonpath='{.data.ca\.crt}' | base64 -d)" -n openstack
12+
```
13+
14+
# Need to set up S3
15+
oc apply -f <telemetry_operator_repo>/ci/deploy-logging-dependencies/files/minio-dev.yaml
16+
17+
oc apply -f loki-subscription.yaml
18+
19+
3. Edit loki-secret.yaml with the appropiate data to connect to S3:
20+
```
21+
access_key_id: <your access key id>
22+
access_key_secret: <your access key secret>
23+
bucketnames: <your S3 bucket name>
24+
endpoint: <your S3 endpoint url>
25+
```
26+
27+
4. Create LokiStack:
28+
```
29+
$ oc apply -f lokistack.yaml
30+
```
31+
32+
5. Check that Loki pods have been created in the openstack namespace:
33+
```
34+
lokistack-compactor-0 1/1 Running 0 18m
35+
lokistack-distributor-65c994c58-c84rw 1/1 Running 0 18m
36+
lokistack-gateway-6dbbc4d789-lnjdv 1/1 Running 0 18m
37+
lokistack-gateway-6dbbc4d789-s8pwx 1/1 Running 0 18m
38+
lokistack-index-gateway-0 1/1 Running 0 18m
39+
lokistack-ingester-0 1/1 Running 0 18m
40+
lokistack-querier-7f887c4f89-rw7qb 1/1 Running 0 18m
41+
lokistack-query-frontend-57576979bf-qbxw7 1/1 Running 0 18m
42+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: cert-manager.io/v1
3+
kind: Certificate
4+
metadata:
5+
name: cert-loki-internal
6+
namespace: openstack
7+
spec:
8+
secretName: cert-loki-internal-svc
9+
commonName: cloudkitty-lokistack-gateway-http.openstack.svc
10+
dnsNames:
11+
- cloudkitty-lokistack-gateway-http.openstack.svc
12+
- cloudkitty-lokistack-gateway-http.openstack.svc.cluster.local
13+
subject:
14+
## This is what binds the client to the role cloudkitty definedi in LokiStack
15+
organizationalUnits:
16+
- cloudkitty
17+
privateKey:
18+
algorithm: RSA
19+
size: 2048
20+
encoding: PKCS8
21+
usages:
22+
- digital signature
23+
- key encipherment
24+
- client auth
25+
issuerRef:
26+
kind: Issuer
27+
name: rootca-internal
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
apiVersion: cert-manager.io/v1
3+
kind: Certificate
4+
metadata:
5+
name: cert-loki-public
6+
namespace: openstack
7+
spec:
8+
secretName: cert-loki-public-route
9+
commonName: lokistack-openstack.apps-crc.testing
10+
dnsNames:
11+
- lokistack-openstack.apps-crc.testing
12+
subject:
13+
## This is what binds the client to the role cloudkitty defined in LokiStack
14+
organizationalUnits:
15+
- cloudkitty
16+
privateKey:
17+
algorithm: RSA
18+
size: 2048
19+
encoding: PKCS8
20+
usages:
21+
- digital signature
22+
- key encipherment
23+
- client auth
24+
issuerRef:
25+
kind: Issuer
26+
name: rootca-public

cloudkitty-loki/loki-secret.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: loki-secret-s3
5+
namespace: openstack
6+
stringData:
7+
access_key_id: minio
8+
access_key_secret: minio123
9+
bucketnames: cloudkitty-bucket
10+
endpoint: http://api-minio-dev.apps-crc.testing
11+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: openshift-operators-redhat
5+
annotations:
6+
openshift.io/node-selector: ""
7+
labels:
8+
openshift.io/cluster-monitoring: "true"
9+
---
10+
apiVersion: operators.coreos.com/v1alpha1
11+
kind: Subscription
12+
metadata:
13+
labels:
14+
operators.coreos.com/loki-operator.openshift-operators-redhat: ""
15+
name: loki-operator
16+
namespace: openshift-operators-redhat
17+
spec:
18+
channel: stable-6.3
19+
installPlanApproval: Automatic
20+
name: loki-operator
21+
source: redhat-operators
22+
sourceNamespace: openshift-marketplace
23+
# startingCSV: loki-operator.v6.3.0
24+

cloudkitty-loki/lokistack.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
apiVersion: loki.grafana.com/v1
3+
kind: LokiStack
4+
metadata:
5+
name: cloudkitty-lokistack
6+
namespace: openstack
7+
spec:
8+
size: 1x.demo
9+
storage:
10+
schemas:
11+
- version: v13
12+
effectiveDate: "2024-11-18"
13+
secret:
14+
name: loki-secret-s3
15+
type: s3
16+
storageClassName: crc-csi-hostpath-provisioner
17+
tenants:
18+
mode: static
19+
authentication:
20+
- tenantName: cloudkitty
21+
tenantId: cloudkitty
22+
mTLS:
23+
ca:
24+
caKey: ca.crt
25+
caName: lokistack-mtls
26+
authorization:
27+
roleBindings:
28+
- name: cloudkitty-dataframes
29+
roles:
30+
- cloudkitty-dataframes
31+
subjects:
32+
- kind: group
33+
name: cloudkitty
34+
- name: cluster-reader
35+
roles:
36+
- cluster-reader
37+
subjects:
38+
- kind: group
39+
name: cloudkitty-dataframes-admin
40+
roles:
41+
- name: cloudkitty-dataframes
42+
permissions:
43+
- read
44+
- write
45+
resources:
46+
- logs
47+
tenants:
48+
- cloudkitty
49+
- name: cluster-reader
50+
permissions:
51+
- read
52+
resources:
53+
- logs
54+
tenants:
55+
- cloudkitty
56+

0 commit comments

Comments
 (0)