-
Notifications
You must be signed in to change notification settings - Fork 74
CNF-14592: add LokiStack configuration CRs to the optional reference section #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| name: loki-operator | ||
| namespace: openshift-operators-redhat | ||
| annotations: | ||
| operatorframework.io/bundle-unpack-min-retry-interval: 10m | ||
| spec: | ||
| {{- if .spec.upgradeStrategy }} | ||
| upgradeStrategy: Default | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: openshift-operators-redhat | ||
| labels: | ||
| openshift.io/cluster-monitoring: "true" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: logging-loki-s3 | ||
| namespace: openshift-logging | ||
| stringData: | ||
| access_key_id: {{ .stringData.access_key_id }} | ||
| access_key_secret: {{ .stringData.access_key_secret }} | ||
| bucketnames: {{ .stringData.bucketnames }} | ||
| endpoint: {{ .stringData.endpoint }} | ||
| region: {{ .stringData.region }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| apiVersion: loki.grafana.com/v1 | ||
| kind: LokiStack | ||
| metadata: | ||
| name: logging-loki | ||
| namespace: openshift-logging | ||
| spec: | ||
| managementState: Managed | ||
| limits: | ||
| global: | ||
| retention: | ||
| days: {{ .spec.limits.global.retention.days }} | ||
| size: {{ .spec.size }} | ||
| storage: | ||
| schemas: | ||
| - version: v13 | ||
| effectiveDate: {{ (index .spec.storage.schemas 0).effectiveDate }} | ||
| secret: | ||
| name: logging-loki-s3 | ||
| type: s3 | ||
| storageClassName: {{ .spec.storageClassName }} | ||
| tenants: | ||
| mode: openshift-logging |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: loki-operator | ||
| namespace: openshift-operators-redhat | ||
| spec: | ||
| channel: "stable-6.5" | ||
| name: loki-operator | ||
| source: {{ .spec.source }} | ||
| sourceNamespace: openshift-marketplace | ||
| installPlanApproval: Manual | ||
| status: | ||
| state: AtLatestKnown |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,54 @@ | ||
| --- | ||
| apiVersion: "observability.openshift.io/v1" | ||
| apiVersion: observability.openshift.io/v1 | ||
| kind: ClusterLogForwarder | ||
| metadata: | ||
| name: instance | ||
| namespace: openshift-logging | ||
| spec: | ||
| # outputs: $outputs | ||
| # pipelines: $pipelines | ||
| outputs: | ||
| # Local Loki storage for troubleshooting | ||
| - name: loki-local | ||
| type: lokiStack | ||
| lokiStack: | ||
| target: | ||
| name: logging-loki | ||
| namespace: openshift-logging | ||
| authentication: | ||
| token: | ||
| from: serviceAccount | ||
| tls: | ||
| ca: | ||
| key: service-ca.crt | ||
| configMapName: openshift-service-ca.crt | ||
|
|
||
| # External log aggregation (OSS/BSS systems) | ||
| # Uncomment and configure for external forwarding | ||
| # - name: external-logs | ||
| # type: kafka # or splunk, syslog, etc. | ||
| # kafka: | ||
| # url: tcp://10.11.12.13:9092/test | ||
|
|
||
| pipelines: | ||
| # Infrastructure and audit logs to local Loki | ||
| - name: infra-audit-to-local-loki | ||
| inputRefs: | ||
| - audit | ||
| - infrastructure | ||
| outputRefs: | ||
| - loki-local | ||
|
|
||
| # Optional: Forward to external system (uncomment if needed) | ||
| # - name: infra-audit-to-external | ||
| # inputRefs: | ||
| # - audit | ||
| # - infrastructure | ||
| # outputRefs: | ||
| # - external-logs | ||
|
|
||
| serviceAccount: | ||
| name: collector | ||
| status: | ||
| # Verify that the configuration is correct | ||
| conditions: | ||
| - type: observability.openshift.io/Valid | ||
| status: "True" | ||
|
|
||
| # apiVersion: "observability.openshift.io/v1" | ||
| # kind: ClusterLogForwarder | ||
| # metadata: | ||
| # name: instance | ||
| # namespace: openshift-logging | ||
| # spec: | ||
| # outputs: | ||
| # - type: "kafka" | ||
| # name: kafka-open | ||
| # # below url is an example | ||
| # kafka: | ||
| # url: tcp://10.11.12.13:9092/test | ||
| # filters: | ||
| # - name: test-labels | ||
| # type: openshiftLabels | ||
| # openshiftLabels: | ||
| # label1: test1 | ||
| # label2: test2 | ||
| # label3: test3 | ||
| # label4: test4 | ||
| # pipelines: | ||
| # - name: all-to-default | ||
| # inputRefs: | ||
| # - audit | ||
| # - infrastructure | ||
| # filterRefs: | ||
| # - test-labels | ||
| # outputRefs: | ||
| # - kafka-open | ||
| # serviceAccount: | ||
| # name: collector |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| name: loki-operator | ||
| namespace: openshift-operators-redhat | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs a standard annotation for olm bundle unpack retry:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does Loki not have a namespace of its own for installation? If this is the documented reference from monitoring team it is fine, just want to confirm
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. I've followed the Red Hat OpenShift Logging documentation (6.2 and 6.5) for which states:
The |
||
| annotations: | ||
| operatorframework.io/bundle-unpack-min-retry-interval: 10m | ||
| spec: | ||
| upgradeStrategy: Default | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: openshift-operators-redhat | ||
| labels: | ||
| # The cluster-monitoring label ensures Prometheus scrapes this namespace. | ||
| openshift.io/cluster-monitoring: "true" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Operator installation verification | ||
| # This CR can be used to verify the installation/upgrade of the | ||
| # Loki Operator by including status fields as shown in | ||
| # examples below | ||
| --- | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: Operator | ||
| metadata: | ||
| name: loki-operator.openshift-operators-redhat | ||
| status: | ||
| # components: | ||
| # refs: | ||
| # - kind: Subscription | ||
| # namespace: openshift-operators-redhat | ||
| # conditions: | ||
| # - type: CatalogSourcesUnhealthy | ||
| # status: "False" | ||
| # - kind: InstallPlan | ||
| # namespace: openshift-operators-redhat | ||
| # conditions: | ||
| # - type: Installed | ||
| # status: "True" | ||
| # - kind: ClusterServiceVersion | ||
| # namespace: openshift-operators-redhat | ||
| # conditions: | ||
| # - type: Succeeded | ||
| # status: "True" | ||
| # reason: InstallSucceeded | ||
|
Comment on lines
+11
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this part be uncommented?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left the status commented out as an example. This is consistent with the already existing ClusterLogOperatorStatus.yaml added by @imiller0 . If you'd prefer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Object storage credentials template | ||
| # | ||
| # Note: In production environments, secrets should be managed via secure | ||
| # methods such as the External Secrets Operator, Sealed Secrets, or a | ||
| # secrets management platform (e.g., HashiCorp Vault, AWS Secrets Manager). | ||
| # Avoid committing actual credentials to version control. | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: logging-loki-s3 | ||
| namespace: openshift-logging | ||
| stringData: | ||
| access_key_id: "<access key>" | ||
| access_key_secret: "<access key secret>" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add note that secrets should be managed via secure method such as External Secrets Operator
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| bucketnames: "<bucket names>" | ||
| endpoint: "<storage endpoint>" # e.g. <https://storage.endpoint.url> | ||
| region: "<region>" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Important: do not reuse the same LokiStack that is used for logging | ||
| # See: https://docs.redhat.com/en/documentation/openshift_container_platform/4.21/html/network_observability/installing-network-observability-operators | ||
| --- | ||
| apiVersion: loki.grafana.com/v1 | ||
| kind: LokiStack | ||
| metadata: | ||
| name: logging-loki | ||
| namespace: openshift-logging | ||
| spec: | ||
| managementState: Managed | ||
| limits: | ||
| global: | ||
| retention: | ||
| days: 5 # Default retention period. User-configurable. | ||
| # Sizing: uses Loki's built-in defaults for PVC sizing, which are determined | ||
| # by the operator based on the size profile. | ||
| # Important: sufficient storage must be provided according to data | ||
| # requirements and the retention period configured above. | ||
| size: 1x.extra-small # 14 vCPUs, 31Gi memory, 430Gi disk, 100GB/day | ||
| storage: | ||
| schemas: | ||
| - version: v13 | ||
| # effectiveDate controls when this schema version becomes active. | ||
| # CRITICAL: Must be set to a date in the PAST (at least 2 months before | ||
| # deployment) to ensure the schema is immediately active when Loki starts. | ||
| # Setting it in the future will prevent Loki from ingesting any logs. | ||
| # Setting it too recently may cause Loki to reject logs with timestamps | ||
| # that predate the effectiveDate. Cannot be changed retroactively. | ||
| # Example: If deploying in May 2026, set to "2026-03-01" or earlier. | ||
| effectiveDate: "<yyyy-mm-dd>" # e.g., "2026-03-01" | ||
| # Object storage configuration (LONG-TERM LOG STORAGE) | ||
| # This secret contains S3-compatible object storage credentials where | ||
| # compressed log chunks and indexes are stored permanently. | ||
| secret: | ||
| name: logging-loki-s3 | ||
| type: s3 | ||
| # Block storage configuration (SHORT-TERM BUFFERING) | ||
| # storageClassName provisions PVCs for Loki component StatefulSets. | ||
| # Used for: Write-Ahead Logs (WAL), temporary chunk caching, ingester buffering. | ||
| # This is INDEPENDENT from object storage - both are required. | ||
| storageClassName: "ocs-storagecluster-ceph-rbd" # Set to the cluster's available StorageClass | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this relate to the storage config in the Secret? Are these the same endpoint, or completely independent or ??
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are two independent entries for two different types and uses of storage. The secret is used to access an S3-compatible long-term storage for compressed log files. The storage class is used instead for short-term buffering (for performance and recovery in case of crash). Added comments that clarify their use.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Within RDS Core storageClassed are created later in the process (ODF configuration is done in the @imiller0 thoughts? |
||
| tenants: | ||
| mode: openshift-logging | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: loki-operator | ||
| namespace: openshift-operators-redhat | ||
| spec: | ||
| channel: "stable-6.5" # Adapt for compatibility for OpenShift versions. | ||
| installPlanApproval: Manual | ||
| name: loki-operator | ||
| source: redhat-operators-disconnected # For disconnected environments. | ||
| sourceNamespace: openshift-marketplace | ||
| status: | ||
| state: AtLatestKnown |
Uh oh!
There was an error while loading. Please reload this page.