diff --git a/fluentd/templates/deployment-fluentd.yaml b/fluentd/templates/deployment-fluentd.yaml index 69bf167bf..a8ef2be95 100644 --- a/fluentd/templates/deployment-fluentd.yaml +++ b/fluentd/templates/deployment-fluentd.yaml @@ -100,6 +100,7 @@ spec: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} +{{ dict "envAll" $envAll "podName" "fluentd" "containerNames" (list "fluentd" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: {{ dict "envAll" $envAll "application" "fluentd" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $rcControllerName | quote }} diff --git a/fluentd/values_overrides/apparmor.yaml b/fluentd/values_overrides/apparmor.yaml new file mode 100644 index 000000000..aa6b51738 --- /dev/null +++ b/fluentd/values_overrides/apparmor.yaml @@ -0,0 +1,6 @@ +pod: + mandatory_access_control: + type: apparmor + fluentd: + fluentd: runtime/default + init: runtime/default diff --git a/tools/deployment/common/fluentd-daemonset.sh b/tools/deployment/common/fluentd-daemonset.sh index 985a2a5f4..4e47348cc 100755 --- a/tools/deployment/common/fluentd-daemonset.sh +++ b/tools/deployment/common/fluentd-daemonset.sh @@ -18,6 +18,7 @@ set -xe #NOTE: Lint and package chart make fluentd +: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD:="$(./tools/deployment/common/get-values-overrides.sh fluentd)"} tee /tmp/fluentd-daemonset.yaml << EOF endpoints: @@ -298,7 +299,9 @@ conf: EOF helm upgrade --install fluentd-daemonset ./fluentd \ --namespace=osh-infra \ - --values=/tmp/fluentd-daemonset.yaml + --values=/tmp/fluentd-daemonset.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 diff --git a/tools/deployment/common/fluentd-deployment.sh b/tools/deployment/common/fluentd-deployment.sh index 9d285236e..1f39a3466 100755 --- a/tools/deployment/common/fluentd-deployment.sh +++ b/tools/deployment/common/fluentd-deployment.sh @@ -19,6 +19,8 @@ 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: @@ -42,7 +44,10 @@ pod: EOF helm upgrade --install fluentd ./fluentd \ --namespace=osh-infra \ - --values=/tmp/fluentd.yaml + --values=/tmp/fluentd.yaml \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD} + else tee /tmp/fluentd.yaml << EOF deployment: @@ -57,7 +62,10 @@ EOF fi helm upgrade --install fluentd ./fluentd \ --namespace=osh-infra \ - --values=/tmp/fluentd.yaml + --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 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 5570510b0..f4eed924f 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -342,6 +342,8 @@ - ./tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh - ./tools/deployment/osh-infra-logging/040-ldap.sh - ./tools/deployment/osh-infra-logging/050-elasticsearch.sh + - ./tools/deployment/osh-infra-logging/060-fluentd-daemonset.sh + - ./tools/deployment/osh-infra-logging/065-fluentd-deployment.sh - ./tools/deployment/osh-infra-logging/070-kibana.sh - job: