diff --git a/install/kots/charts/fluent-bit/Chart.yaml b/install/kots/charts/fluent-bit/Chart.yaml new file mode 100644 index 00000000000000..27471f414e1fd0 --- /dev/null +++ b/install/kots/charts/fluent-bit/Chart.yaml @@ -0,0 +1,11 @@ +# Copyright (c) 2022 Gitpod GmbH. All rights reserved. +# Licensed under the MIT License. See License-MIT.txt in the project root for license information. + +apiVersion: v2 +description: Gitpod fluent-bit +name: fluent-bit +version: 0.20.2 +dependencies: + - name: fluent-bit + version: 0.20.2 + repository: https://fluent.github.io/helm-charts diff --git a/install/kots/manifests/gitpod-log-collector.yaml b/install/kots/manifests/gitpod-log-collector.yaml new file mode 100644 index 00000000000000..1325899b2b73ff --- /dev/null +++ b/install/kots/manifests/gitpod-log-collector.yaml @@ -0,0 +1,84 @@ +# Copyright (c) 2022 Gitpod GmbH. All rights reserved. +# Licensed under the MIT License. See License-MIT.txt in the project root for license information. + +apiVersion: kots.io/v1beta1 +kind: HelmChart +metadata: + name: fluent-bit +spec: + chart: + name: fluent-bit + chartVersion: 0.20.2 + helmVersion: v3 + useHelmInstall: true + weight: 10 + values: + fluent-bit: + extraVolumes: + - name: collector + hostPath: + path: /gitpod + type: DirectoryOrCreate + + extraVolumeMounts: + - name: collector + mountPath: /gitpod + + extraContainers: + - name: kots + image: busybox:1 + command: + - sh + - -c + args: + - while true; do echo "waiting" && sleep 60; done + volumeMounts: + - name: collector + mountPath: /gitpod + readOnly: true + + labels: + app: gitpod + component: gitpod-log-collector + + podLabels: + app: gitpod + component: gitpod-log-collector + + # Config requires four space indentations + config: + inputs: | + [INPUT] + Name tail + Path /var/log/containers/*.log + Parser docker + Tag . + Tag_Regex (?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?[^_]+)_(?.+)- + Skip_Long_Lines On + + filters: | + [FILTER] + Name stdout + + outputs: | + [OUTPUT] + Name file + Match imagebuild* + Mkdir true + Path /gitpod/log-collector + Format plain + + [OUTPUT] + Name file + Match installer* + Mkdir true + Path /gitpod/log-collector + Format plain + + # Workspaces + [OUTPUT] + Name file + Match ws*.workspace + Mkdir true + Path /gitpod/log-collector + Format plain diff --git a/install/kots/manifests/kots-app.yaml b/install/kots/manifests/kots-app.yaml index 0d2674e2d5c530..01291338644717 100644 --- a/install/kots/manifests/kots-app.yaml +++ b/install/kots/manifests/kots-app.yaml @@ -24,3 +24,6 @@ spec: - deployment/ws-manager-bridge - deployment/ws-proxy - service/proxy + additionalImages: + - cr.fluentbit.io/fluent/fluent-bit:1.9.4 # Defined by Fluent Bit Helm chart + - busybox:1 # Used to pull log files to pull from Fluent Bit, which doesn't container tar binary diff --git a/install/kots/manifests/kots-support-bundle.yaml b/install/kots/manifests/kots-support-bundle.yaml index d3e6bec9050912..fd2bb794c2f82c 100644 --- a/install/kots/manifests/kots-support-bundle.yaml +++ b/install/kots/manifests/kots-support-bundle.yaml @@ -38,12 +38,20 @@ spec: - clusterInfo: {} - clusterResources: {} - logs: + name: logs selector: - app=gitpod namespace: '{{repl Namespace }}' limits: maxAge: 720h maxLines: 10000 + - copy: + name: log-collector + selector: + - component=gitpod-log-collector + namespace: '{{repl Namespace }}' + containerPath: /gitpod/log-collector + containerName: kots - configMap: selector: - app=gitpod