Skip to content

Commit

Permalink
add logging-operator-logging
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Feb 9, 2023
1 parent d88bb7c commit b9c9e54
Show file tree
Hide file tree
Showing 14 changed files with 542 additions and 0 deletions.
26 changes: 26 additions & 0 deletions charts/logging-operator-logging/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

ci/
README.md.gotmpl
28 changes: 28 additions & 0 deletions charts/logging-operator-logging/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v2
type: application
name: logging-operator-logging
version: 4.0.0-rc17
appVersion: 4.0.0-rc17
kubeVersion: ">=1.16.0-0"
description: A Helm chart to configure logging resource for the Logging operator.
keywords:
- logging
- fluentd
- fluentbit
home: https://kube-logging.github.io
sources:
- https://github.com/kube-logging/logging-operator
- https://github.com/kube-logging/helm-charts/tree/main/charts/logging-operator-logging
annotations:
artifacthub.io/changes: |
- kind: changed
description: Moved to to location
artifacthub.io/images: |
- name: fluent-bit
image: fluent/fluent-bit:1.9.5
- name: fluentd
image: ghcr.io/banzaicloud/fluentd:v1.14.6-alpine-5
- name: logging-operator
image: ghcr.io/kube-logging/logging-operator:4.0.0-rc19
- name: config-reloader
image: ghcr.io/banzaicloud/config-reloader:0.0.1
44 changes: 44 additions & 0 deletions charts/logging-operator-logging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# logging-operator-logging

