diff --git a/charts/openshift-logging/Chart.yaml b/charts/openshift-logging/Chart.yaml index aef119cd..23e00ff4 100644 --- a/charts/openshift-logging/Chart.yaml +++ b/charts/openshift-logging/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: openshift-logging -description: Deploy and configure OpenShift Logging including Elasticsearch and Kibana -version: 1.0.29 +description: Deploy and configure OpenShift Logging based on LokiStack +version: 2.0.0 home: https://github.com/tjungbauer/helm-charts/tree/main/charts/openshift-logging icon: https://raw.githubusercontent.com/tjungbauer/helm-charts/gh-pages/images/logging.svg dependencies: @@ -34,3 +34,5 @@ annotations: description: Optimizing Loki configuration for ClusterLogging object. - kind: added description: updated to helper-status-checker 4.0.0 + - kind: added + description: v2.0 added README and removed Elasticsearch configuration as it is considered as deprecated. diff --git a/charts/openshift-logging/README.md b/charts/openshift-logging/README.md index 75c46e04..d2657406 100644 --- a/charts/openshift-logging/README.md +++ b/charts/openshift-logging/README.md @@ -1,178 +1,116 @@ -[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/openshift-bootstraps)](https://artifacthub.io/packages/search?repo=openshift-bootstraps) -![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg) -# Install Operator OpenShift Logging -This simply installs OpenShift Logging Operator and validates the status of the installation. -It uses the Subchart: +# openshift-logging -* [helper-operator](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator): to create the required Operator resources -* [helper-status-checker](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator): to verify if the Deployments of this Operator are running. + [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/openshift-bootstraps)](https://artifacthub.io/packages/search?repo=openshift-bootstraps) + [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) + [![Lint and Test Charts](https://github.com/tjungbauer/helm-charts/actions/workflows/lint_and_test_charts.yml/badge.svg)](https://github.com/tjungbauer/helm-charts/actions/workflows/lint_and_test_charts.yml) + [![Release Charts](https://github.com/tjungbauer/helm-charts/actions/workflows/release.yml/badge.svg)](https://github.com/tjungbauer/helm-charts/actions/workflows/release.yml) -It is best used with a GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops + ![Version: 2.0.0](https://img.shields.io/badge/Version-2.0.0-informational?style=flat-square) -## TL;DR + -```console -helm repo add --force-update tjungbauer https://charts.stderr.at -helm repo update -``` + ## Description -## Prerequisites + Deploy and configure OpenShift Logging based on LokiStack -* Kubernetes 1.12+ -* Helm 3 +This Helm Chart is installing and configuring OpenShift Logging -## Installing the Chart +**NOTE**: OpenShift Logging using EFK stack (Elasticsearch, Kibana and Fluentd) is considered as deprecated and has been removed from this Chart. Instead, LokiStack with Vector +should be used. -To install the chart with the release name `my-release`: +**NOTE**: ClusterLogForwarder is currently not configured with this Chart. This can be set using in the GitOps Chart/Kustomize that is using this chart as a dependency. -```console -helm install my-release tjungbauer/openshift-logging -``` +## Dependencies -The command deploys the chart on the Kubernetes cluster in the default configuration. +This chart has the following dependencies: -## Uninstalling the Chart +| Repository | Name | Version | +|------------|------|---------| +| https://charts.stderr.at/ | helper-operator | ~1.0.18 | +| https://charts.stderr.at/ | helper-status-checker | ~4.0.0 | -To uninstall/delete the my-release deployment: +It is best used with a full GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops (for example in the folder clusters/management-cluster/setup-openshift-logging) -```console -helm delete my-release -``` +## Maintainers -The command removes all the Kubernetes components associated with the chart and deletes the release. +| Name | Email | Url | +| ---- | ------ | --- | +| tjungbauer | | | + +## Sources +Source: +* +* +* + +Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/openshift-logging ## Parameters -The following table lists the configurable parameters of the chart and their default values. Only variables of this specific Helm Chart are listed. For the values of the Subchart read the appropriate README of the Subcharts. - -| Parameter | Description | Default | -|-------------------------------------------|-----------------------------------------------|---------------------------------------------------------| -| `loggingConfig.enabled` | Configure Cluster Logging | `` | -| `loggingConfig.syncwave` | Syncwave when ClusterLogging shall be created | `` | -| `loggingConfig.es.nodes` | *Only ES* number of ES nodes | `` | -| `loggingConfig.es.storageclass` | *Only ES* storage class for ES | `` | -| `loggingConfig.es.storagesize` | *Only ES* size of ES storage | `` | -| `loggingConfig.es.limits.mem` | *Only ES* Set memory limit. Good for Labs. | `` | -| `loggingConfig.es.requests.mem` | *Only ES* Set memory requests. Good for Labs. | `` | -| `loggingConfig.es.redundancyPolicy` | *Only ES* ES Redundancy Policy. i.e. ZeroRedundancy | `` | -| `loggingConfig.logStore.type` | Logstore Type. Either Elasticsearch or lokistack | `` | -| `loggingConfig.logStore.name` | *Only Loki* Name of the Lokistack instance | `` | -| `loggingConfig.logStore.retentionPolicy.application.maxAge` | *Only Loki* Retention time for application logs. Could be 1d, 1w, 1h etc... | `1d` | -| `loggingConfig.logStore.retentionPolicy.audit.maxAge` | *Only Loki* Retention time for audit logs. Could be 1d, 1w, 1h etc... | `1d` | -| `loggingConfig.logStore.retentionPolicy.infra.maxAge` | *Only Loki* Retention time for infra logs. Could be 1d, 1w, 1h etc... | `1d` | -| `loggingConfig.logStore.visualization.type` | Either Kibana or ocp-console | `ocp-console` | - - -## Example + +Verify the subcharts for additional settings: + +* [helper-operator](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator) +* [helper-status-checker](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator) +* [helper-lokistack](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-lokistack) + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| loggingConfig.enabled | bool | false | Enable openshift logging configuration | +| loggingConfig.logStore.collection.resources | object | N/A | The resource requirements for the collector. Set this only when you know what you are doing | +| loggingConfig.logStore.collection.resources.limits | object | N/A | LIMITS for CPU, memory and storage | +| loggingConfig.logStore.collection.resources.requests | object | N/A | REQUESTS for CPU, memory and storage | +| loggingConfig.logStore.collection.tolerations | list | N/A | Define the tolerations the collector Pods will accept | +| loggingConfig.logStore.collection.type | string | vector | The type of Log Collection to configure Vector in case of Loki. | +| loggingConfig.logStore.lokistack | string | logging-loki | Name of the LokiStack resource. | +| loggingConfig.logStore.type | string | `"lokistack"` | The Type of Log Storage to configure. The operator currently supports either using ElasticSearch managed by elasticsearch-operator or Loki managed by loki-operator (LokiStack) as a default log store. However, Elasticsearch is deprecated and should not be used here ... it would result in an error | +| loggingConfig.logStore.visualization.ocpConsole.logsLimit | int | none | LogsLimit is the max number of entries returned for a query. | +| loggingConfig.logStore.visualization.ocpConsole.timeout | string | none | Timeout is the max duration before a query timeout | +| loggingConfig.logStore.visualization.tolerations | list | N/A | Define the tolerations the visualisation Pod will accept | +| loggingConfig.logStore.visualization.type | string | ocp-console | The type of Visualization to configure Could be either Kibana (deprecated) or ocp-console | +| loggingConfig.managementState | string | Managed | Indicator if the resource is 'Managed' or 'Unmanaged' by the operator | +| loggingConfig.syncwave | string | 4 | Syncwave for the ClusterLogging resource | + +## Example values ```yaml --- loggingConfig: - enabled: false - syncwave: '4' - # Indicator if the resource is 'Managed' or 'Unmanaged' by the operator - # managementState: Managed - # Specification of the Log Storage component for the cluster + enabled: true + logStore: - # The Type of Log Storage to configure. The operator currently supports either using ElasticSearch managed by elasticsearch-operator or Loki managed by loki-operator (LokiStack) as a default log store. type: lokistack - # Name of the LokiStack resource. lokistack: logging-loki - retentionPolicy: - application: - maxAge: 1d - audit: - maxAge: 1d - infra: - maxAge: 1d + visualization: - # The type of Visualization to configure - # Could be either Kibana or ocp-console - type: ocp-console + type: ocp-console + collection: - # The type of Log Collection to configure - # Vector in case of Loki... type: vector - # The resource requirements for the collector - # resources: - # limits: - # cpu: '500m' - # memory: '1Gi' - # ephemeral-storage: '50Mi' - # requests: - # cpu: '500m' - # memory: '1Gi' - # ephemeral-storage: '500Mi' - # Define the tolerations the Pods will accept - # tolerations: - # - effect: NoSchedule - # key: infra - # operator: Equal - # value: 'reserved' - -# Install Operator Compliance Operator -# Deploys Operator --> Subscription and Operatorgroup -# Syncwave: 0 -helper-operator: - operators: - elasticsearch-operator: - enabled: false - syncwave: '0' - namespace: - name: openshift-operators-redhat - create: true - subscription: - approval: Automatic - operatorName: elasticsearch-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - operatorgroup: - notownnamespace: true - create: true - - loki-operator: - enabled: false - syncwave: '0' - namespace: - name: openshift-operators-redhat - create: true - subscription: - channel: stable - approval: Automatic - operatorName: loki-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - operatorgroup: - # notownnamespace: true - create: false - - cluster-logging-operator: - enabled: true - syncwave: '0' - namespace: - name: openshift-logging - create: true - subscription: - approval: Automatic - operatorName: cluster-logging - source: redhat-operators - sourceNamespace: openshift-marketplace - operatorgroup: - create: true - -helper-status-checker: - enabled: true +``` + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +helm install my-release tjungbauer/> +``` - # use the value of the currentCSV (packagemanifest) but WITHOUT the version !! - operatorName: cluster-logging +The command deploys the chart on the Kubernetes cluster in the default configuration. - # where operator is installed - namespace: - name: openshift-logging +## Uninstalling the Chart - serviceAccount: - create: true - name: "status-checker-logging" +To uninstall/delete the my-release deployment: +```console +helm delete my-release ``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/openshift-logging/README.md.gotmpl b/charts/openshift-logging/README.md.gotmpl new file mode 100644 index 00000000..85060fe9 --- /dev/null +++ b/charts/openshift-logging/README.md.gotmpl @@ -0,0 +1,45 @@ +{{ template "doc.header" . }} + +This Helm Chart is installing and configuring OpenShift Logging + +**NOTE**: OpenShift Logging using EFK stack (Elasticsearch, Kibana and Fluentd) is considered as deprecated and has been removed from this Chart. Instead, LokiStack with Vector +should be used. + +**NOTE**: ClusterLogForwarder is currently not configured with this Chart. This can be set using in the GitOps Chart/Kustomize that is using this chart as a dependency. + +{{ template "doc.deps" . }} + +It is best used with a full GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops (for example in the folder clusters/management-cluster/setup-openshift-logging) + + +{{ template "doc.maintainer_and_sources" . }} + +## Parameters + +Verify the subcharts for additional settings: + +* [helper-operator](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator) +* [helper-status-checker](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator) +* [helper-lokistack](https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-lokistack) + +{{ template "doc.values" . }} + +## Example values + +```yaml +--- +loggingConfig: + enabled: true + + logStore: + type: lokistack + lokistack: logging-loki + + visualization: + type: ocp-console + + collection: + type: vector +``` + +{{ template "doc.footer" . }} diff --git a/charts/openshift-logging/templates/ClusterLogging.yaml b/charts/openshift-logging/templates/ClusterLogging.yaml index 9fdfae14..f5573ae3 100644 --- a/charts/openshift-logging/templates/ClusterLogging.yaml +++ b/charts/openshift-logging/templates/ClusterLogging.yaml @@ -9,76 +9,16 @@ metadata: labels: {{- include "common.labels" $ | nindent 4 }} annotations: - argocd.argoproj.io/sync-wave: {{ .syncwave | quote }} + argocd.argoproj.io/sync-wave: {{ .syncwave | default 4 | quote }} argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true spec: managementState: {{ .managementState | default "Managed" | quote }} - {{- if eq ( $.Values.elasticsearch | toString) "true" }} - logStore: - type: "elasticsearch" - elasticsearch: - nodeCount: {{ .es.nodes }} - storage: - storageClassName: {{ .es.storageclass | quote }} - size: {{ .es.storagesize }} - resources: - limits: - memory: {{ .es.limits.mem | quote }} - requests: - memory: {{ .es.requests.mem | quote }} - proxy: - resources: - limits: - memory: 256Mi - requests: - memory: 256Mi - redundancyPolicy: {{ .es.redundancyPolicy | quote }} - retentionPolicy: - application: - maxAge: {{ .retentionPolicy.application.maxAge | default "1d" }} - infra: - maxAge: {{ .retentionPolicy.infra.maxAge | default "1d" }} - audit: - maxAge: {{ .retentionPolicy.audit.maxAge | default "1d" }} - visualization: - type: "kibana" - kibana: - replicas: 1 - collection: - logs: - type: "fluentd" - fluentd: {} - {{- end }} {{- if eq .logStore.type "lokistack" }} {{- with .logStore }} logStore: type: {{ .type }} lokistack: - name: {{ .lokistack }} - {{- if .retentionPolicy }} - retentionPolicy: - {{- if .retentionPolicy.application }} - application: - {{- if .retentionPolicy.application.maxAge }} - maxAge: {{ .retentionPolicy.application.maxAge }} - pruneNamespacesInterval: {{ .retentionPolicy.application.pruneNamespacesInterval | default "1d" }} - {{- end }} - {{- end }} - {{- if .retentionPolicy.audit }} - audit: - {{- if .retentionPolicy.audit.maxAge }} - maxAge: {{ .retentionPolicy.audit.maxAge }} - pruneNamespacesInterval: {{ .retentionPolicy.audit.pruneNamespacesInterval | default "1d" }} - {{- end }} - {{- end }} - {{- if .retentionPolicy.infra }} - infra: - {{- if .retentionPolicy.infra.maxAge }} - maxAge: {{ .retentionPolicy.infra.maxAge }} - pruneNamespacesInterval: {{ .retentionPolicy.infra.pruneNamespacesInterval | default "1d" }} - {{- end }} - {{- end }} - {{- end }} + name: {{ .lokistack | default "logging-loki" }} collection: type: {{ .collection.type | default "vector" }} @@ -128,6 +68,29 @@ spec: {{- end }} visualization: type: {{ .visualization.type | default "ocp-console" }} + {{- if .visualization.ocpConsole }} + {{- if .visualization.ocpConsole.logsLimit }} + logsLimit: 1000 + {{- end }} + {{- if .visualization.ocpConsole.timeout }} + timeout: 10s + {{- end }} + {{- end }} + + {{- /* Set tolerations for the VISUALISATION */}} + {{- if .visualization.tolerations }} + tolerations: + {{- range $key, $value := .visualization.tolerations }} + - effect: {{ $value.effect }} + key: {{ $value.key }} + operator: {{ $value.operator }} + value: {{ $value.value }} + {{- if $value.tolerationSeconds }} + tolerationSeconds: {{ $value.tolerationSeconds }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/openshift-logging/values.yaml b/charts/openshift-logging/values.yaml index b4e3a225..6e42eab0 100644 --- a/charts/openshift-logging/values.yaml +++ b/charts/openshift-logging/values.yaml @@ -1,67 +1,86 @@ --- loggingConfig: - enabled: false + # -- Enable openshift logging configuration + # @default -- false + enabled: true + + # -- Syncwave for the ClusterLogging resource + # @default -- 4 syncwave: '4' - # Indicator if the resource is 'Managed' or 'Unmanaged' by the operator - # managementState: Managed - # Specification of the Log Storage component for the cluster + + # -- Indicator if the resource is 'Managed' or 'Unmanaged' by the operator + # @default -- Managed + managementState: Managed + logStore: - # The Type of Log Storage to configure. The operator currently supports either using ElasticSearch managed by elasticsearch-operator or Loki managed by loki-operator (LokiStack) as a default log store. + # -- The Type of Log Storage to configure. + # The operator currently supports either using ElasticSearch managed by elasticsearch-operator or Loki managed by loki-operator (LokiStack) as a default log store. + # However, Elasticsearch is deprecated and should not be used here ... it would result in an error type: lokistack - # Name of the LokiStack resource. + + # -- Name of the LokiStack resource. + # @default -- logging-loki lokistack: logging-loki - retentionPolicy: - application: - maxAge: 1d - audit: - maxAge: 1d - infra: - maxAge: 1d + visualization: - # The type of Visualization to configure - # Could be either Kibana or ocp-console + # -- The type of Visualization to configure + # Could be either Kibana (deprecated) or ocp-console + # @default -- ocp-console type: ocp-console + + ocpConsole: + # -- LogsLimit is the max number of entries returned for a query. + # @default -- none + logsLimit: 1000 + + # -- Timeout is the max duration before a query timeout + # @default -- none + timeout: 10s + + # -- Define the tolerations the visualisation Pod will accept + # @default -- N/A + tolerations: + - effect: NoSchedule + key: infra + operator: Equal + value: 'reserved' + collection: - # The type of Log Collection to configure - # Vector in case of Loki... + # -- The type of Log Collection to configure + # Vector in case of Loki. + # @default -- vector type: vector - # The resource requirements for the collector - # resources: - # limits: - # cpu: '500m' - # memory: '1Gi' - # ephemeral-storage: '50Mi' - # requests: - # cpu: '500m' - # memory: '1Gi' - # ephemeral-storage: '500Mi' - # Define the tolerations the Pods will accept - # tolerations: - # - effect: NoSchedule - # key: infra - # operator: Equal - # value: 'reserved' + + # -- The resource requirements for the collector. Set this only when you know what you are doing + # @default -- N/A + resources: + # -- LIMITS for CPU, memory and storage + # @default -- N/A + limits: + cpu: '500m' + memory: '1Gi' + ephemeral-storage: '50Mi' + # -- REQUESTS for CPU, memory and storage + # @default -- N/A + requests: + cpu: '500m' + memory: '1Gi' + ephemeral-storage: '500Mi' + + # -- Define the tolerations the collector Pods will accept + # @default -- N/A + tolerations: + - effect: NoSchedule + key: infra + operator: Equal + value: 'reserved' # Install Operator Compliance Operator # Deploys Operator --> Subscription and Operatorgroup # Syncwave: 0 +# @ignore helper-operator: operators: - elasticsearch-operator: - enabled: false - syncwave: '0' - namespace: - name: openshift-operators-redhat - create: true - subscription: - approval: Automatic - operatorName: elasticsearch-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - operatorgroup: - notownnamespace: true - create: true - loki-operator: enabled: false syncwave: '0' @@ -92,6 +111,7 @@ helper-operator: operatorgroup: create: true +# @ignore helper-status-checker: enabled: false