Merge "Fluentd: Add support for Kafka outputs"

This commit is contained in:
Zuul 2019-09-04 15:17:46 +00:00 committed by Gerrit Code Review
commit 43c89812c5
3 changed files with 66 additions and 1 deletions

View File

@ -19,8 +19,11 @@ limitations under the License.
{{- $mounts_fluentd := .Values.pod.mounts.fluentd.fluentd }} {{- $mounts_fluentd := .Values.pod.mounts.fluentd.fluentd }}
{{- $rcControllerName := printf "%s-%s" $envAll.Release.Name "fluentd" }} {{- $kafkaBroker := tuple "kafka" "public" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
{{- $kafkaBrokerPort := tuple "kafka" "public" "broker" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $kafkaBrokerURI := printf "%s:%s" $kafkaBroker $kafkaBrokerPort }}
{{- $rcControllerName := printf "%s-%s" $envAll.Release.Name "fluentd" }}
{{ tuple $envAll "fluentd" $rcControllerName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "fluentd" $rcControllerName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
@ -156,6 +159,8 @@ spec:
value: {{ tuple "elasticsearch" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" | quote }} value: {{ tuple "elasticsearch" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" | quote }}
- name: ELASTICSEARCH_PORT - name: ELASTICSEARCH_PORT
value: {{ tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} value: {{ tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
- name: KAFKA_BROKER
value: {{ $kafkaBrokerURI }}
- name: ELASTICSEARCH_USERNAME - name: ELASTICSEARCH_USERNAME
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
@ -166,6 +171,18 @@ spec:
secretKeyRef: secretKeyRef:
name: {{ printf "%s-%s" $envAll.Release.Name "elasticsearch-user" | quote }} name: {{ printf "%s-%s" $envAll.Release.Name "elasticsearch-user" | quote }}
key: ELASTICSEARCH_PASSWORD key: ELASTICSEARCH_PASSWORD
{{- if .Values.manifests.secret_kafka }}
- name: KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" $envAll.Release.Name "kafka-user" | quote }}
key: KAFKA_USERNAME
- name: KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" $envAll.Release.Name "kafka-user" | quote }}
key: KAFKA_PASSWORD
{{- end }}
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp

View File

@ -0,0 +1,28 @@
{{/*
Copyright 2019 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.secret_kafka }}
{{- $envAll := . }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-%s" $envAll.Release.Name "kafka-user" | quote }}
type: Opaque
data:
KAFKA_USERNAME: {{ .Values.endpoints.kafka.auth.admin.username | b64enc }}
KAFKA_PASSWORD: {{ .Values.endpoints.kafka.auth.admin.password | b64enc }}
{{- end }}

View File

@ -347,6 +347,25 @@ endpoints:
default: 24224 default: 24224
metrics: metrics:
default: 24220 default: 24220
kafka:
namespace: null
name: kafka
auth:
admin:
username: admin
password: changeme
hosts:
default: kafka-broker
public: kafka
host_fqdn_override:
default: null
path:
default: null
scheme:
default: kafka
port:
broker:
default: 9092
prometheus_fluentd_exporter: prometheus_fluentd_exporter:
namespace: null namespace: null
hosts: hosts:
@ -461,4 +480,5 @@ manifests:
service_exporter: true service_exporter: true
network_policy: false network_policy: false
secret_elasticsearch: true secret_elasticsearch: true
secret_kafka: false
service_fluentd: true service_fluentd: true