Enable Apparmor to fluentd

Change-Id: I21640c263cbf7871319d2710160e37a9dddf0eb2
Signed-off-by: diwakar thyagaraj <diwakar.chitoor.thyagaraj@att.com>
This commit is contained in:
diwakar thyagaraj 2020-03-20 01:37:20 +00:00
parent 965fd345c3
commit c0bec2c744
5 changed files with 23 additions and 3 deletions

View File

@ -100,6 +100,7 @@ spec:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-bin-hash: {{ tuple "configmap-bin.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: 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 }}

View File

@ -0,0 +1,6 @@
pod:
mandatory_access_control:
type: apparmor
fluentd:
fluentd: runtime/default
init: runtime/default

View File

@ -18,6 +18,7 @@ set -xe
#NOTE: Lint and package chart #NOTE: Lint and package chart
make fluentd make fluentd
: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD:="$(./tools/deployment/common/get-values-overrides.sh fluentd)"}
tee /tmp/fluentd-daemonset.yaml << EOF tee /tmp/fluentd-daemonset.yaml << EOF
endpoints: endpoints:
@ -298,7 +299,9 @@ conf:
EOF EOF
helm upgrade --install fluentd-daemonset ./fluentd \ helm upgrade --install fluentd-daemonset ./fluentd \
--namespace=osh-infra \ --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 #NOTE: Wait for deploy
./tools/deployment/common/wait-for-pods.sh osh-infra ./tools/deployment/common/wait-for-pods.sh osh-infra

View File

@ -19,6 +19,8 @@ set -xe
#NOTE: Lint and package chart #NOTE: Lint and package chart
make fluentd make fluentd
: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD:="$(./tools/deployment/common/get-values-overrides.sh fluentd)"}
if [ ! -d "/var/log/journal" ]; then if [ ! -d "/var/log/journal" ]; then
tee /tmp/fluentd.yaml << EOF tee /tmp/fluentd.yaml << EOF
deployment: deployment:
@ -42,7 +44,10 @@ pod:
EOF EOF
helm upgrade --install fluentd ./fluentd \ helm upgrade --install fluentd ./fluentd \
--namespace=osh-infra \ --namespace=osh-infra \
--values=/tmp/fluentd.yaml --values=/tmp/fluentd.yaml \
${OSH_INFRA_EXTRA_HELM_ARGS} \
${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTD}
else else
tee /tmp/fluentd.yaml << EOF tee /tmp/fluentd.yaml << EOF
deployment: deployment:
@ -57,7 +62,10 @@ EOF
fi fi
helm upgrade --install fluentd ./fluentd \ helm upgrade --install fluentd ./fluentd \
--namespace=osh-infra \ --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 #NOTE: Wait for deploy
./tools/deployment/common/wait-for-pods.sh osh-infra ./tools/deployment/common/wait-for-pods.sh osh-infra

View File

@ -342,6 +342,8 @@
- ./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/065-fluentd-deployment.sh
- ./tools/deployment/osh-infra-logging/070-kibana.sh - ./tools/deployment/osh-infra-logging/070-kibana.sh
- job: - job: