Fluentd: Remove Deployment Option
This chart could deploy fluentd either as a Deployment or a Daemonset. Both options would use the deployment-fluentd template with various sections toggled off based on values.yaml I'd like to know - Does anyone run this chart as a Deployment? We can simplify the chart, and zuul gates, by changing the chart to deploy a Daemonset specifically. Change-Id: Ie88ceadbf5113fc60e5bb0ddef09e18fe07a192c
This commit is contained in:
parent
b82a146640
commit
959417f321
@ -226,7 +226,7 @@ Alternatively, this step can be performed by running the script directly:
|
|||||||
Deploy Fluentd
|
Deploy Fluentd
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. literalinclude:: ../../../tools/deployment/multinode/135-fluentd-deployment.sh
|
.. literalinclude:: ../../../tools/deployment/multinode/130-fluentd.sh
|
||||||
:language: shell
|
:language: shell
|
||||||
:lines: 1,17-
|
:lines: 1,17-
|
||||||
|
|
||||||
@ -234,4 +234,4 @@ Alternatively, this step can be performed by running the script directly:
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
./tools/deployment/multinode/135-fluentd-deployment.sh
|
./tools/deployment/multinode/130-fluentd.sh
|
||||||
|
@ -12,7 +12,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- if .Values.manifests.deployment_fluentd }}
|
{{- if .Values.manifests.daemonset }}
|
||||||
{{- $envAll := . }}
|
{{- $envAll := . }}
|
||||||
|
|
||||||
{{- $mounts_fluentd := .Values.pod.mounts.fluentd.fluentd }}
|
{{- $mounts_fluentd := .Values.pod.mounts.fluentd.fluentd }}
|
||||||
@ -68,13 +68,8 @@ rules:
|
|||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
---
|
---
|
||||||
{{- if eq .Values.deployment.type "Deployment" }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
{{- else if eq .Values.deployment.type "DaemonSet" }}
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
{{- end }}
|
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ $rcControllerName | quote }}
|
name: {{ $rcControllerName | quote }}
|
||||||
annotations:
|
annotations:
|
||||||
@ -82,12 +77,7 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
{{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
{{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
spec:
|
spec:
|
||||||
{{- if eq .Values.deployment.type "Deployment" }}
|
|
||||||
replicas: {{ .Values.pod.replicas.fluentd }}
|
|
||||||
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
|
|
||||||
{{- else }}
|
|
||||||
{{ tuple $envAll "fluentd" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
|
{{ tuple $envAll "fluentd" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
|
||||||
{{- end }}
|
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
{{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
||||||
@ -106,13 +96,9 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
{{ dict "envAll" $envAll "application" "fluentd" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
{{ dict "envAll" $envAll "application" "fluentd" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
||||||
serviceAccountName: {{ $rcControllerName | quote }}
|
serviceAccountName: {{ $rcControllerName | quote }}
|
||||||
{{ if and ($envAll.Values.pod.tolerations.fluentd.enabled) (eq .Values.deployment.type "DaemonSet") }}
|
{{ if $envAll.Values.pod.tolerations.fluentd.enabled }}
|
||||||
{{ tuple $envAll "fluentd" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
|
{{ tuple $envAll "fluentd" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- if eq .Values.deployment.type "Deployment" }}
|
|
||||||
affinity:
|
|
||||||
{{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.fluentd.node_selector_key }}: {{ .Values.labels.fluentd.node_selector_value | quote }}
|
{{ .Values.labels.fluentd.node_selector_key }}: {{ .Values.labels.fluentd.node_selector_value | quote }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.fluentd.timeout | default "30" }}
|
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.fluentd.timeout | default "30" }}
|
||||||
@ -131,7 +117,6 @@ spec:
|
|||||||
containerPort: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
containerPort: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
- name: metrics
|
- name: metrics
|
||||||
containerPort: {{ tuple "fluentd" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
containerPort: {{ tuple "fluentd" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
{{- if eq .Values.deployment.type "Deployment" }}
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
tcpSocket:
|
tcpSocket:
|
||||||
port: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
port: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
@ -142,7 +127,6 @@ spec:
|
|||||||
port: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
port: {{ tuple "fluentd" "internal" "service" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
initialDelaySeconds: 60
|
initialDelaySeconds: 60
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
{{- end }}
|
|
||||||
env:
|
env:
|
||||||
- name: NODE_NAME
|
- name: NODE_NAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@ -191,13 +175,11 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: pod-tmp
|
- name: pod-tmp
|
||||||
mountPath: /tmp
|
mountPath: /tmp
|
||||||
{{- if eq .Values.deployment.type "DaemonSet" }}
|
|
||||||
- name: varlog
|
- name: varlog
|
||||||
mountPath: /var/log
|
mountPath: /var/log
|
||||||
- name: varlibdockercontainers
|
- name: varlibdockercontainers
|
||||||
mountPath: /var/lib/docker/containers
|
mountPath: /var/lib/docker/containers
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{{- end }}
|
|
||||||
- name: pod-etc-fluentd
|
- name: pod-etc-fluentd
|
||||||
mountPath: /fluentd/etc
|
mountPath: /fluentd/etc
|
||||||
- name: fluentd-etc
|
- name: fluentd-etc
|
||||||
@ -212,14 +194,12 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: pod-tmp
|
- name: pod-tmp
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- if eq .Values.deployment.type "DaemonSet" }}
|
|
||||||
- name: varlog
|
- name: varlog
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /var/log
|
path: /var/log
|
||||||
- name: varlibdockercontainers
|
- name: varlibdockercontainers
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /var/lib/docker/containers
|
path: /var/lib/docker/containers
|
||||||
{{- end }}
|
|
||||||
- name: pod-etc-fluentd
|
- name: pod-etc-fluentd
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{ if and (.Values.manifests.secret_fluentd_env) (.Values.pod.env.fluentd.secrets) }}
|
{{ if and (.Values.manifests.secret_fluentd_env) (.Values.pod.env.fluentd.secrets) }}
|
@ -17,9 +17,6 @@
|
|||||||
---
|
---
|
||||||
release_group: null
|
release_group: null
|
||||||
|
|
||||||
deployment:
|
|
||||||
type: DaemonSet
|
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
fluentd:
|
fluentd:
|
||||||
node_selector_key: openstack-control-plane
|
node_selector_key: openstack-control-plane
|
||||||
@ -397,28 +394,13 @@ pod:
|
|||||||
security_context:
|
security_context:
|
||||||
fluentd:
|
fluentd:
|
||||||
pod:
|
pod:
|
||||||
runAsUser: 65534
|
runAsUser: 0
|
||||||
container:
|
container:
|
||||||
fluentd:
|
fluentd:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
|
||||||
affinity:
|
|
||||||
anti:
|
|
||||||
type:
|
|
||||||
default: preferredDuringSchedulingIgnoredDuringExecution
|
|
||||||
topologyKey:
|
|
||||||
default: kubernetes.io/hostname
|
|
||||||
weight:
|
|
||||||
default: 10
|
|
||||||
lifecycle:
|
lifecycle:
|
||||||
upgrades:
|
upgrades:
|
||||||
deployments:
|
|
||||||
revision_history: 3
|
|
||||||
pod_replacement_strategy: RollingUpdate
|
|
||||||
rolling_update:
|
|
||||||
max_unavailable: 1
|
|
||||||
max_surge: 3
|
|
||||||
daemonsets:
|
daemonsets:
|
||||||
pod_replacement_strategy: RollingUpdate
|
pod_replacement_strategy: RollingUpdate
|
||||||
fluentd:
|
fluentd:
|
||||||
@ -428,8 +410,6 @@ pod:
|
|||||||
termination_grace_period:
|
termination_grace_period:
|
||||||
fluentd:
|
fluentd:
|
||||||
timeout: 30
|
timeout: 30
|
||||||
replicas:
|
|
||||||
fluentd: 3
|
|
||||||
resources:
|
resources:
|
||||||
enabled: false
|
enabled: false
|
||||||
fluentd:
|
fluentd:
|
||||||
@ -446,7 +426,7 @@ pod:
|
|||||||
manifests:
|
manifests:
|
||||||
configmap_bin: true
|
configmap_bin: true
|
||||||
configmap_etc: true
|
configmap_etc: true
|
||||||
deployment_fluentd: true
|
daemonset: true
|
||||||
job_image_repo_sync: true
|
job_image_repo_sync: true
|
||||||
network_policy: false
|
network_policy: false
|
||||||
secret_elasticsearch: true
|
secret_elasticsearch: true
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
#NOTE: Lint and package chart
|
|
||||||
make fluentd
|
|
||||||
|
|
||||||
: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD:="$(./tools/deployment/common/get-values-overrides.sh fluentd)"}
|
|
||||||
|
|
||||||
if [ ! -d "/var/log/journal" ]; then
|
|
||||||
tee /tmp/fluentd.yaml << EOF
|
|
||||||
deployment:
|
|
||||||
type: Deployment
|
|
||||||
pod:
|
|
||||||
replicas:
|
|
||||||
fluentd: 1
|
|
||||||
mounts:
|
|
||||||
fluentbit:
|
|
||||||
fluentbit:
|
|
||||||
volumes:
|
|
||||||
- name: runlog
|
|
||||||
hostPath:
|
|
||||||
path: /run/log
|
|
||||||
volumeMounts:
|
|
||||||
- name: runlog
|
|
||||||
mountPath: /run/log
|
|
||||||
EOF
|
|
||||||
helm upgrade --install fluentd ./fluentd \
|
|
||||||
--namespace=osh-infra \
|
|
||||||
--values=/tmp/fluentd.yaml \
|
|
||||||
${OSH_INFRA_EXTRA_HELM_ARGS} \
|
|
||||||
${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD}
|
|
||||||
|
|
||||||
else
|
|
||||||
tee /tmp/fluentd.yaml << EOF
|
|
||||||
deployment:
|
|
||||||
type: Deployment
|
|
||||||
pod:
|
|
||||||
replicas:
|
|
||||||
fluentd: 1
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
helm upgrade --install fluentd ./fluentd \
|
|
||||||
--namespace=osh-infra \
|
|
||||||
--values=/tmp/fluentd.yaml \
|
|
||||||
${OSH_INFRA_EXTRA_HELM_ARGS} \
|
|
||||||
${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD}
|
|
||||||
|
|
||||||
#NOTE: Wait for deploy
|
|
||||||
./tools/deployment/common/wait-for-pods.sh osh-infra
|
|
||||||
|
|
||||||
#NOTE: Validate Deployment info
|
|
||||||
helm status fluentd
|
|
@ -18,11 +18,7 @@ set -xe
|
|||||||
make fluentd
|
make fluentd
|
||||||
: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD:="$(./tools/deployment/common/get-values-overrides.sh fluentd)"}
|
: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD:="$(./tools/deployment/common/get-values-overrides.sh fluentd)"}
|
||||||
|
|
||||||
tee /tmp/fluentd-daemonset.yaml << EOF
|
tee /tmp/fluentd.yaml << EOF
|
||||||
endpoints:
|
|
||||||
fluentd:
|
|
||||||
hosts:
|
|
||||||
default: fluentd-daemonset
|
|
||||||
pod:
|
pod:
|
||||||
env:
|
env:
|
||||||
fluentd:
|
fluentd:
|
||||||
@ -30,12 +26,6 @@ pod:
|
|||||||
MY_TEST_VAR: FOO
|
MY_TEST_VAR: FOO
|
||||||
secrets:
|
secrets:
|
||||||
MY_TEST_SECRET: BAR
|
MY_TEST_SECRET: BAR
|
||||||
security_context:
|
|
||||||
fluentd:
|
|
||||||
pod:
|
|
||||||
runAsUser: 0
|
|
||||||
deployment:
|
|
||||||
type: DaemonSet
|
|
||||||
conf:
|
conf:
|
||||||
fluentd:
|
fluentd:
|
||||||
# This field is now rendered as a helm template!
|
# This field is now rendered as a helm template!
|
||||||
@ -261,9 +251,9 @@ conf:
|
|||||||
user "#{ENV['ELASTICSEARCH_USERNAME']}"
|
user "#{ENV['ELASTICSEARCH_USERNAME']}"
|
||||||
</match>
|
</match>
|
||||||
EOF
|
EOF
|
||||||
helm upgrade --install fluentd-daemonset ./fluentd \
|
helm upgrade --install fluentd ./fluentd \
|
||||||
--namespace=osh-infra \
|
--namespace=osh-infra \
|
||||||
--values=/tmp/fluentd-daemonset.yaml \
|
--values=/tmp/fluentd.yaml \
|
||||||
${OSH_INFRA_EXTRA_HELM_ARGS} \
|
${OSH_INFRA_EXTRA_HELM_ARGS} \
|
||||||
${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD}
|
${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD}
|
||||||
|
|
||||||
@ -271,4 +261,4 @@ helm upgrade --install fluentd-daemonset ./fluentd \
|
|||||||
./tools/deployment/common/wait-for-pods.sh osh-infra
|
./tools/deployment/common/wait-for-pods.sh osh-infra
|
||||||
|
|
||||||
#NOTE: Validate Deployment info
|
#NOTE: Validate Deployment info
|
||||||
helm status fluentd-daemonset
|
helm status fluentd
|
@ -1 +0,0 @@
|
|||||||
../common/fluentd-daemonset.sh
|
|
1
tools/deployment/multinode/130-fluentd.sh
Symbolic link
1
tools/deployment/multinode/130-fluentd.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../common/fluentd.sh
|
@ -1 +0,0 @@
|
|||||||
../common/fluentd-deployment.sh
|
|
@ -1 +0,0 @@
|
|||||||
../common/fluentd-daemonset.sh
|
|
1
tools/deployment/osh-infra-logging/060-fluentd.sh
Symbolic link
1
tools/deployment/osh-infra-logging/060-fluentd.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../common/fluentd.sh
|
@ -1 +0,0 @@
|
|||||||
../common/fluentd-deployment.sh
|
|
@ -79,8 +79,7 @@
|
|||||||
- ./tools/deployment/multinode/115-radosgw-osh-infra.sh
|
- ./tools/deployment/multinode/115-radosgw-osh-infra.sh
|
||||||
- ./tools/deployment/multinode/120-elasticsearch.sh
|
- ./tools/deployment/multinode/120-elasticsearch.sh
|
||||||
- ./tools/deployment/multinode/125-fluentbit.sh
|
- ./tools/deployment/multinode/125-fluentbit.sh
|
||||||
- ./tools/deployment/multinode/130-fluentd-daemonset.sh
|
- ./tools/deployment/multinode/130-fluentd.sh
|
||||||
- ./tools/deployment/multinode/135-fluentd-deployment.sh
|
|
||||||
- ./tools/deployment/multinode/140-kibana.sh
|
- ./tools/deployment/multinode/140-kibana.sh
|
||||||
- ./tools/deployment/multinode/160-zookeeper.sh
|
- ./tools/deployment/multinode/160-zookeeper.sh
|
||||||
- ./tools/deployment/multinode/600-grafana-selenium.sh || true
|
- ./tools/deployment/multinode/600-grafana-selenium.sh || true
|
||||||
@ -149,8 +148,7 @@
|
|||||||
- ./tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh
|
- ./tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh
|
||||||
- ./tools/deployment/osh-infra-logging/040-ldap.sh
|
- ./tools/deployment/osh-infra-logging/040-ldap.sh
|
||||||
- ./tools/deployment/osh-infra-logging/050-elasticsearch.sh
|
- ./tools/deployment/osh-infra-logging/050-elasticsearch.sh
|
||||||
- ./tools/deployment/osh-infra-logging/060-fluentd-daemonset.sh
|
- ./tools/deployment/osh-infra-logging/060-fluentd.sh
|
||||||
- ./tools/deployment/osh-infra-logging/065-fluentd-deployment.sh
|
|
||||||
- ./tools/deployment/osh-infra-logging/070-kibana.sh
|
- ./tools/deployment/osh-infra-logging/070-kibana.sh
|
||||||
- ./tools/deployment/osh-infra-logging/600-kibana-selenium.sh || true
|
- ./tools/deployment/osh-infra-logging/600-kibana-selenium.sh || true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user