diff --git a/charts/mongodb/Chart.yaml b/charts/mongodb/Chart.yaml index 3cfddb94c0ef0c964d4df626a0b467cae65d0efd..55ac914a919ddee9d757483b522a230cee6c610b 100644 --- a/charts/mongodb/Chart.yaml +++ b/charts/mongodb/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.2.0 +version: 0.2.1 appVersion: 4.2.11 diff --git a/charts/mongodb/README.md b/charts/mongodb/README.md index 132750c3800922b2789e42dd17255f8dc784f5e0..c3927f9086338f0b45ee58b79365421da2d0dcc1 100644 --- a/charts/mongodb/README.md +++ b/charts/mongodb/README.md @@ -1,6 +1,6 @@ # MongoDB -   +   A Helm chart for MongoDB on Kubernetes @@ -57,12 +57,12 @@ $ helm uninstall my-release | livenessProbe | object | `see values.yaml` | Liveness probe configuration | | readinessProbe | object | `see values.yaml` | Readiness probe configuration | | resources | object | `{}` | Resource limits and requests | -| nodeSelector."kubernetes.io/arch" | string | `"amd64"` | Deployment node selector | +| nodeSelector | object | `{}` | Deployment node selector | | podAnnotations | object | `{}` | Additional pod annotations | | podSecurityContext | object | `see values.yaml` | Pod security context | | securityContext | object | `see values.yaml` | Container security context | | env | list | `[]` | Additional container environmment variables | -| args | object | `{}` | Additional container command arguments | +| args | object | `[]` | Additional container command arguments | | serviceAccount.annotations | object | `{}` | Additional service account annotations | | serviceAccount.create | bool | `false` | Enable service account creation | | serviceAccount.name | string | `""` | Name of the service account | @@ -83,17 +83,17 @@ $ helm uninstall my-release | Key | Type | Default | Description | |-----|------|---------|-------------| | storage.accessModes[0] | string | `"ReadWriteOnce"` | Storage access mode | -| storage.persistentVolumeClaimName | string | `""` | PVC name when existing storage volume should be used | -| storage.requestedSize | string | `""` | Size for new PVC, when no existing PVC is used | -| storage.className | string | `""` | Storage class name | +| storage.persistentVolumeClaimName | string | `nil` | PVC name when existing storage volume should be used | +| storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | +| storage.className | string | `nil` | Storage class name | ## MongoDB parameters | Key | Type | Default | Description | |-----|------|---------|-------------| -| settings.customConfig | string | `""` | Custom MongoDB configuration block that will be mounted as file in /etc/mongo/custom.conf | +| settings.customConfig | string | `nil` | Custom MongoDB configuration block that will be mounted as file in /etc/mongo/custom.conf | | settings.rootUsername | string | `admin` | The root username | | settings.rootPassword | string | `{}` | The root users password (Random value if not specified) | | initUserDatabase | object | `{}` | Optional user database initialization script support | -| initUserDatabase.dbName | string | `""` | Name of the user database | -| initUserDatabase.script | string | `""` | Javascript block to initialize the user database | +| initUserDatabase.dbName | string | `nil` | Name of the user database | +| initUserDatabase.script | string | `nil` | Javascript block to initialize the user database | diff --git a/charts/mongodb/templates/service.yaml b/charts/mongodb/templates/service.yaml index a276e455a9a934683990e19d57fda8d6c55cfbb0..45328e1b09091f7953680722fc8f7e85e0a73be1 100644 --- a/charts/mongodb/templates/service.yaml +++ b/charts/mongodb/templates/service.yaml @@ -11,5 +11,11 @@ spec: targetPort: mongodb protocol: TCP name: mongodb + {{- if and (eq .Values.service.type "NodePort") (.Values.service.nodePort) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + {{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.clusterIP) }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} selector: {{- include "mongodb.selectorLabels" . | nindent 4 }} diff --git a/charts/mongodb/templates/statefulset.yaml b/charts/mongodb/templates/statefulset.yaml index 642ba39184b64270d719d7f6afbc1d5ecad32638..12a17808d0c867d60e692a2bcaacae1c78ccf93f 100644 --- a/charts/mongodb/templates/statefulset.yaml +++ b/charts/mongodb/templates/statefulset.yaml @@ -27,12 +27,16 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "mongodb.serviceAccountName" . }} + {{- with .Values.podSecurityContext }} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} + {{- with .Values.securityContext }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: @@ -65,8 +69,10 @@ spec: failureThreshold: {{ .Values.readinessProbe.failureThreshold }} successThreshold: {{ .Values.readinessProbe.successThreshold }} {{- end }} + {{- with .Values.resources }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} envFrom: - secretRef: name: {{ include "mongodb.fullname" . }} diff --git a/charts/mongodb/values.yaml b/charts/mongodb/values.yaml index 370e523fcaf19991322df070629202b5d65d0258..e01c6d481198ad2b2d41862c8c2177d6290e128a 100644 --- a/charts/mongodb/values.yaml +++ b/charts/mongodb/values.yaml @@ -28,7 +28,7 @@ podAnnotations: {} podSecurityContext: fsGroup: 999 -## Don't touch - no other options supported in V0.1.0 of this chart +## Don't touch - no other options supported in this chart version podManagementPolicy: OrderedReady updateStrategyType: RollingUpdate replicaCount: 1 @@ -45,6 +45,10 @@ securityContext: service: type: ClusterIP port: 27017 + ## The node port (only relevant for type NodePort) + nodePort: {} + ## The cluster ip address (only relevant for type LoadBalancer) + clusterIP: {} ## Resource limits and requests resources: {} @@ -73,10 +77,8 @@ readinessProbe: successThreshold: 1 periodSeconds: 10 -## Default node type for the image -## use arm64 for the arm64v8 image -nodeSelector: - kubernetes.io/arch: amd64 +## Additional node selector +nodeSelector: {} ## Pod tolerations tolerations: [] @@ -85,7 +87,7 @@ tolerations: [] affinity: {} ## Additional arguments for the container entrypoint process -args: {} +args: [] ## Additional environment variables env: []