Configure user ID for logger container's securityContext using helm values.yaml (#3005)
* Run logger as root to allow access to log files from host * Add to connect part of yaml * Change fission folder to allow non-root to write into folder instead * Configure user ID for logger from helm values.yaml Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io> --------- Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io> Co-authored-by: Mark Retallack <mark.retallack@yunextraffic.com>
This commit is contained in:
co-authored by
Mark Retallack
parent
11baffc92c
commit
b80437b78c
@@ -128,10 +128,8 @@ spec:
|
|||||||
- name: docker-log
|
- name: docker-log
|
||||||
mountPath: /var/lib/docker/containers
|
mountPath: /var/lib/docker/containers
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{{- if .Values.logger.enableSecurityContext }}
|
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
{{- toYaml .Values.logger.securityContext | nindent 12 }}
|
||||||
{{- end }}
|
|
||||||
- name: fluentbit
|
- name: fluentbit
|
||||||
{{- if .Values.repository }}
|
{{- if .Values.repository }}
|
||||||
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
||||||
|
|||||||
@@ -620,11 +620,22 @@ logger:
|
|||||||
|
|
||||||
## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked
|
## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked
|
||||||
## files and a state of offsets, this is very useful to resume a state if the ser-
|
## files and a state of offsets, this is very useful to resume a state if the ser-
|
||||||
## vice is restarted. For Kubernetes environment with constraints like OpenShift,
|
## vice is restarted.
|
||||||
|
##
|
||||||
|
## For Kubernetes environment with constraints like OpenShift,
|
||||||
## the containers are limited to write hostPath volume. Hence, we have to enable
|
## the containers are limited to write hostPath volume. Hence, we have to enable
|
||||||
## security context and set privileged to true.
|
## security context and set privileged to true.
|
||||||
##
|
##
|
||||||
enableSecurityContext: false
|
## The user ID in runAsUser should have access to the `/var/log` and
|
||||||
|
## `/var/lib/docker/containers` directories on your host.
|
||||||
|
## On many hosts, this user might be root ,i.e., `runAsUser: 0`.
|
||||||
|
## Although it is recommended not to use root user for security reasons.
|
||||||
|
##
|
||||||
|
## The `/var/log` and `/var/lib/docker/containers` directories on host are mounted
|
||||||
|
## to logger container with volumeType `HostPath`.
|
||||||
|
securityContext: {}
|
||||||
|
# privileged: true
|
||||||
|
# runAsUser: 0
|
||||||
|
|
||||||
## Enable PodSecurityPolicies to allow privileged container
|
## Enable PodSecurityPolicies to allow privileged container
|
||||||
## Only required in some clusters and when enableSecurityContext is true
|
## Only required in some clusters and when enableSecurityContext is true
|
||||||
|
|||||||
Reference in New Issue
Block a user