logging-operator

by joaquinito2051

Helm chartv6.7.0App 6.7.0

Logging operator for Kubernetes based on Fluentd and Fluentbit.

About this chart

logging-operator

Logging operator for Kubernetes based on Fluentd and Fluentbit.

Homepage: https://kube-logging.github.io

TL;DR;

helm install --generate-name --wait oci://ghcr.io/kube-logging/helm-charts/logging-operator

or to install with a specific version:

helm install --generate-name --wait oci://ghcr.io/kube-logging/helm-charts/logging-operator --version $VERSION

Introduction

This chart bootstraps a Logging operator deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.19+

Installing CRDs

Use createCustomResource=false with Helm v3 to avoid trying to create CRDs from the crds folder and from templates at the same time.

Values

KeyTypeDefaultDescription
replicaCountint1
image.repositorystring"ghcr.io/kube-logging/logging-operator"Name of the image repository to pull the container image from.
image.tagstring""Image tag override for the default value (chart appVersion).
image.pullPolicystring"IfNotPresent"Image pull policy for updating already existing images on a node.
envlist[]
volumeslist[]
volumeMountslist[]
extraArgs[0]string"-enable-leader-election=true"
imagePullSecretslist[]
nameOverridestring""A name in place of the chart name for app: labels.
fullnameOverridestring""A name to substitute for the full names of resources.
namespaceOverridestring""A namespace override for the app.
annotationsobject{}Define annotations for logging-operator pods.
createCustomResourceboolfalseDeploy CRDs used by Logging operator.
logging-operator-crds.installboolfalseToggle to install and upgrade CRDs from a subchart. Make sure to use it with --skip-crds to avoid conflicts. More info about limitations on CRDs in Helm 3
logging-operator-crds.annotationsobject{}Annotations to be added to all CRDs
telemetry-controller.installboolfalseToggle to install and upgrade Telemetry Controller from a subchart.
http.portint8080HTTP listen port number.
http.serviceobject{"annotations":{},"clusterIP":"None","labels":{},"type":"ClusterIP"}Service definition for query http service.
rbac.enabledbooltrueCreate rbac service account and roles.
rbac.retainOnDeleteboolfalseKeep the operators RBAC resources after the operator is deleted to allow removing pending finalizers.
rbac.createAggregatedViewClusterRoleboolfalseCreate ClusterRole that extend the existing view ClusterRole to interact with logging-operator CRDs # Ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles
rbac.createAggregatedEditClusterRolebooltrueCreate ClusterRole that extend the existing edit ClusterRole to interact with logging-operator CRDs # Ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles
rbac.createAggregatedAdminClusterRolebooltrueCreate ClusterRole that extend the existing admin ClusterRole to interact with logging-operator CRDs # Ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles
monitoring.serviceMonitor.enabledboolfalseCreate a Prometheus Operator ServiceMonitor object.
monitoring.serviceMonitor.additionalLabelsobject{}
monitoring.serviceMonitor.metricRelabelingslist[]
monitoring.serviceMonitor.relabelingslist[]
podSecurityContextobject{}Pod SecurityContext for Logging operator. More info # SecurityContext holds pod-level security attributes and common container settings. # This defaults to non root user with uid 1000 and gid 2000. *v1.PodSecurityContext false # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContextobject{}Container SecurityContext for Logging operator. More info
priorityClassNamestringnilOperator priorityClassName.
serviceAccount.annotationsobject{}Define annotations for logging-operator ServiceAccount.
resourcesobject{}CPU/Memory resource requests/limits
nodeSelectorobject{}
tolerationslist[]Node Tolerations
affinityobject{}Node Affinity
topologySpreadConstraintslist[]Pod Topology Spread Constraints
strategyobject{}Deployment Strategy
podLabelsobject{}Define which Nodes the Pods are scheduled on.
logging.enabledboolfalseLogging resources are disabled by default
logging.loggingRefstring""Reference to the logging system. Each of the loggingRefs can manage a fluentbit daemonset and a fluentd statefulset.
logging.flowConfigCheckDisabledboolfalseDisable configuration check before applying new fluentd configuration.
logging.skipInvalidResourcesboolfalseWhether to skip invalid Flow and ClusterFlow resources
logging.flowConfigOverridestring""Override generated config. This is a raw configuration string for troubleshooting purposes.
logging.fluentbitDisabledboolfalseFlag to disable fluentbit completely
logging.fluentbitobject{}Fluent-bit configurations https://kube-logging.github.io/docs/configuration/crds/v1beta1/fluentbit_types/
logging.fluentdDisabledboolfalseFlag to disable fluentd completely
logging.fluentdConfigobject{"create":false}Create a FluentdConfig as a separate custom resource. Default is false, which means that the fluentd configuration will be generated as part of the Logging custom resource if fluentd is enabled. Setting this to true will create a separate FluentdConfig custom resource with the same name as the Logging resource.
logging.fluentdobject{}Fluentd configurations https://kube-logging.github.io/docs/configuration/crds/v1beta1/fluentd_types/
logging.syslogNGobject{}Syslog-NG statefulset configuration
logging.defaultFlowobject{}Default flow for unmatched logs. This Flow configuration collects all logs that didn’t match any other Flow.
logging.errorOutputRefstring""GlobalOutput name to flush ERROR events to
logging.globalFilterslist[]Global filters to apply on logs before any match or filter mechanism.
logging.watchNamespaceslist[]Limit namespaces to watch Flow and Output custom resources.
logging.watchNamespaceSelectorobject{}Limit namespaces to watch Flow and Output custom resources.
logging.clusterDomainstring"cluster.local."Cluster domain name to be used when templating URLs to services
logging.controlNamespacestring""Namespace for cluster wide configuration resources like ClusterFlow and ClusterOutput. This should be a protected namespace from regular users. Resources like fluentbit and fluentd will run in this namespace as well.
logging.fluentBitAgentNamespacestring""Namespace to deploy FluentBit resources into. If empty, defaults to controlNamespace for backward compatibility.
logging.allowClusterResourcesFromAllNamespacesboolfalseAllow configuration of cluster resources from any namespace. Mutually exclusive with ControlNamespace restriction of Cluster resources
logging.configCheckobject{}configCheck provides possibility for timeout-based configuration checks https://kube-logging.dev/docs/whats-new/#timeout-based-configuration-checks
logging.enableRecreateWorkloadOnImmutableFieldChangeboolfalseEnableRecreateWorkloadOnImmutableFieldChange enables the operator to recreate the fluentbit daemonset and the fluentd statefulset (and possibly other resource in the future) in case there is a change in an immutable field that otherwise couldn’t be managed with a simple update.
logging.enableDockerParserCompatibilityForCRIboolfalseEnableDockerParserCompatibilityForCRI enables Docker log format compatibility for CRI workloads.
logging.clusterFlowslist[]ClusterFlows to deploy
logging.clusterOutputslist[]ClusterOutputs to deploy
logging.eventTailer.enabledboolfalseEnable EventTailer
logging.eventTailer.namestring"event-tailer"Name of the EventTailer resource
logging.eventTailer.image.repositorystring"ghcr.io/kube-logging/eventrouter"Repository of the EventTailer image
logging.eventTailer.image.tagstring"1.0.0"Tag of the EventTailer image
logging.eventTailer.image.pullPolicystring"IfNotPresent"Image pull policy for the EventTailer image
logging.eventTailer.image.imagePullSecretslist[]Image pull secrets for the EventTailer image
logging.eventTailer.pvc.enabledbooltrueEnable PVC for position storage
logging.eventTailer.pvc.accessModeslist["ReadWriteOnce"]Access modes for the PVC
logging.eventTailer.pvc.volumeModestring"Filesystem"Volume mode for the PVC
logging.eventTailer.pvc.storagestring"1Gi"Storage size for the PVC
logging.eventTailer.pvc.storageClassNamestring""Storage class name for the PVC. If not set, the default storage class will be used
logging.eventTailer.workloadMetaOverridesobject{}workloadMetaOverrides allows adding labels and annotations to the EventTailer workload
logging.eventTailer.workloadOverridesobject{}workloadOverrides allows customization of the EventTailer workload (e.g., affinity, tolerations, resources)
logging.eventTailer.containerOverridesobject{}containerOverrides allows customization of the EventTailer container (e.g., resources, env vars)
logging.hostTailers.enabledboolfalseEnable all hostTailers
logging.hostTailers.instanceslist[]List of hostTailers configurations
testReceiver.enabledboolfalse
testReceiver.imagestring"fluent/fluent-bit"
testReceiver.pullPolicystring"IfNotPresent"
testReceiver.portint8080
testReceiver.args[0]string"-i"
testReceiver.args[1]string"http"
testReceiver.args[2]string"-p"
testReceiver.args[3]string"port=8080"
testReceiver.args[4]string"-o"
testReceiver.args[5]string"stdout"
testReceiver.resources.limits.cpustring"100m"
testReceiver.resources.limits.memorystring"50Mi"
testReceiver.resources.requests.cpustring"20m"
testReceiver.resources.requests.memorystring"25Mi"
extraManifestslist[]Extra manifests to deploy as an array

Installing Fluentd and Fluent-bit via logging

The chart does not install logging resource to deploy Fluentd (or Syslog-ng) and Fluent-bit on the cluster by default, but it can be enabled by setting the logging.enabled value to true.

Deploy logging-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has logging-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartlogging-operator is pinned at v6.7.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply