summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mongo
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/common/mongo')
-rw-r--r--kubernetes/common/mongo/Chart.yaml13
-rw-r--r--kubernetes/common/mongo/requirements.yaml22
-rw-r--r--kubernetes/common/mongo/templates/statefulset.yaml19
3 files changed, 29 insertions, 25 deletions
diff --git a/kubernetes/common/mongo/Chart.yaml b/kubernetes/common/mongo/Chart.yaml
index 84e1ea6374..5a97afed4e 100644
--- a/kubernetes/common/mongo/Chart.yaml
+++ b/kubernetes/common/mongo/Chart.yaml
@@ -1,4 +1,5 @@
# Copyright © 2018, 2021 Orange
+# Modifications Copyright © 2021 Nordix Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,7 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-apiVersion: v1
+apiVersion: v2
description: MongoDB Server
name: mongo
-version: 9.0.0
+version: 10.0.0
+
+dependencies:
+ - name: common
+ version: ~10.x-0
+ repository: 'file://../common'
+ - name: repositoryGenerator
+ version: ~10.x-0
+ repository: 'file://../repositoryGenerator' \ No newline at end of file
diff --git a/kubernetes/common/mongo/requirements.yaml b/kubernetes/common/mongo/requirements.yaml
deleted file mode 100644
index c791c85323..0000000000
--- a/kubernetes/common/mongo/requirements.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright © 2017 Amdocs, Bell Canada
-# Modifications Copyright © 2021 Orange
-#
-# 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.
-
-dependencies:
- - name: common
- version: ~9.x-0
- repository: 'file://../common'
- - name: repositoryGenerator
- version: ~9.x-0
- repository: 'file://../repositoryGenerator'
diff --git a/kubernetes/common/mongo/templates/statefulset.yaml b/kubernetes/common/mongo/templates/statefulset.yaml
index 11602054e8..e156db27db 100644
--- a/kubernetes/common/mongo/templates/statefulset.yaml
+++ b/kubernetes/common/mongo/templates/statefulset.yaml
@@ -39,6 +39,23 @@ spec:
{{ include "common.podSecurityContext" . | indent 6 }}
imagePullSecrets:
- name: "{{ include "common.namespace" . }}-docker-registry-key"
+ initContainers:
+ # we shouldn't need this but for unknown reason, it's fsGroup is not
+ # applied
+ - name: fix-permission
+ command:
+ - /bin/sh
+ args:
+ - -c
+ - |
+ chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} /data
+ image: {{ include "repositoryGenerator.image.busybox" . }}
+ imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ securityContext:
+ runAsUser: 0
+ volumeMounts:
+ - name: {{ include "common.fullname" . }}-data
+ mountPath: /data
containers:
- name: {{ include "common.name" . }}
image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
@@ -72,7 +89,7 @@ spec:
periodSeconds: {{ .Values.readiness.periodSeconds }}
volumeMounts:
- name: {{ include "common.fullname" . }}-data
- mountPath: /var/lib/mongo
+ mountPath: /data/db
resources: {{ include "common.resources" . | nindent 12 }}
{{ include "common.containerSecurityContext" . | indent 10 }}
{{- if .Values.nodeSelector }}