diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml index e0261f0f4..06cda4a04 100644 --- a/helm/templates/configmap.yaml +++ b/helm/templates/configmap.yaml @@ -61,3 +61,9 @@ data: # absolute number because relative will be proprtional to the full machine # memory. vm_memory_high_watermark.absolute = 1600MB + + # Logging + log.file = false + log.console = true + log.console.level = info + log.console.formatter = json diff --git a/helm/templates/statefulsets/rabbitmq.yaml b/helm/templates/statefulsets/rabbitmq.yaml index dcffe1767..6cb2cc836 100644 --- a/helm/templates/statefulsets/rabbitmq.yaml +++ b/helm/templates/statefulsets/rabbitmq.yaml @@ -26,6 +26,20 @@ spec: serviceAccountName: {{ include "datatracker.serviceAccountName.rabbitmq" . }} securityContext: {{- toYaml $podValues.podSecurityContext | nindent 8 }} + initContainers: + - name: init-rabbitmq + image: busybox:stable + command: + - "sh" + - "-c" + - "mkdir -p -m700 /mnt/rabbitmq && chown 100:101 /mnt/rabbitmq" + securityContext: + runAsNonRoot: false + runAsUser: 0 + readOnlyRootFilesystem: true + volumeMounts: + - name: "rabbitmq-data" + mountPath: "/mnt" containers: - name: {{ .Chart.Name }} securityContext: diff --git a/helm/values.yaml b/helm/values.yaml index dae391aaa..366cea3d4 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -405,7 +405,6 @@ rabbitmq: repository: "ghcr.io/ietf-tools/datatracker-mq" pullPolicy: IfNotPresent tag: "3.12-alpine" - imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -419,9 +418,6 @@ rabbitmq: podAnnotations: {} podLabels: {} - podSecurityContext: {} - # fsGroup: 2000 - replicaCount: 1 resources: {} @@ -436,13 +432,18 @@ rabbitmq: # cpu: 100m # memory: 128Mi - securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 + podSecurityContext: + runAsNonRoot: true + + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + # rabbitmq image sets up uid/gid 100/101 + runAsUser: 100 + runAsGroup: 101 service: type: ClusterIP @@ -476,6 +477,9 @@ rabbitmq: - name: "rabbitmq-config" configMap: name: "rabbitmq-configmap" + - name: "rabbitmq-tmp" + emptyDir: + sizeLimit: 50Mi # - name: foo # secret: # secretName: mysecret @@ -484,12 +488,12 @@ rabbitmq: # Additional volumeMounts on the output Deployment definition. volumeMounts: - name: "rabbitmq-data" - mountPath: "/var/lib/rabbitmq/mnesia" + mountPath: "/var/lib/rabbitmq" + subPath: "rabbitmq" - name: "rabbitmq-config" mountPath: "/etc/rabbitmq" - # - name: foo - # mountPath: "/etc/foo" - # readOnly: true + - name: "rabbitmq-tmp" + mountPath: "/tmp" tolerations: [] @@ -531,8 +535,6 @@ memcached: podSecurityContext: runAsNonRoot: true - runAsUser: 11211 - runAsGroup: 11211 securityContext: allowPrivilegeEscalation: false @@ -540,6 +542,9 @@ memcached: drop: - ALL readOnlyRootFilesystem: true + # memcached image sets up uid/gid 11211 + runAsUser: 11211 + runAsGroup: 11211 service: type: ClusterIP