Skip to content

Commit 1c235e1

Browse files
committed
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-to_amend variant with commented-out external forwarding examples Co-authored-by: Claude
1 parent a88ca23 commit 1c235e1

12 files changed

Lines changed: 182 additions & 2 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ 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
185199
filters:
186200
- name: custom-labels
187201
type: openshiftLabels
@@ -198,6 +212,12 @@ policies:
198212
- custom-labels
199213
outputRefs:
200214
- kafka-open
215+
# - name: infra-audit-to-local-loki
216+
# inputRefs:
217+
# - audit
218+
# - infrastructure
219+
# outputRefs:
220+
# - loki-local
201221

202222
# Metal LB
203223
- path: reference-crs/required/networking/metallb/metallb.yaml

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

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

16+
# LokiStack variant of ClusterLogForwarder (example only)
17+
ClusterLogForwarder-LokiStack.yaml
18+
1619
# Utility objects to wait for and acknowledge cluster ugprades
1720
ClusterVersion.yaml
1821
upgrade-ack.yaml
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"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: operators.coreos.com/v1
3+
kind: OperatorGroup
4+
metadata:
5+
name: loki-operator
6+
namespace: openshift-operators-redhat
7+
spec:
8+
upgradeStrategy: Default
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: openshift-operators-redhat
6+
labels:
7+
# The cluster-monitoring label ensures Prometheus scrapes this namespace.
8+
openshift.io/cluster-monitoring: "true"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Operator installation verification (ztp-deploy-wave: 2)
2+
# This CR can be used to verify the installation/upgrade of the
3+
# Loki Operator by including status fields as shown in
4+
# examples below
5+
---
6+
apiVersion: operators.coreos.com/v1
7+
kind: Operator
8+
metadata:
9+
name: loki-operator.openshift-operators-redhat
10+
annotations:
11+
ran.openshift.io/ztp-deploy-wave: "2"
12+
status:
13+
# components:
14+
# refs:
15+
# - kind: Subscription
16+
# namespace: openshift-operators-redhat
17+
# conditions:
18+
# - type: CatalogSourcesUnhealthy
19+
# status: "False"
20+
# - kind: InstallPlan
21+
# namespace: openshift-operators-redhat
22+
# conditions:
23+
# - type: Installed
24+
# status: "True"
25+
# - kind: ClusterServiceVersion
26+
# namespace: openshift-operators-redhat
27+
# conditions:
28+
# - type: Succeeded
29+
# status: "True"
30+
# reason: InstallSucceeded
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Object storage credentials template
2+
---
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: logging-loki-s3
7+
namespace: openshift-logging
8+
stringData:
9+
access_key_id: "<access key>"
10+
access_key_secret: "<access key secret>"
11+
bucketnames: "<bucket names>"
12+
endpoint: "<storage endpoint>" # e.g. <https://storage.endpoint.url>
13+
region: "<region>"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Important: do not reuse the same LokiStack that is used for logging
2+
# See: https://docs.redhat.com/en/documentation/openshift_container_platform/4.21/html/network_observability/installing-network-observability-operators
3+
---
4+
apiVersion: loki.grafana.com/v1
5+
kind: LokiStack
6+
metadata:
7+
name: logging-loki
8+
namespace: openshift-logging
9+
spec:
10+
managementState: Managed
11+
limits:
12+
global:
13+
retention:
14+
days: 5 # Default retention period. User-configurable.
15+
# Sizing: uses Loki's built-in defaults for PVC sizing, which are determined
16+
# by the operator based on the size profile.
17+
# Important: sufficient storage must be provided according to data
18+
# requirements and the retention period configured above.
19+
size: 1x.extra-small # 14 vCPUs, 31Gi memory, 430Gi disk, 100GB/day
20+
storage:
21+
schemas:
22+
- version: v13
23+
effectiveDate: "<yyyy>-<mm>-<dd>" # Set to approximately two months before deployment date
24+
secret:
25+
name: logging-loki-s3
26+
type: s3
27+
storageClassName: "ocs-storagecluster-ceph-rbd" # Set to the cluster's available StorageClass
28+
tenants:
29+
mode: openshift-logging
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: operators.coreos.com/v1alpha1
3+
kind: Subscription
4+
metadata:
5+
name: loki-operator
6+
namespace: openshift-operators-redhat
7+
spec:
8+
channel: "stable-6.5" # Adapt for compatibility for OpenShift versions.
9+
installPlanApproval: Manual
10+
name: loki-operator
11+
source: redhat-operators-disconnected # For disconnected environments.
12+
sourceNamespace: openshift-marketplace
13+
status:
14+
# state: AtLatestKnown # Expected status

0 commit comments

Comments
 (0)