From c236666b6593123f062e166384589c5c5b428d55 Mon Sep 17 00:00:00 2001 From: Aiwantaozi Date: Fri, 12 Jul 2019 16:07:09 +0800 Subject: [PATCH] Update logging chart to support both windows and linux Changes: 1. fluentd: add sub charts fluentd-linux and fluentd-:windows 2. log-aggregator: remove useless service account 3. log-aggregator: add sub charts log-aggregator-linux and log-aggregator-windows --- charts/rancher-logging/0.1.2/Chart.yaml | 2 +- .../0.1.2/charts/fluentd-tester/Chart.yaml | 4 +- .../fluentd-tester/templates/deployment.yaml | 3 +- .../0.1.2/charts/fluentd-tester/values.yaml | 2 +- .../0.1.2/charts/fluentd/Chart.yaml | 4 +- .../fluentd/charts/fluentd-linux/Chart.yaml | 17 ++ .../fluentd-linux}/templates/daemonset.yaml | 5 +- .../fluentd/charts/fluentd-linux/values.yaml | 56 ++++++ .../fluentd/charts/fluentd-windows/Chart.yaml | 17 ++ .../fluentd-windows/templates/daemonset.yaml | 166 ++++++++++++++++++ .../charts/fluentd-windows/values.yaml | 50 ++++++ .../0.1.2/charts/fluentd/requirements.yaml | 10 ++ .../0.1.2/charts/fluentd/values.yaml | 46 +---- .../0.1.2/charts/log-aggregator/Chart.yaml | 2 +- .../charts/log-aggregator-linux/Chart.yaml | 15 ++ .../templates/daemonset.yaml} | 6 +- .../charts/log-aggregator-linux/values.yaml | 27 +++ .../charts/log-aggregator-windows/Chart.yaml | 15 ++ .../templates/daemonset.yaml | 59 +++++++ .../charts/log-aggregator-windows/values.yaml | 27 +++ .../charts/log-aggregator/requirements.yaml | 10 ++ .../log-aggregator/templates/_helpers.tpl | 11 -- .../templates/serviceaccount.yaml | 13 -- .../0.1.2/charts/log-aggregator/values.yaml | 34 +--- .../rancher-logging/0.1.2/requirements.yaml | 6 +- .../0.1.2/templates/_helpers.tpl | 16 ++ charts/rancher-logging/0.1.2/values.yaml | 1 - 27 files changed, 512 insertions(+), 112 deletions(-) create mode 100644 charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/Chart.yaml rename charts/rancher-logging/0.1.2/charts/fluentd/{ => charts/fluentd-linux}/templates/daemonset.yaml (98%) create mode 100644 charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/values.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/Chart.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/templates/daemonset.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/values.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/fluentd/requirements.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/Chart.yaml rename charts/rancher-logging/0.1.2/charts/log-aggregator/{templates/log-aggregator.yaml => charts/log-aggregator-linux/templates/daemonset.yaml} (93%) create mode 100755 charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/values.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/Chart.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/templates/daemonset.yaml create mode 100755 charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/values.yaml create mode 100644 charts/rancher-logging/0.1.2/charts/log-aggregator/requirements.yaml delete mode 100644 charts/rancher-logging/0.1.2/charts/log-aggregator/templates/serviceaccount.yaml diff --git a/charts/rancher-logging/0.1.2/Chart.yaml b/charts/rancher-logging/0.1.2/Chart.yaml index 13fc2df..11c5052 100644 --- a/charts/rancher-logging/0.1.2/Chart.yaml +++ b/charts/rancher-logging/0.1.2/Chart.yaml @@ -3,7 +3,7 @@ description: Rancher logging helm chart to support logging function in rancher icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png name: rancher-logging version: 0.1.2 -appVersion: v1.1.3 +appVersion: 1.6.3 home: https://www.fluentd.org/ sources: - https://www.fluentd.org/ diff --git a/charts/rancher-logging/0.1.2/charts/fluentd-tester/Chart.yaml b/charts/rancher-logging/0.1.2/charts/fluentd-tester/Chart.yaml index d9878e6..cec6ab7 100644 --- a/charts/rancher-logging/0.1.2/charts/fluentd-tester/Chart.yaml +++ b/charts/rancher-logging/0.1.2/charts/fluentd-tester/Chart.yaml @@ -1,6 +1,6 @@ name: fluentd-tester -version: 0.0.1 -appVersion: 1.1.3 +version: 0.0.2 +appVersion: 1.6.3 home: https://www.fluentd.org/ description: A Fluentd Test Helm chart for validate fluentd config icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png diff --git a/charts/rancher-logging/0.1.2/charts/fluentd-tester/templates/deployment.yaml b/charts/rancher-logging/0.1.2/charts/fluentd-tester/templates/deployment.yaml index 9b79db7..2a701a9 100644 --- a/charts/rancher-logging/0.1.2/charts/fluentd-tester/templates/deployment.yaml +++ b/charts/rancher-logging/0.1.2/charts/fluentd-tester/templates/deployment.yaml @@ -68,8 +68,9 @@ spec: {{- if .Values.extraVolumes }} {{ toYaml .Values.extraVolumes | indent 6 }} {{- end }} -{{- if .Values.nodeSelector }} nodeSelector: +{{- include "linux-node-selector" . | nindent 8 }} +{{- if .Values.nodeSelector }} {{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} {{- if .Values.tolerations }} diff --git a/charts/rancher-logging/0.1.2/charts/fluentd-tester/values.yaml b/charts/rancher-logging/0.1.2/charts/fluentd-tester/values.yaml index 9a622c8..7c53809 100644 --- a/charts/rancher-logging/0.1.2/charts/fluentd-tester/values.yaml +++ b/charts/rancher-logging/0.1.2/charts/fluentd-tester/values.yaml @@ -2,7 +2,7 @@ labels: {} image: repository: rancher/fluentd - tag: v0.1.14 + tag: v0.1.16 pullPolicy: IfNotPresent resources: {} diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/Chart.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/Chart.yaml index a0b8888..552f21b 100644 --- a/charts/rancher-logging/0.1.2/charts/fluentd/Chart.yaml +++ b/charts/rancher-logging/0.1.2/charts/fluentd/Chart.yaml @@ -1,6 +1,6 @@ name: fluentd -version: 0.0.1 -appVersion: 1.1.3 +version: 0.0.2 +appVersion: 1.6.3 home: https://www.fluentd.org/ description: A Fluentd Helm chart for Rancher system logging icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/Chart.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/Chart.yaml new file mode 100644 index 0000000..285174d --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/Chart.yaml @@ -0,0 +1,17 @@ +name: fluentd-linux +version: 0.0.2 +appVersion: 1.6.3 +home: https://www.fluentd.org/ +description: A Fluentd Helm chart for Rancher system logging +icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png +keywords: +- fluentd +- rancher +- logging +- linux +sources: +- https://github.com/helm/charts/stable/fluentd-elasticsearch +maintainers: +- name: michelia + email: support@rancher.com +engine: gotpl diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/templates/daemonset.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/templates/daemonset.yaml similarity index 98% rename from charts/rancher-logging/0.1.2/charts/fluentd/templates/daemonset.yaml rename to charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/templates/daemonset.yaml index 970d650..941fcde 100644 --- a/charts/rancher-logging/0.1.2/charts/fluentd/templates/daemonset.yaml +++ b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/templates/daemonset.yaml @@ -1,7 +1,7 @@ apiVersion: {{ template "daemonset_api_version" . }} kind: DaemonSet metadata: - name: {{ template "fluentd.fullname" . }} + name: {{ template "fluentd.fullname" . }}-linux labels: app: {{ template "fluentd.name" . }} chart: {{ template "fluentd.version" . }} @@ -180,8 +180,9 @@ spec: {{- if .Values.extraVolumes }} {{ toYaml .Values.extraVolumes | indent 6 }} {{- end }} -{{- if .Values.nodeSelector }} nodeSelector: +{{- include "linux-node-selector" . | nindent 8 }} +{{- if .Values.nodeSelector }} {{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} {{- if .Values.tolerations }} diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/values.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/values.yaml new file mode 100644 index 0000000..49753b8 --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-linux/values.yaml @@ -0,0 +1,56 @@ +nameOverride: fluentd +labels: {} + +image: + repository: rancher/fluentd + tag: v0.1.16 + pullPolicy: IfNotPresent + +resources: {} + # limits: + # cpu: 100m + # memory: 500Mi + # requests: + # cpu: 100m + # memory: 200Mi +# env: + +command: '["fluentd", "-c", "/fluentd/etc/config/entry/fluent.conf"]' + +livenessProbe: + enabled: true + +annotations: {} + +# updateStrategy: +# type: RollingUpdate + +tolerations: + - effect: NoSchedule + operator: Exists + +nodeSelector: {} + +service: + type: ClusterIP + ports: + - name: metric + port: 24231 + targetPort: metric + +cluster: + dockerRoot: /var/lib/docker + +service: + ports: + - name: metric + port: 24231 + targetPort: metric + +configmapReload: + name: reloader + image: + repository: rancher/configmap-reload + tag: v0.3.0-rancher2 + pullPolicy: IfNotPresent + resources: {} \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/Chart.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/Chart.yaml new file mode 100644 index 0000000..4e3ccdd --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/Chart.yaml @@ -0,0 +1,17 @@ +name: fluentd-windows +version: 0.0.1 +appVersion: 1.6.3 +home: https://www.fluentd.org/ +description: A Fluentd Helm chart for Rancher system logging +icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png +keywords: +- fluentd +- rancher +- logging +- windows +sources: +- https://github.com/helm/charts/stable/fluentd-elasticsearch +maintainers: +- name: michelia + email: support@rancher.com +engine: gotpl diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/templates/daemonset.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/templates/daemonset.yaml new file mode 100644 index 0000000..33cd9f2 --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/templates/daemonset.yaml @@ -0,0 +1,166 @@ +{{- if .Values.enabled -}} +apiVersion: {{ template "daemonset_api_version" . }} +kind: DaemonSet +metadata: + name: {{ template "fluentd.fullname" . }}-windows + labels: + app: {{ template "fluentd.name" . }} + chart: {{ template "fluentd.version" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.labels }} +{{ toYaml .Values.labels | indent 4 }} +{{- end }} +spec: +{{- if .Values.updateStrategy }} + updateStrategy: +{{ toYaml .Values.updateStrategy | indent 4 }} +{{- end }} + selector: + matchLabels: + app: {{ template "fluentd.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "fluentd.name" . }} + chart: {{ template "fluentd.version" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- if .Values.labels }} + {{ toYaml .Values.labels | indent 4 }} + {{- end }} +{{- if .Values.annotations }} +{{ toYaml .Values.annotations | indent 8 }} +{{- end }} + spec: + serviceAccountName: {{ template "fluentd.fullname" . }} + initContainers: + - name: init-{{ template "fluentd.fullname" . }} + image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} + command: + - 'powershell' + - '-command' + - 'mkdir -p /var/lib/rancher/fluentd/log' + volumeMounts: + - mountPath: /var/lib/rancher + name: rancher + containers: + - name: {{ template "fluentd.fullname" . }} + image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + {{- if .Values.command }} + command: {{ .Values.command }} + {{ end }} + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + resources: +{{ toYaml .Values.resources | indent 10 }} + volumeMounts: + - mountPath: /fluentd/etc/config/precan + name: config + - mountPath: /fluentd/etc/config/entry + name: entry + - mountPath: /fluentd/etc/config/ssl + name: ssl + - mountPath: {{ .Values.cluster.dockerRoot }} + name: dockerroot + - mountPath: /var/log/containers + name: varlogcontainers + - mountPath: /var/log/pods + name: varlogpods + - mountPath: /var/lib/rancher/rke/log + name: rkelog + - mountPath: /fluentd/log + name: fluentdlog +{{- if .Values.extraVolumeMounts }} +{{ toYaml .Values.extraVolumeMounts | indent 8 }} +{{- end }} + ports: +{{- range $port := .Values.service.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.port }} +{{- if $port.protocol }} + protocol: {{ $port.protocol }} +{{- end }} +{{- end }} +{{- if .Values.livenessProbe.enabled }} + # use metrics endpoint to monitor liveness + livenessProbe: + httpGet: + path: /metrics + port: 24231 + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 60 + timeoutSeconds: 3 + failureThreshold: 3 + successThreshold: 1 +{{- end }} + - name: {{ template "fluentd.fullname" . }}-{{ .Values.configmapReload.name }} + image: {{ template "system_default_registry" . }}{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }} + imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}" + args: + - --volume-dir=/fluentd/etc/config/precan + - --volume-dir=/fluentd/etc/config/ssl + - --volume-dir=/fluentd/etc/config/entry + - --webhook-method=GET + - --webhook-url=http://127.0.0.1:24444/api/config.reload + resources: + {{ toYaml .Values.configmapReload.resources | indent 12 }} + volumeMounts: + - mountPath: /fluentd/etc/config/precan + name: config + - mountPath: /fluentd/etc/config/entry + name: entry + - mountPath: /fluentd/etc/config/ssl + name: ssl + terminationGracePeriodSeconds: 30 + volumes: + - hostPath: + path: {{ .Values.cluster.dockerRoot }} + name: dockerroot + - hostPath: + path: /var/log/containers + name: varlogcontainers + - hostPath: + path: /var/log/pods + name: varlogpods + - hostPath: + path: /var/lib/rancher/rke/log + name: rkelog + - hostPath: + path: /var/lib/rancher/fluentd/log + name: fluentdlog + - hostPath: + path: /var/lib/rancher + name: rancher + - name: config + secret: + secretName: {{ template "fluentd.fullname" . }} + - name: entry + secret: + secretName: {{ template "fluentd.fullname" . }}-entry + - name: ssl + secret: + secretName: {{ template "fluentd.fullname" . }}-ssl +{{- if .Values.extraVolumes }} +{{ toYaml .Values.extraVolumes | indent 6 }} +{{- end }} + nodeSelector: +{{- include "windows-node-selector" . | nindent 8 }} +{{- if .Values.nodeSelector }} +{{ toYaml .Values.nodeSelector | indent 8 }} +{{- end }} +{{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 6 }} +{{- end }} +{{- end }} diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/values.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/values.yaml new file mode 100644 index 0000000..ff8fe79 --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/fluentd/charts/fluentd-windows/values.yaml @@ -0,0 +1,50 @@ +nameOverride: fluentd +labels: {} + +image: + repository: rancher/fluentd + tag: v0.1.16 + pullPolicy: IfNotPresent + +resources: {} + # limits: + # cpu: 100m + # memory: 500Mi + # requests: + # cpu: 100m + # memory: 200Mi +# env: + +command: '["powershell", "-command", "fluentd", "-c", "/fluentd/etc/config/entry/fluent.conf"]' + +livenessProbe: + enabled: true + +annotations: {} + +# updateStrategy: +# type: RollingUpdate + +tolerations: + - effect: NoSchedule + operator: Exists + + +nodeSelector: {} + +cluster: + dockerRoot: C:\ProgramData\docker + +service: + ports: + - name: metric + port: 24231 + targetPort: metric + +configmapReload: + name: reloader + image: + repository: rancher/configmap-reload + tag: v0.3.0-rancher2 + pullPolicy: IfNotPresent + resources: {} \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/requirements.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/requirements.yaml new file mode 100644 index 0000000..2e4809a --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/fluentd/requirements.yaml @@ -0,0 +1,10 @@ +dependencies: + - name: fluentd-linux + version: 0.0.2 + condition: fluentd.fluentd-linux.enabled + repository: "file://./charts/fluentd-linux" + + - name: fluentd-windows + version: 0.0.1 + condition: fluentd.fluentd-windows.enabled + repository: "file://./charts/fluentd-windows" \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/charts/fluentd/values.yaml b/charts/rancher-logging/0.1.2/charts/fluentd/values.yaml index 4d4ae97..504a5ca 100644 --- a/charts/rancher-logging/0.1.2/charts/fluentd/values.yaml +++ b/charts/rancher-logging/0.1.2/charts/fluentd/values.yaml @@ -1,20 +1,10 @@ -labels: {} - -image: - repository: rancher/fluentd - tag: v0.1.14 - pullPolicy: IfNotPresent +fluentd-linux: + enabled: true -resources: {} - # limits: - # cpu: 100m - # memory: 500Mi - # requests: - # cpu: 100m - # memory: 200Mi -# env: +fluentd-windows: + enabled: false -command: '["fluentd", "-c", "/fluentd/etc/config/entry/fluent.conf"]' +nameOverride: fluentd rbac: create: true @@ -22,21 +12,6 @@ rbac: serviceAccount: create: true -livenessProbe: - enabled: true - -annotations: {} - -# updateStrategy: -# type: RollingUpdate - -tolerations: - - effect: NoSchedule - operator: Exists - - -nodeSelector: {} - service: type: ClusterIP ports: @@ -44,17 +19,6 @@ service: port: 24231 targetPort: metric -cluster: - dockerRoot: /var/lib/docker - -configmapReload: - name: reloader - image: - repository: rancher/jimmidyson-configmap-reload - tag: v0.2.2 - pullPolicy: IfNotPresent - resources: {} - secrets: entry: fluent.conf: |- diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/Chart.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/Chart.yaml index 6e1846d..b2edd97 100644 --- a/charts/rancher-logging/0.1.2/charts/log-aggregator/Chart.yaml +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/Chart.yaml @@ -1,5 +1,5 @@ name: log-aggregator -version: 0.0.1 +version: 0.0.2 appVersion: 0.1.4 home: https://github.com/rancher/log-aggregator description: Deploy flexvolume driver log-aggregator to collect log. diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/Chart.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/Chart.yaml new file mode 100644 index 0000000..94c6b3b --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/Chart.yaml @@ -0,0 +1,15 @@ +name: log-aggregator-linux +version: 0.0.1 +appVersion: 0.1.4 +home: https://github.com/rancher/log-aggregator +description: Deploy flexvolume driver log-aggregator to collect log. +icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png +keywords: +- fluentd +- flexvolume driver +- logging +- linux +maintainers: +- name: michelia + email: support@rancher.com +engine: gotpl diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/log-aggregator.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/templates/daemonset.yaml similarity index 93% rename from charts/rancher-logging/0.1.2/charts/log-aggregator/templates/log-aggregator.yaml rename to charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/templates/daemonset.yaml index 98cd8f2..b42b8f1 100644 --- a/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/log-aggregator.yaml +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/templates/daemonset.yaml @@ -1,7 +1,7 @@ apiVersion: {{ template "daemonset_api_version" . }} kind: DaemonSet metadata: - name: {{ template "log-aggregator.fullname" . }} + name: {{ template "log-aggregator.fullname" . }}-linux labels: app: {{ template "log-aggregator.name" . }} chart: {{ template "log-aggregator.version" . }} @@ -26,7 +26,6 @@ spec: chart: {{ template "log-aggregator.version" . }} release: {{ .Release.Name }} spec: - serviceAccountName: {{ template "log-aggregator.fullname" . }} containers: - name: log-aggregator image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} @@ -43,8 +42,9 @@ spec: resources: {{ toYaml .Values.resources | indent 10 }} terminationGracePeriodSeconds: 10 - {{- if .Values.nodeSelector }} nodeSelector: +{{- include "linux-node-selector" . | nindent 8 }} + {{- if .Values.nodeSelector }} {{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} tolerations: diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/values.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/values.yaml new file mode 100755 index 0000000..69a33d2 --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-linux/values.yaml @@ -0,0 +1,27 @@ +nameOverride: log-aggregator + +labels: {} +## Log Aggregator container image +## +image: + repository: rancher/log-aggregator + tag: v0.1.5 + +nodeSelector: {} + +# updateStrategy: +# type: RollingUpdate + +tolerations: + - effect: NoSchedule + operator: Exists + +## Resource limits & requests +## Ref: https://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: {} + # requests: + # memory: 400Mi + +## flexvolume dir +flexVolumeDir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/Chart.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/Chart.yaml new file mode 100644 index 0000000..8873489 --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/Chart.yaml @@ -0,0 +1,15 @@ +name: log-aggregator-windows +version: 0.0.1 +appVersion: 0.1.4 +home: https://github.com/rancher/log-aggregator +description: Deploy flexvolume driver log-aggregator to collect log. +icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png +keywords: +- fluentd +- flexvolume driver +- logging +- windows +maintainers: +- name: michelia + email: support@rancher.com +engine: gotpl diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/templates/daemonset.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/templates/daemonset.yaml new file mode 100644 index 0000000..cdc4a4c --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/templates/daemonset.yaml @@ -0,0 +1,59 @@ +{{- if .Values.enabled -}} +apiVersion: {{ template "daemonset_api_version" . }} +kind: DaemonSet +metadata: + name: {{ template "log-aggregator.fullname" . }}-windows + labels: + app: {{ template "log-aggregator.name" . }} + chart: {{ template "log-aggregator.version" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.labels }} +{{ toYaml .Values.labels | indent 4 }} +{{- end }} +spec: +{{- if .Values.updateStrategy }} + updateStrategy: +{{ toYaml .Values.updateStrategy | indent 4 }} +{{- end }} + selector: + matchLabels: + app: {{ template "log-aggregator.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "log-aggregator.name" . }} + chart: {{ template "log-aggregator.version" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: log-aggregator + image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + securityContext: + privileged: true + volumeMounts: + - name: flexvolume-driver + mountPath: /flexmnt +{{- if .Values.env }} + env: +{{ toYaml .Values.env | indent 10 }} +{{- end }} + resources: +{{ toYaml .Values.resources | indent 10 }} + terminationGracePeriodSeconds: 10 + nodeSelector: +{{- include "windows-node-selector" . | nindent 8 }} + {{- if .Values.nodeSelector }} +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + tolerations: + {{- if .Values.tolerations }} +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} + volumes: + - name: flexvolume-driver + hostPath: + path: {{ .Values.flexVolumeDir }} +{{- end }} \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/values.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/values.yaml new file mode 100755 index 0000000..c3d5919 --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/charts/log-aggregator-windows/values.yaml @@ -0,0 +1,27 @@ +nameOverride: log-aggregator + +labels: {} +## Log Aggregator container image +## +image: + repository: rancher/log-aggregator + tag: v0.1.5 + +nodeSelector: {} + +# updateStrategy: +# type: RollingUpdate + +tolerations: + - effect: NoSchedule + operator: Exists + +## Resource limits & requests +## Ref: https://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: {} + # requests: + # memory: 400Mi + +## flexvolume dir +flexVolumeDir: C:/var/lib/kubelet/volumeplugins \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/requirements.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/requirements.yaml new file mode 100644 index 0000000..4a24bba --- /dev/null +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/requirements.yaml @@ -0,0 +1,10 @@ +dependencies: + - name: log-aggregator-linux + version: 0.0.1 + condition: log-aggregator.log-aggregator-linux.enabled + repository: "file://./charts/log-aggregator-linux" + + - name: log-aggregator-windows + version: 0.0.1 + condition: log-aggregator.log-aggregator-windows.enabled + repository: "file://./charts/log-aggregator-window" \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/_helpers.tpl b/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/_helpers.tpl index 0893cf0..e9a2eb8 100644 --- a/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/_helpers.tpl +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/_helpers.tpl @@ -35,14 +35,3 @@ Create chart name and version as used by the chart label. {{- $version := .Chart.Version | replace "+" "_" -}} {{- printf "%s-%s" $name $version -}} {{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "log-aggregator.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "log-aggregator.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/serviceaccount.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/serviceaccount.yaml deleted file mode 100644 index 479ba01..0000000 --- a/charts/rancher-logging/0.1.2/charts/log-aggregator/templates/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "log-aggregator.fullname" . }} - labels: - app: {{ template "log-aggregator.name" . }} - chart: {{ template "log-aggregator.version" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - kubernetes.io/cluster-service: "true" -{{- end -}} diff --git a/charts/rancher-logging/0.1.2/charts/log-aggregator/values.yaml b/charts/rancher-logging/0.1.2/charts/log-aggregator/values.yaml index cc4636c..068f0d7 100755 --- a/charts/rancher-logging/0.1.2/charts/log-aggregator/values.yaml +++ b/charts/rancher-logging/0.1.2/charts/log-aggregator/values.yaml @@ -1,31 +1,5 @@ -enabledRBAC: true +log-aggregator-linux: + enabled: true -labels: {} -## Log Aggregator container image -## -image: - repository: rancher/log-aggregator - tag: v0.1.5 - -nodeSelector: {} - -# updateStrategy: -# type: RollingUpdate - -tolerations: - - effect: NoSchedule - operator: Exists - -## Resource limits & requests -## Ref: https://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: {} - # requests: - # memory: 400Mi - -serviceAccount: - # Specifies whether a ServiceAccount should be created - create: true - -## flexvolume dir -flexVolumeDir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec +log-aggregator-windows: + enabled: false \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/requirements.yaml b/charts/rancher-logging/0.1.2/requirements.yaml index 26f94bd..9246b19 100644 --- a/charts/rancher-logging/0.1.2/requirements.yaml +++ b/charts/rancher-logging/0.1.2/requirements.yaml @@ -1,15 +1,15 @@ dependencies: - name: fluentd - version: 0.0.1 + version: 0.0.2 condition: fluentd.enabled repository: "file://./charts/fluentd/" - name: log-aggregator - version: 0.0.1 + version: 0.0.2 condition: log-aggregator.enabled repository: "file://./charts/log-aggregator/" - name: fluentd-tester - version: 0.0.1 + version: 0.0.2 condition: fluentd-tester.enabled repository: "file://./charts/fluentd-tester/" \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/templates/_helpers.tpl b/charts/rancher-logging/0.1.2/templates/_helpers.tpl index 219d522..8ab85ac 100644 --- a/charts/rancher-logging/0.1.2/templates/_helpers.tpl +++ b/charts/rancher-logging/0.1.2/templates/_helpers.tpl @@ -42,3 +42,19 @@ {{- "" -}} {{- end -}} {{- end -}} + +{{- define "linux-node-selector" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +beta.kubernetes.io/os: linux +{{- else -}} +kubernetes.io/os: linux +{{- end -}} +{{- end -}} + +{{- define "windows-node-selector" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +beta.kubernetes.io/os: windows +{{- else -}} +kubernetes.io/os: windows +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/rancher-logging/0.1.2/values.yaml b/charts/rancher-logging/0.1.2/values.yaml index e5fee57..1b02877 100644 --- a/charts/rancher-logging/0.1.2/values.yaml +++ b/charts/rancher-logging/0.1.2/values.yaml @@ -4,6 +4,5 @@ fluentd-tester: enabled: false log-aggregator: enabled: false - flexVolumeDir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec global: systemDefaultRegistry: "" -- GitLab