Skip to content

Commit

Permalink
merge fluentd commits
Browse files Browse the repository at this point in the history
Signed-off-by: André Bauer <[email protected]>
  • Loading branch information
monotek committed Sep 30, 2020
2 parents 36c46f2 + 959e78e commit bb65dfa
Show file tree
Hide file tree
Showing 18 changed files with 1,864 additions and 0 deletions.
22 changes: 22 additions & 0 deletions charts/fluentd-elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
name: fluentd-elasticsearch
version: 10.0.0
appVersion: 3.0.4
home: https://www.fluentd.org/
description: A Fluentd Helm chart for Kubernetes with Elasticsearch output
icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png
keywords:
- fluentd
- elasticsearch
- multiline
- detect-exceptions
- logging
sources:
- https://github.com/kiwigrid/helm-charts/tree/master/charts/fluentd-elasticsearch
- https://github.com/fluent/fluentd-kubernetes-daemonset
- https://github.com/GoogleCloudPlatform/fluent-plugin-detect-exceptions
- https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch/fluentd-es-image
maintainers:
- name: monotek
email: [email protected]
engine: gotpl
4 changes: 4 additions & 0 deletions charts/fluentd-elasticsearch/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
approvers:
- monotek
reviewers:
- monotek
328 changes: 328 additions & 0 deletions charts/fluentd-elasticsearch/README.md

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions charts/fluentd-elasticsearch/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
1. To verify that Fluentd has started, run:

kubectl --namespace={{ .Release.Namespace }} get pods -l "app.kubernetes.io/name={{ include "fluentd-elasticsearch.name" . }},app.kubernetes.io/instance={{ .Release.Name }}"

THIS APPLICATION CAPTURES ALL CONSOLE OUTPUT AND FORWARDS IT TO elasticsearch . Anything that might be identifying,
including things like IP addresses, container images, and object names will NOT be anonymized.

{{- if .Values.service }}
2. Get the application URL by running these commands:
{{- range $port := .Values.service.ports }}
{{- $service_type := $port.type | default "ClusterIP" -}}
{{- if contains "NodePort" $service_type }}
export NODE_PORT=$(kubectl get --namespace {{ $.Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "fluentd-elasticsearch.fullname" $ }})
export NODE_IP=$(kubectl get nodes --namespace {{ $.Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" $service_type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ include "fluentd-elasticsearch.fullname" $ }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ $.Release.Namespace }} {{ include "fluentd-elasticsearch.fullname" $ }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ $port.port }}
{{- else if contains "ClusterIP" $service_type }}
export POD_NAME=$(kubectl get pods --namespace {{ $.Release.Namespace }} -l "app.kubernetes.io/name={{ include "fluentd-elasticsearch.name" $ }},app.kubernetes.io/instance={{ $.Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}
{{- end }}
{{- end }}
55 changes: 55 additions & 0 deletions charts/fluentd-elasticsearch/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "fluentd-elasticsearch.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 "fluentd-elasticsearch.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 "fluentd-elasticsearch.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "fluentd-elasticsearch.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "fluentd-elasticsearch.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "fluentd-elasticsearch.labels" -}}
app.kubernetes.io/name: {{ include "fluentd-elasticsearch.name" . }}
helm.sh/chart: {{ include "fluentd-elasticsearch.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 -}}
23 changes: 23 additions & 0 deletions charts/fluentd-elasticsearch/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.rbac.create -}}
{{- $striped_version := (split "-" .Capabilities.KubeVersion.GitVersion)._0 -}}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "fluentd-elasticsearch.fullname" . }}
labels:
{{ include "fluentd-elasticsearch.labels" . | indent 4 }}
{{- if semverCompare "< 1.6" $striped_version }}
kubernetes.io/cluster-service: "true"
{{- end }}
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- "namespaces"
- "pods"
verbs:
- "get"
- "watch"
- "list"
{{- end -}}
21 changes: 21 additions & 0 deletions charts/fluentd-elasticsearch/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.rbac.create -}}
{{- $striped_version := (split "-" .Capabilities.KubeVersion.GitVersion)._0 -}}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "fluentd-elasticsearch.fullname" . }}
labels:
{{ include "fluentd-elasticsearch.labels" . | indent 4 }}
{{- if semverCompare "< 1.6" $striped_version }}
kubernetes.io/cluster-service: "true"
{{- end }}
addonmanager.kubernetes.io/mode: Reconcile
subjects:
- kind: ServiceAccount
name: {{ if .Values.serviceAccount.name }}{{ .Values.serviceAccount.name }}{{ else }}{{ include "fluentd-elasticsearch.fullname" . }}{{ end }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ include "fluentd-elasticsearch.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- end -}}
Loading

0 comments on commit bb65dfa

Please sign in to comment.