![version: 4.0.0-rc17](https://img.shields.io/badge/version-4.0.0--rc17-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 4.0.0-rc17](https://img.shields.io/badge/app%20version-4.0.0--rc17-informational?style=flat-square) ![kube version: >=1.16.0-0](https://img.shields.io/badge/kube%20version->=1.16.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-logging--operator--logging-informational?style=flat-square)](https://artifacthub.io/packages/helm/kube-logging/logging-operator-logging)

A Helm chart to configure logging resource for the Logging operator.

**Homepage:** <https://kube-logging.github.io>

## TL;DR;

```bash
helm repo add kube-logging https://kube-logging.github.io/helm-charts
helm install --generate-name --wait kube-logging/logging-operator-logging
```

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| loggingRef | string | `""` | |
| flowConfigCheckDisabled | bool | `false` | |
| flowConfigOverride | string | `""` | |
| nameOverride | string | `""` | |
| fullnameOverride | string | `""` | |
| enableRecreateWorkloadOnImmutableFieldChange | bool | `false` | Permit deletion and recreation of resources on update of immutable field. |
| tls.enabled | bool | `true` | Enable secure connection between fluentd and fluent-bit |
| tls.fluentdSecretName | string | `""` | Specified secret name, which contain tls certs |
| tls.fluentbitSecretName | string | `""` | Specified secret name, which contain tls certs |
| tls.sharedKey | string | `""` | |
| fluentbit | object | `{}` | Fluent-bit configurations https://banzaicloud.com/docs/one-eye/logging-operator/configuration/crds/v1beta1/fluentbit_types/ |
| fluentd | object | `{}` | Fluentd configurations https://banzaicloud.com/docs/one-eye/logging-operator/configuration/crds/v1beta1/fluentd_types/ |
| nodeAgents | object | `{}` | Node agents definitions |
| skipInvalidResources | bool | `false` | Whether to skip invalid Flow and ClusterFlow resources |
| watchNamespaces | list | `[]` | Limit namespaces from where to read Flow and Output specs |
| clusterDomain | string | `"cluster.local"` | Cluster domain name to be used when templating URLs to services |
| controlNamespace | string | `""` | Control namespace that contains ClusterOutput and ClusterFlow resources |
| allowClusterResourcesFromAllNamespaces | bool | `false` | Allow configuration of cluster resources from any namespace |
| defaultFlow | object | `{}` | Default flow |
| globalFilters | list | `[]` | Global filters |
| clusterFlows | list | `[]` | ClusterFlows to deploy |
| clusterOutputs | list | `[]` | ClusterOutputs to deploy |
| eventTailer | object | `{}` | EventTailer config |
| hostTailer | object | `{}` | HostTailer config |
| scc.enabled | bool | `false` | OpenShift SecurityContextConstraints enabled |
1 change: 1 addition & 0 deletions charts/logging-operator-logging/README.md.gotmpl
Empty file.
56 changes: 56 additions & 0 deletions charts/logging-operator-logging/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "logging-operator-logging.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "logging-operator-logging.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "logging-operator-logging.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "logging-operator-logging.labels" -}}
app.kubernetes.io/name: {{ include "logging-operator-logging.name" . }}
helm.sh/chart: {{ include "logging-operator-logging.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Formats the cluster domain as a suffix, e.g.:
.Values.clusterDomain == "", returns ""
.Values.clusterDomain == "cluster.local", returns ".cluster.local"
*/}}
{{- define "logging-operator-logging.clusterDomainAsSuffix" -}}
{{- if .Values.clusterDomain -}}
{{- printf ".%s" .Values.clusterDomain -}}
{{- end -}}
{{- end -}}
12 changes: 12 additions & 0 deletions charts/logging-operator-logging/templates/clusterflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- range $clusterflow := .Values.clusterFlows }}
---
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterFlow
metadata:
name: {{ $clusterflow.name }}
namespace: {{ $.Values.controlNamespace | default $.Release.Namespace }}
labels:
{{ include "logging-operator-logging.labels" $ | indent 4 }}
spec:
{{ toYaml $clusterflow.spec | indent 2 }}
{{- end -}}
12 changes: 12 additions & 0 deletions charts/logging-operator-logging/templates/clusteroutputs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- range $clusteroutput := .Values.clusterOutputs }}
---
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterOutput
metadata:
name: {{ $clusteroutput.name }}
namespace: {{ $.Values.controlNamespace | default $.Release.Namespace }}
labels:
{{ include "logging-operator-logging.labels" $ | indent 4 }}
spec:
{{ toYaml $clusteroutput.spec | indent 2 }}
{{- end -}}
29 changes: 29 additions & 0 deletions charts/logging-operator-logging/templates/eventtailer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- with $.Values.eventTailer }}
apiVersion: logging-extensions.banzaicloud.io/v1alpha1
kind: EventTailer
metadata:
name: {{ .name | default "event-tailer" }}
spec:
controlNamespace: {{ $.Values.controlNamespace | default $.Release.Namespace }}
{{- with .workloadOverrides }}
workloadOverrides:
{{ toYaml . | indent 4 }}
{{- end }}
{{- with .containerOverrides }}
containerOverrides:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .pvc }}
positionVolume:
pvc:
spec:
accessModes: {{ .accessModes | default (list "ReadWriteOnce") }}
resources:
requests:
storage: {{ .storage | default "1Gi" }}
volumeMode: {{ .volumeMode | default "Filesystem" }}
{{- with .storageClassName }}
storageClassName: {{ . }}
{{- end }}
{{- end }}
{{- end }}
24 changes: 24 additions & 0 deletions charts/logging-operator-logging/templates/hosttailer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- with $.Values.hostTailer }}
apiVersion: logging-extensions.banzaicloud.io/v1alpha1
kind: HostTailer
metadata:
name: {{ .name | default "hosttailer" }}
spec:
enableRecreateWorkloadOnImmutableFieldChange: {{ $.Values.enableRecreateWorkloadOnImmutableFieldChange }}
{{- with .workloadOverrides }}
workloadOverrides:
{{ toYaml . | indent 4 }}
{{- end }}
{{- with .containerOverrides }}
containerOverrides:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .fileTailers }}
fileTailers:
{{ toYaml . | indent 4 }}
{{- end }}
{{- with .systemdTailers }}
systemdTailers:
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
73 changes: 73 additions & 0 deletions charts/logging-operator-logging/templates/logging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: logging.banzaicloud.io/v1beta1
kind: Logging
metadata:
name: {{ include "logging-operator-logging.name" . }}
labels:
{{ include "logging-operator-logging.labels" . | indent 4 }}
spec:
{{- with .Values.enableRecreateWorkloadOnImmutableFieldChange }}
enableRecreateWorkloadOnImmutableFieldChange: {{ . }}
{{- end}}
{{- with .Values.loggingRef }}
loggingRef: {{ . }}
{{- end }}
{{- with .Values.flowConfigCheckDisabled }}
flowConfigCheckDisabled: {{ . }}
{{- end }}
{{- with .Values.flowConfigOverride }}
flowConfigOverride: {{ . }}
{{- end }}
{{- with .Values.allowClusterResourcesFromAllNamespaces }}
allowClusterResourcesFromAllNamespaces: {{ . }}
{{- end }}
{{- with .Values.skipInvalidResources }}
skipInvalidResources: {{ . }}
{{- end }}
{{- if .Values.watchNamespaces }}
watchNamespaces:
{{ toYaml .Values.watchNamespaces | indent 4 }}
{{- end }}
clusterDomain: {{ .Values.clusterDomain }}
controlNamespace: {{ .Values.controlNamespace | default .Release.Namespace }}
{{- if .Values.defaultFlow }}
defaultFlow:
{{ toYaml .Values.defaultFlow | indent 4 }}
{{- end }}
{{- if .Values.globalFilters }}
globalFilters:
{{ toYaml .Values.globalFilters | indent 4 }}
{{- end }}
{{- if or .Values.tls.enabled .Values.fluentd }}
fluentd:
{{- if .Values.tls.enabled }}
tls:
enabled: true
secretName: {{ .Values.tls.fluentdSecretName | default (printf "%s-%s" (include "logging-operator-logging.name" . ) "fluentd-tls" ) }}
sharedKey: "{{ .Values.tls.sharedKey }}"
{{- end }}
{{- if .Values.fluentd }}
{{ toYaml .Values.fluentd | indent 4 }}
{{- end }}
{{- else }}
fluentd: {}
{{- end }}
{{- if or .Values.tls.enabled .Values.fluentbit }}
fluentbit:
{{- if .Values.tls.enabled }}
tls:
enabled: true
secretName: {{ .Values.tls.fluentbitSecretName | default (printf "%s-%s" (include "logging-operator-logging.name" . ) "fluentbit-tls" ) }}
sharedKey: "{{ .Values.tls.sharedKey }}"
{{- end }}
{{- if .Values.fluentbit }}
{{ toYaml .Values.fluentbit | indent 4 }}
{{- end }}
{{- else }}
fluentbit: {}
{{- end }}
{{- if .Values.nodeAgents }}
nodeAgents:
{{ toYaml .Values.nodeAgents | indent 4 }}
{{- else }}
nodeAgents: []
{{- end }}
63 changes: 63 additions & 0 deletions charts/logging-operator-logging/templates/scc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{- if .Values.scc.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "logging-operator-logging.name" . }}-scc-privileged
labels:
{{ include "logging-operator-logging.labels" . | indent 4 }}
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- privileged
resources:
- securitycontextconstraints
verbs:
- use
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "logging-operator-logging.name" . }}-scc-privileged
labels:
{{ include "logging-operator-logging.labels" . | indent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "logging-operator-logging.name" . }}-fluentbit
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "logging-operator-logging.name" . }}-scc-privileged
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "logging-operator-logging.name" . }}-scc-anyuid
labels:
{{ include "logging-operator-logging.labels" . | indent 4 }}
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- anyuid
resources:
- securitycontextconstraints
verbs:
- use
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "logging-operator-logging.name" . }}-scc-anyuid
labels:
{{ include "logging-operator-logging.labels" . | indent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "logging-operator-logging.name" . }}-fluentd
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "logging-operator-logging.name" . }}-scc-anyuid
{{- end }}
Loading

0 comments on commit b9c9e54

Please sign in to comment.