From 417ce3f37b84f4b9f1a06ba31cd6fb993618a09e Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Mon, 5 Mar 2018 10:07:48 -0600 Subject: [PATCH] Fluent-logging: use endpoints section and lookups to set port This PS moves fluent-logging to use the endpoints section and lookups to set the port it serves on. Change-Id: I7cbbd8d6287942eb36f70ae74872405038e523e8 --- fluent-logging/templates/daemonset-fluent-bit.yaml | 1 - .../templates/monitoring/prometheus/exporter-deployment.yaml | 2 +- .../templates/monitoring/prometheus/exporter-service.yaml | 2 +- fluent-logging/templates/service-fluentd.yaml | 4 ++-- fluent-logging/values.yaml | 5 ----- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/fluent-logging/templates/daemonset-fluent-bit.yaml b/fluent-logging/templates/daemonset-fluent-bit.yaml index e8c9057eb..70912c641 100644 --- a/fluent-logging/templates/daemonset-fluent-bit.yaml +++ b/fluent-logging/templates/daemonset-fluent-bit.yaml @@ -102,7 +102,6 @@ spec: {{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: fluentbit - env: image: {{ .Values.images.tags.fluentbit }} imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple $envAll $envAll.Values.pod.resources.fluentbit | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} diff --git a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml index 1f9e175be..f589f3c56 100644 --- a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml @@ -53,7 +53,7 @@ spec: - start ports: - name: metrics - containerPort: {{ .Values.network.prometheus_fluentd_exporter.port }} + containerPort: {{ tuple "prometheus_fluentd_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} env: - name: FLUENTD_METRICS_HOST value: {{ $fluentd_metrics_host }} diff --git a/fluent-logging/templates/monitoring/prometheus/exporter-service.yaml b/fluent-logging/templates/monitoring/prometheus/exporter-service.yaml index 58acda763..4c829682b 100644 --- a/fluent-logging/templates/monitoring/prometheus/exporter-service.yaml +++ b/fluent-logging/templates/monitoring/prometheus/exporter-service.yaml @@ -31,7 +31,7 @@ metadata: spec: ports: - name: metrics - port: {{ .Values.network.prometheus_fluentd_exporter.port }} + port: {{ tuple "prometheus_fluentd_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} selector: {{ tuple $envAll "prometheus_fluentd_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{- end }} diff --git a/fluent-logging/templates/service-fluentd.yaml b/fluent-logging/templates/service-fluentd.yaml index a6e5a12fe..4d7fc2bd8 100644 --- a/fluent-logging/templates/service-fluentd.yaml +++ b/fluent-logging/templates/service-fluentd.yaml @@ -24,12 +24,12 @@ metadata: spec: ports: - name: forward - port: {{ .Values.network.fluentd.port.service }} + port: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{ if .Values.network.fluentd.node_port.enabled }} nodePort: {{ .Values.network.fluentd.node_port.port }} {{ end }} - name: metrics - port: {{ .Values.network.fluentd.port.metrics }} + port: {{ tuple "fluentd" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} selector: {{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ if .Values.network.fluentd.node_port.enabled }} diff --git a/fluent-logging/values.yaml b/fluent-logging/values.yaml index 0f616ab0b..486ee4d48 100644 --- a/fluent-logging/values.yaml +++ b/fluent-logging/values.yaml @@ -289,11 +289,6 @@ network: node_port: enabled: false port: 32329 - port: - service: 24224 - metrics: 24220 - prometheus_fluentd_exporter: - port: 9309 pod: affinity: