Skip to content

Commit e240341

Browse files
rdiscalaclaude
andcommitted
CNF-14592: add LokiStack configuration CRs to the optional reference section
Add Loki Operator installation and LokiStack log storage CRs for the telco-core optional logging configuration: - LokiStack CR with 1x.extra-small sizing, S3 storage, v13 schema, and 5-day retention - Loki Operator Namespace, OperatorGroup, Subscription, and installation status verification CR (ztp-deploy-wave: 2) - S3 object storage Secret template - Update ClusterLogForwarder to forward audit and infrastructure logs to the local LokiStack via the collector service account - Add ClusterLogForwarder-LokiStack variant with commented-out external forwarding examples - Add kube-compare reference templates for validation Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a88ca23 commit e240341

18 files changed

Lines changed: 265 additions & 6 deletions

File tree

telco-core/configuration/core-baseline.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ policies:
4747
status: "True"
4848
reason: InstallSucceeded
4949

50+
# Loki operator (optional component)
51+
# - path: reference-crs/optional/logging/LokiOperatorNS.yaml
52+
# - path: reference-crs/optional/logging/LokiOperatorGroup.yaml
53+
# - path: reference-crs/optional/logging/LokiSubscription.yaml
54+
# - path: reference-crs/optional/logging/LokiOperatorStatus.yaml
55+
5056
# Cert-manager operator (optional component)
5157
# - path: reference-crs/optional/cert-manager/certManagerNS.yaml
5258
# - path: reference-crs/optional/cert-manager/certManagerOperatorgroup.yaml
@@ -94,6 +100,10 @@ policies:
94100
- path: reference-crs/optional/logging/ClusterLogServiceAccountAuditBinding.yaml
95101
- path: reference-crs/optional/logging/ClusterLogServiceAccountInfrastructureBinding.yaml
96102

103+
# LokiStack log storage (optional component)
104+
# - path: reference-crs/optional/logging/LokiSecret.yaml
105+
# - path: reference-crs/optional/logging/LokiStack.yaml
106+
97107
- path: reference-crs/required/networking/sriov/SriovOperatorConfig.yaml
98108
patches:
99109
- spec:

telco-core/configuration/core-overlay.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,23 @@ policies:
182182
name: kafka-open
183183
kafka:
184184
url: '{{hub fromConfigMap "" "regional" (printf "%s-log-url" (index .ManagedClusterLabels "region")) | toLiteral hub}}'
185+
# LokiStack local log storage (optional component)
186+
# - name: loki-local
187+
# type: lokiStack
188+
# lokiStack:
189+
# target:
190+
# name: logging-loki
191+
# namespace: openshift-logging
192+
# authentication:
193+
# token:
194+
# from: serviceAccount
195+
# tls:
196+
# ca:
197+
# key: service-ca.crt
198+
# configMapName: openshift-service-ca.crt
199+
# To add local Loki storage, uncomment the loki-local output above
200+
# and add a second pipeline. See ClusterLogForwarder-LokiStack.yaml
201+
# for a complete example.
185202
filters:
186203
- name: custom-labels
187204
type: openshiftLabels

telco-core/configuration/reference-crs-kube-compare/compare_ignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ required/machine-config/container-runtime.yaml
1313
ClusterLogging5Cleanup.yaml
1414
ClusterLogOperatorStatus.yaml
1515

16+
# Utility object for Loki Operator installation verification
17+
LokiOperatorStatus.yaml
18+
19+
# LokiStack variant of ClusterLogForwarder (example only)
20+
ClusterLogForwarder-LokiStack.yaml
21+
1622
# Utility objects to wait for and acknowledge cluster ugprades
1723
ClusterVersion.yaml
1824
upgrade-ack.yaml

telco-core/configuration/reference-crs-kube-compare/optional/logging/ClusterLogForwarder.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ metadata:
66
spec:
77
{{- if .spec.outputs }}
88
outputs:
9-
- name: {{ (index .spec.outputs 0).name }}
10-
type: kafka
11-
kafka:
12-
url: {{ (index .spec.outputs 0).kafka.url }}
9+
{{- .spec.outputs | toYaml | nindent 2 }}
1310
{{- end }}
1411
{{- if .spec.filters }}
1512
filters:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: operators.coreos.com/v1
2+
kind: OperatorGroup
3+
metadata:
4+
name: loki-operator
5+
namespace: openshift-operators-redhat
6+
annotations:
7+
operatorframework.io/bundle-unpack-min-retry-interval: 10m
8+
spec:
9+
{{- if .spec.upgradeStrategy }}
10+
upgradeStrategy: Default
11+
{{- end }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: openshift-operators-redhat
5+
labels:
6+
openshift.io/cluster-monitoring: "true"
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: logging-loki-s3
5+
namespace: openshift-logging
6+
stringData:
7+
access_key_id: {{ .stringData.access_key_id }}
8+
access_key_secret: {{ .stringData.access_key_secret }}
9+
bucketnames: {{ .stringData.bucketnames }}
10+
endpoint: {{ .stringData.endpoint }}
11+
region: {{ .stringData.region }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: loki.grafana.com/v1
2+
kind: LokiStack
3+
metadata:
4+
name: logging-loki
5+
namespace: openshift-logging
6+
spec:
7+
managementState: Managed
8+
limits:
9+
global:
10+
retention:
11+
days: {{ .spec.limits.global.retention.days }}
12+
size: {{ .spec.size }}
13+
storage:
14+
schemas:
15+
- version: v13
16+
effectiveDate: {{ (index .spec.storage.schemas 0).effectiveDate }}
17+
secret:
18+
name: logging-loki-s3
19+
type: s3
20+
storageClassName: {{ .spec.storageClassName }}
21+
tenants:
22+
mode: openshift-logging
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: operators.coreos.com/v1alpha1
2+
kind: Subscription
3+
metadata:
4+
name: loki-operator
5+
namespace: openshift-operators-redhat
6+
spec:
7+
channel: "stable-6.5"
8+
name: loki-operator
9+
source: {{ .spec.source }}
10+
sourceNamespace: openshift-marketplace
11+
installPlanApproval: Manual
12+
status:
13+
state: AtLatestKnown
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
apiVersion: observability.openshift.io/v1
3+
kind: ClusterLogForwarder
4+
metadata:
5+
name: instance
6+
namespace: openshift-logging
7+
spec:
8+
outputs:
9+
- name: loki-local
10+
type: lokiStack
11+
lokiStack:
12+
target:
13+
name: logging-loki
14+
namespace: openshift-logging
15+
authentication:
16+
token:
17+
from: serviceAccount
18+
tls:
19+
ca:
20+
key: service-ca.crt
21+
configMapName: openshift-service-ca.crt
22+
23+
# - name: external-logs
24+
# type: <external_type> # e.g., kafka, splunk, syslog
25+
# <external_type>:
26+
# url: <external_url>
27+
pipelines:
28+
- name: infra-audit-to-local-loki
29+
inputRefs:
30+
- audit
31+
- infrastructure
32+
outputRefs:
33+
- loki-local
34+
# - name: infra-audit-to-external
35+
# inputRefs:
36+
# - audit
37+
# - infrastructure
38+
# outputRefs:
39+
# - external-logs
40+
serviceAccount:
41+
name: collector
42+
status:
43+
conditions:
44+
- type: observability.openshift.io/Valid
45+
status: "True"

0 commit comments

Comments
 (0)