From 523851465279221865dc0582a6d679c2be8b1d85 Mon Sep 17 00:00:00 2001 From: Sanya Kochhar <42152676+SanyaKochhar@users.noreply.github.com> Date: Mon, 23 Nov 2020 14:28:16 -0500 Subject: [PATCH] Fluent Bit: update charts and schema for fluent bit variables (#2107) Signed-off-by: Sanya Kochhar --- charts/osm/README.md | 6 + charts/osm/templates/fluentbit-configmap.yaml | 8 +- charts/osm/templates/osm-deployment.yaml | 6 +- charts/osm/values.schema.json | 113 ++++++++++++++---- charts/osm/values.yaml | 8 +- 5 files changed, 110 insertions(+), 31 deletions(-) diff --git a/charts/osm/README.md b/charts/osm/README.md index f2bc079e27..2ef5920226 100644 --- a/charts/osm/README.md +++ b/charts/osm/README.md @@ -23,6 +23,12 @@ A Helm chart to install the OSM control plane on Kubernetes | OpenServiceMesh.deployPrometheus | bool | `false` | | | OpenServiceMesh.enablePrometheusScraping | bool | `true` | Cannot be false if `deployPrometheus` is true | | OpenServiceMesh.envoyLogLevel | string | `"error"` | | +| OpenServiceMesh.fluentBit.name | string | `"fluentbit-logger"` | | +| OpenServiceMesh.fluentBit.registry | string | `"fluent"` | | +| OpenServiceMesh.fluentBit.tag | string | `"1.6.4"` | | +| OpenServiceMesh.fluentBit.pullPolicy | string | `"IfNotPresent"` | | +| OpenServiceMesh.fluentBit.defaultOutput | string | `"stdout"` | | +| OpenServiceMesh.fluentBit.allowCustomOutput | bool | `"true"` | | | OpenServiceMesh.grafana.port | int | `3000` | | | OpenServiceMesh.image.pullPolicy | string | `"IfNotPresent"` | | | OpenServiceMesh.image.registry | string | `"openservicemesh"` | | diff --git a/charts/osm/templates/fluentbit-configmap.yaml b/charts/osm/templates/fluentbit-configmap.yaml index a03fcf08fd..001dc49507 100644 --- a/charts/osm/templates/fluentbit-configmap.yaml +++ b/charts/osm/templates/fluentbit-configmap.yaml @@ -21,11 +21,11 @@ data: match * regex message /"level":"error"/ [OUTPUT] - Name {{ .Values.OpenServiceMesh.fluentbitOutput }} + Name {{ .Values.OpenServiceMesh.fluentBit.defaultOutput }} Match * - {{- if not .Values.OpenServiceMesh.customLogAnalyticsWorkspace }} - Customer_ID {{ .Values.OpenServiceMesh.customerID }} - Shared_Key {{ .Values.OpenServiceMesh.sharedKey }} + {{- if not .Values.OpenServiceMesh.fluentBit.allowCustomOutput }} + Customer_ID {{ .Values.OpenServiceMesh.fluentBit.workspaceID }} + Shared_Key {{ .Values.OpenServiceMesh.fluentBit.primaryKey }} {{- end }} parser.conf: |- diff --git a/charts/osm/templates/osm-deployment.yaml b/charts/osm/templates/osm-deployment.yaml index f9fd30c43f..dfd16f5d68 100644 --- a/charts/osm/templates/osm-deployment.yaml +++ b/charts/osm/templates/osm-deployment.yaml @@ -76,9 +76,9 @@ spec: fieldRef: fieldPath: metadata.name {{- if .Values.OpenServiceMesh.enableFluentbit }} - - name: {{ .Values.OpenServiceMesh.fluentBitImage.name }} - image: {{ .Values.OpenServiceMesh.fluentBitImage.registry }}/fluent-bit:{{ .Values.OpenServiceMesh.fluentBitImage.tag }} - imagePullPolicy: {{ .Values.OpenServiceMesh.fluentBitImage.pullPolicy }} + - name: {{ .Values.OpenServiceMesh.fluentBit.name }} + image: {{ .Values.OpenServiceMesh.fluentBit.registry }}/fluent-bit:{{ .Values.OpenServiceMesh.fluentBit.tag }} + imagePullPolicy: {{ .Values.OpenServiceMesh.fluentBit.pullPolicy }} volumeMounts: - name: config mountPath: /fluent-bit/etc diff --git a/charts/osm/values.schema.json b/charts/osm/values.schema.json index 37da62d7d3..b4d3b01aa7 100644 --- a/charts/osm/values.schema.json +++ b/charts/osm/values.schema.json @@ -25,15 +25,15 @@ "deployPrometheus", "enablePrometheusScraping", "deployGrafana", + "enableFluentbit", + "fluentBit", "meshName", "useHTTPSIngress", "envoyLogLevel", "enforceSingleMesh", "deployJaeger", "tracing", - "fluentbitOutput", "webhookConfigNamePrefix", - "customLogAnalyticsWorkspace", "connectVault" ], "properties": { @@ -195,6 +195,97 @@ false ] }, + "enableFluentbit": { + "$id": "#/properties/OpenServiceMesh/properties/enableFluentbit", + "type": "boolean", + "title": "The enableFluentbit schema", + "description": "Indicates whether Fluent Bit log forwarding should be enabled", + "examples": [ + false + ] + }, + "fluentBit": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit", + "type": "object", + "title": "The Fluent Bit schema", + "description": "The default details of the Fluent Bit sidecar if enabled.", + "examples": [ + { + "name": "fluentbit-logger", + "registry": "fluent", + "tag": "1.6.4", + "pullPolicy": "IfNotPresent", + "defaultOutput": "stdout", + "allowCustomOutput": "true" + } + ], + "required": [ + "name", + "registry", + "tag", + "pullPolicy", + "defaultOutput", + "allowCustomOutput" + ], + "properties": { + "name": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit/properties/name", + "type": "string", + "title": "The name schema", + "description": "The name of the Fluent Bit container", + "examples": [ + "fluentbit-logger" + ] + }, + "registry": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit/properties/registry", + "type": "string", + "title": "The registry schema", + "description": "The registry of the image to run.", + "examples": [ + "fluent" + ] + }, + "tag": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit/properties/tag", + "type": "string", + "title": "The tag schema", + "description": "The image tag to run.", + "examples": [ + "1.5" + ] + }, + "pullPolicy": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit/properties/pullPolicy", + "type": "string", + "title": "The pullPolicy schema", + "description": "The image pull policy.", + "pattern": "^(Always|Never|IfNotPresent)$", + "examples": [ + "IfNotPresent" + ] + }, + "defaultOutput": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit/properties/defaultOutput", + "type": "string", + "title": "The default output schema for Fluent Bit", + "description": "The default log forwarding destination for Fluent Bit", + "examples": [ + "stdout" + ] + }, + "allowCustomOutput": { + "$id": "#/properties/OpenServiceMesh/properties/fluentBit/properties/allowCustomOutput", + "type": "boolean", + "title": "The allowCustomOutput output schema", + "description": "Indicates whether users can provide their own output plugin", + "examples": [ + true + ] + } + }, + "additionalProperties": true + }, "meshName": { "$id": "#/properties/OpenServiceMesh/properties/meshName", "type": "string", @@ -267,15 +358,6 @@ }, "additionalProperties": true }, - "fluentbitOutput": { - "$id": "#/properties/OpenServiceMesh/properties/fluentbitOutput", - "type": "string", - "title": "Fluentbit logger output location", - "description": "The log forwarding destination to be forwarded by Fluent Bit", - "examples": [ - "stdout" - ] - }, "webhookConfigNamePrefix": { "$id": "#/properties/OpenServiceMesh/properties/webhookConfigNamePrefix", "type": "string", @@ -285,15 +367,6 @@ "" ] }, - "customLogAnalyticsWorkspace": { - "$id": "#/properties/OpenServiceMesh/properties/customLogAnalyticsWorkspace", - "type": "boolean", - "title": "Custom Log Analytics Workspace", - "description": "Specifies whether users will provide their own output plugin", - "examples": [ - true - ] - }, "connectVault": { "$id": "#/properties/OpenServiceMesh/properties/connectVault", "type": "boolean", diff --git a/charts/osm/values.yaml b/charts/osm/values.yaml index 5579ef2c90..cac223e445 100644 --- a/charts/osm/values.yaml +++ b/charts/osm/values.yaml @@ -37,18 +37,18 @@ OpenServiceMesh: enablePrometheusScraping: true deployGrafana: false enableFluentbit: false - fluentBitImage: + fluentBit: name: fluentbit-logger registry: fluent - tag: 1.5 + tag: 1.5.0 pullPolicy: IfNotPresent + defaultOutput: stdout + allowCustomOutput: true meshName: osm useHTTPSIngress: false envoyLogLevel: error controllerLogLevel: trace enforceSingleMesh: false - customLogAnalyticsWorkspace: true - fluentbitOutput: stdout webhookConfigNamePrefix: osm-webhook # Set deployJaeger to true to deploy a Jaeger cluster in the