mirror of
https://github.com/bitnami/charts.git
synced 2026-03-06 15:10:15 +08:00
[bitnami/*] Affinity based on common presets (v) (#4494)
This commit is contained in:
committed by
GitHub
parent
f300b2a924
commit
f5abfb8e42
6
bitnami/metrics-server/Chart.lock
Normal file
6
bitnami/metrics-server/Chart.lock
Normal file
@@ -0,0 +1,6 @@
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 1.0.1
|
||||
digest: sha256:e66388f254b9de6470bca6d8c1c565d1c16a5569beef68a7bc99e486e73ccbdb
|
||||
generated: "2020-11-25T20:03:27.132535+01:00"
|
||||
@@ -2,6 +2,12 @@ annotations:
|
||||
category: Analytics
|
||||
apiVersion: v2
|
||||
appVersion: 0.4.1
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
tags:
|
||||
- bitnami-common
|
||||
version: 1.x.x
|
||||
description: Metrics Server is a cluster-wide aggregator of resource usage data. Metrics Server collects metrics from the Summary API, exposed by Kubelet on each node.
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/metrics-server
|
||||
@@ -17,4 +23,4 @@ name: metrics-server
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-metrics-server
|
||||
- https://github.com/kubernetes-incubator/metrics-server
|
||||
version: 5.1.0
|
||||
version: 5.2.0
|
||||
|
||||
@@ -47,38 +47,43 @@ The command removes all the Kubernetes components associated with the chart and
|
||||
|
||||
The following tables lists the configurable parameters of the Metrics Server chart and their default values.
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `global.imageRegistry` | Global Docker image registry | `nil` |
|
||||
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `image.registry` | Metrics Server image registry | `docker.io` |
|
||||
| `image.repository` | Metrics Server image name | `bitnami/metrics-server` |
|
||||
| `image.tag` | Metrics Server image tag | `{TAG_NAME}` |
|
||||
| `image.pullPolicy` | Metrics Server image pull policy | `IfNotPresent` |
|
||||
| `nameOverride` | String to partially override metrics-server.fullname template with a string (will prepend the release name) | `nil` |
|
||||
| `replicas` | Number of metrics-server nodes to deploy | `1` |
|
||||
| `fullnameOverride` | String to fully override metrics-server.fullname template with a string | `nil` |
|
||||
| `securePort` | Port where metrics-server will be running | `8443` |
|
||||
| `hostNetwork` | Enable hostNetwork mode | `false` |
|
||||
| `extraArgs` | Extra arguments to pass to metrics-server on start up | {} |
|
||||
| `rbac.create` | Enable RBAC authentication | `true` |
|
||||
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
|
||||
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template |
|
||||
| `apiService.create` | Specifies whether the v1beta1.metrics.k8s.io API service should be created (This should not be necessary in k8s version >= 1.8) | `false` |
|
||||
| `podAnnotations` | Pod annotations | `{}` |
|
||||
| `priorityClassName` | Priority class for pod scheduling | `nil` |
|
||||
| `affinity` | Map of node/pod affinities | `{}` (The value is evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (The value is evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (The value is evaluated as a template) |
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.port` | Kubernetes Service port | `443` |
|
||||
| `service.annotations` | Annotations for the Service | {} |
|
||||
| `service.labels` | Labels for the Service | {} |
|
||||
| `service.loadBalancerIP` | LoadBalancer IP if Service type is `LoadBalancer` | `nil` |
|
||||
| `service.nodePort` | NodePort if Service type is `LoadBalancer` or `NodePort` | `nil` |
|
||||
| `resources` | The [resources] to allocate for the container | `{}` |
|
||||
| `extraVolumes` | Extra volumes | `nil` |
|
||||
| `extraVolumeMounts` | Mount extra volume(s) | `nil` |
|
||||
| Parameter | Description | Default |
|
||||
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `global.imageRegistry` | Global Docker image registry | `nil` |
|
||||
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `image.registry` | Metrics Server image registry | `docker.io` |
|
||||
| `image.repository` | Metrics Server image name | `bitnami/metrics-server` |
|
||||
| `image.tag` | Metrics Server image tag | `{TAG_NAME}` |
|
||||
| `image.pullPolicy` | Metrics Server image pull policy | `IfNotPresent` |
|
||||
| `nameOverride` | String to partially override common.names.fullname template with a string (will prepend the release name) | `nil` |
|
||||
| `fullnameOverride` | String to fully override common.names.fullname template with a string | `nil` |
|
||||
| `replicas` | Number of metrics-server nodes to deploy | `1` |
|
||||
| `securePort` | Port where metrics-server will be running | `8443` |
|
||||
| `hostNetwork` | Enable hostNetwork mode | `false` |
|
||||
| `extraArgs` | Extra arguments to pass to metrics-server on start up | {} |
|
||||
| `rbac.create` | Enable RBAC authentication | `true` |
|
||||
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
|
||||
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template |
|
||||
| `apiService.create` | Specifies whether the v1beta1.metrics.k8s.io API service should be created (This should not be necessary in k8s version >= 1.8) | `false` |
|
||||
| `podAnnotations` | Pod annotations | `{}` |
|
||||
| `priorityClassName` | Priority class for pod scheduling | `nil` |
|
||||
| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `nodeAffinityPreset.key` | Node label key to match. Ignored if `affinity` is set. | `""` |
|
||||
| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.port` | Kubernetes Service port | `443` |
|
||||
| `service.annotations` | Annotations for the Service | {} |
|
||||
| `service.labels` | Labels for the Service | {} |
|
||||
| `service.loadBalancerIP` | LoadBalancer IP if Service type is `LoadBalancer` | `nil` |
|
||||
| `service.nodePort` | NodePort if Service type is `LoadBalancer` or `NodePort` | `nil` |
|
||||
| `resources` | The [resources] to allocate for the container | `{}` |
|
||||
| `extraVolumes` | Extra volumes | `nil` |
|
||||
| `extraVolumeMounts` | Mount extra volume(s) | `nil` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
@@ -109,12 +114,22 @@ Bitnami will release a new chart updating its containers if a new version of the
|
||||
|
||||
In order to enable Role-based access control for Metrics Servier you can use the following parameter: `rbac.create=true`
|
||||
|
||||
### Setting Pod's affinity
|
||||
|
||||
This chart allows you to set your custom affinity using the `affinity` paremeter. Find more infomation about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||
|
||||
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 5.2.0
|
||||
|
||||
This version introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||
|
||||
### To 5.0.0
|
||||
|
||||
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||
|
||||
@@ -26,9 +26,5 @@ Option B:
|
||||
{{- end -}}
|
||||
|
||||
{{- include "metrics-server.validateValues" . }}
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
{{- include "metrics-server.checkRollingTags" . }}
|
||||
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
|
||||
{{- end }}
|
||||
|
||||
@@ -1,59 +1,11 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "metrics-server.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "metrics-server.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "metrics-server.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "metrics-server.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "metrics-server.name" . }}
|
||||
helm.sh/chart: {{ include "metrics-server.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "metrics-server.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "metrics-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "metrics-server.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "metrics-server.fullname" .) .Values.serviceAccount.name }}
|
||||
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
@@ -63,52 +15,14 @@ Create the name of the service account to use
|
||||
Return the proper metrics-server image name
|
||||
*/}}
|
||||
{{- define "metrics-server.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.image.tag | toString -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
|
||||
Also, we can't use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imageRegistry }}
|
||||
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "metrics-server.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image ) "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
@@ -135,14 +49,8 @@ metrics-server: missing-extra-volume-mounts
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "metrics-server.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
Check if there are rolling tags in the images
|
||||
*/}}
|
||||
{{- define "metrics-server.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- define "metrics-server.checkRollingTags" -}}
|
||||
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ template "metrics-server.fullname" . }}:system:auth-delegator
|
||||
name: {{ printf "%s:system:auth-delegator" (include "common.names.fullname" .) }}
|
||||
namespace: kube-system
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: system:auth-delegator
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: system:{{ template "metrics-server.fullname" . }}
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
name: {{ printf "system:%s" (include "common.names.fullname" .) }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
@@ -26,19 +26,19 @@ rules:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
rbac.authorization.k8s.io/aggregate-to-admin: "true"
|
||||
rbac.authorization.k8s.io/aggregate-to-edit: "true"
|
||||
rbac.authorization.k8s.io/aggregate-to-view: "true"
|
||||
name: system:{{ template "metrics-server.fullname" . }}-aggregated-reader
|
||||
name: {{ printf "system:%s-aggregated-reader" (include "common.names.fullname" .) }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- metrics.k8s.io
|
||||
resources:
|
||||
- pods
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- metrics.k8s.io
|
||||
resources:
|
||||
- pods
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,32 +1,37 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
selector:
|
||||
matchLabels: {{- include "metrics-server.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "metrics-server.labels" . | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations: {{- include "metrics-server.tplValue" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "metrics-server.imagePullSecrets" . | indent 6 }}
|
||||
{{- include "metrics-server.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "metrics-server.serviceAccountName" . }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "metrics-server.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "metrics-server.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "metrics-server.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.hostNetwork }}
|
||||
hostNetwork: true
|
||||
|
||||
@@ -3,10 +3,10 @@ apiVersion: apiregistration.k8s.io/v1beta1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.metrics.k8s.io
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
service:
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
group: metrics.k8s.io
|
||||
version: v1beta1
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: system:{{ template "metrics-server.fullname" . }}
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
name: system:{{ template "common.names.fullname" . }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: system:{{ template "metrics-server.fullname" . }}
|
||||
name: system:{{ template "common.names.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{{- if .Values.rbac.create -}}
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ template "metrics-server.fullname" . }}-auth-reader
|
||||
name: {{ printf "%s-auth-reader" (include "common.names.fullname" .) }}
|
||||
namespace: kube-system
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: extension-apiserver-authentication-reader
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "metrics-server.fullname" . }}
|
||||
labels: {{- include "metrics-server.labels" . | nindent 4 }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.service.labels }}
|
||||
{{- include "metrics-server.tplValue" (dict "value" .Values.service.labels "context" $) | nindent 4 }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.service.labels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.annotations }}
|
||||
annotations: {{- include "metrics-server.tplValue" (dict "value" .Values.service.annotations "context" $) | nindent 4 }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
@@ -24,4 +24,4 @@ spec:
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "metrics-server.matchLabels" . | nindent 4 }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
|
||||
@@ -26,11 +26,11 @@ image:
|
||||
# pullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
|
||||
## String to partially override metrics-server.fullname template (will maintain the release name)
|
||||
## String to partially override common.names.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override metrics-server.fullname template
|
||||
## String to fully override common.names.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
@@ -39,7 +39,7 @@ image:
|
||||
replicas: 1
|
||||
|
||||
## Role Based Access
|
||||
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||
## ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||
##
|
||||
rbac:
|
||||
## Specifies whether RBAC rules should be created
|
||||
@@ -54,7 +54,7 @@ serviceAccount:
|
||||
##
|
||||
create: true
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the metrics-server.fullname template
|
||||
## If not set and create is true, a name is generated using the common.names.fullname template
|
||||
# name:
|
||||
|
||||
## API service parameters
|
||||
@@ -94,20 +94,54 @@ podAnnotations: {}
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
|
||||
# priorityClassName: myPriorityClassName
|
||||
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: {}
|
||||
tolerations: []
|
||||
|
||||
## Metrics Server K8s svc properties
|
||||
##
|
||||
|
||||
6
bitnami/minio/Chart.lock
Normal file
6
bitnami/minio/Chart.lock
Normal file
@@ -0,0 +1,6 @@
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 1.0.1
|
||||
digest: sha256:e66388f254b9de6470bca6d8c1c565d1c16a5569beef68a7bc99e486e73ccbdb
|
||||
generated: "2020-11-25T20:23:23.80521+01:00"
|
||||
@@ -2,6 +2,12 @@ annotations:
|
||||
category: Infrastructure
|
||||
apiVersion: v2
|
||||
appVersion: 2020.11.25
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
tags:
|
||||
- bitnami-common
|
||||
version: 1.x.x
|
||||
description: MinIO is an object storage server, compatible with Amazon S3 cloud storage service, mainly used for storing unstructured data (such as photos, videos, log files, etc.)
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/minio
|
||||
@@ -19,4 +25,4 @@ name: minio
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-minio
|
||||
- https://min.io
|
||||
version: 4.0.4
|
||||
version: 4.1.0
|
||||
|
||||
@@ -63,8 +63,8 @@ The following table lists the configurable parameters of the MinIO chart and the
|
||||
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
|
||||
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `image.debug` | Specify if debug logs should be enabled | `false` |
|
||||
| `nameOverride` | String to partially override minio.fullname template with a string (will prepend the release name) | `nil` |
|
||||
| `fullnameOverride` | String to fully override minio.fullname template with a string | `nil` |
|
||||
| `nameOverride` | String to partially override common.names.fullname template with a string (will prepend the release name) | `nil` |
|
||||
| `fullnameOverride` | String to fully override common.names.fullname template with a string | `nil` |
|
||||
| `schedulerName` | Specifies the schedulerName, if it's nil uses kube-scheduler | `nil` |
|
||||
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
|
||||
| `serviceAccount.name` | If serviceAccount.create is enabled, what should the serviceAccount name be - otherwise defaults to the fullname | `nil` |
|
||||
@@ -96,9 +96,14 @@ The following table lists the configurable parameters of the MinIO chart and the
|
||||
| `command` | Command for the minio container | `{}` |
|
||||
| `resources` | Minio containers' resources | `{}` |
|
||||
| `podAnnotations` | Pod annotations | `{}` |
|
||||
| `affinity` | Map of node/pod affinities | `{}` (The value is evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (The value is evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (The value is evaluated as a template) |
|
||||
| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `nodeAffinityPreset.key` | Node label key to match. Ignored if `affinity` is set. | `""` |
|
||||
| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `securityContext.enabled` | Enable security context | `true` |
|
||||
| `securityContext.fsGroup` | Group ID for the container | `1001` |
|
||||
| `securityContext.runAsUser` | User ID for the container | `1001` |
|
||||
@@ -258,12 +263,22 @@ As an alternative, this chart supports using an initContainer to change the owne
|
||||
|
||||
You can enable this initContainer by setting `volumePermissions.enabled` to `true`.
|
||||
|
||||
### Setting Pod's affinity
|
||||
|
||||
This chart allows you to set your custom affinity using the `affinity` paremeter. Find more infomation about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||
|
||||
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 4.1.0
|
||||
|
||||
This version introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||
|
||||
### To 4.0.0
|
||||
|
||||
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||
|
||||
@@ -2,31 +2,31 @@
|
||||
|
||||
MinIO can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster:
|
||||
|
||||
{{ include "minio.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
{{ include "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
|
||||
To get your credentials run:
|
||||
|
||||
export MINIO_ACCESS_KEY=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "minio.fullname" . }} -o jsonpath="{.data.access-key}" | base64 --decode)
|
||||
export MINIO_SECRET_KEY=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "minio.fullname" . }} -o jsonpath="{.data.secret-key}" | base64 --decode)
|
||||
export MINIO_ACCESS_KEY=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.access-key}" | base64 --decode)
|
||||
export MINIO_SECRET_KEY=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.secret-key}" | base64 --decode)
|
||||
|
||||
To connect to your MinIO server using a client:
|
||||
|
||||
- Run a MinIO Client pod and append the desired command (e.g. 'admin info server'):
|
||||
- Run a MinIO Client pod and append the desired command (e.g. 'admin info'):
|
||||
|
||||
kubectl run --namespace {{ .Release.Namespace }} {{ include "minio.fullname" . }}-client \
|
||||
kubectl run --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }}-client \
|
||||
--rm --tty -i --restart='Never' \
|
||||
--env MINIO_SERVER_ACCESS_KEY=$MINIO_ACCESS_KEY \
|
||||
--env MINIO_SERVER_SECRET_KEY=$MINIO_SECRET_KEY \
|
||||
--env MINIO_SERVER_HOST={{ include "minio.fullname" . }} \
|
||||
--env MINIO_SERVER_HOST={{ include "common.names.fullname" . }} \
|
||||
{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
|
||||
--labels="{{ template "minio.name" . }}-client=true" \
|
||||
{{- end }}
|
||||
--image {{ template "minio.clientImage" . }} -- admin info server minio
|
||||
--image {{ template "minio.clientImage" . }} -- admin info minio
|
||||
|
||||
{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
|
||||
|
||||
NOTE: Since NetworkPolicy is enabled, only pods with label
|
||||
"{{ template "minio.fullname" . }}-client=true" will be able to connect to MinIO.
|
||||
"{{ template "common.names.fullname" . }}-client=true" will be able to connect to MinIO.
|
||||
{{- end }}
|
||||
{{- if not .Values.disableWebUI }}
|
||||
|
||||
@@ -44,20 +44,20 @@ To access the MinIO web UI:
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "minio.fullname" . }}'
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "common.names.fullname" . }}'
|
||||
|
||||
{{- $port:=.Values.service.port | toString }}
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "minio.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo "MinIO web URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/minio"
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
|
||||
echo "MinIO web URL: http://127.0.0.1:9000/minio"
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "minio.fullname" . }} 9000:{{ .Values.service.port }}
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }} 9000:{{ .Values.service.port }}
|
||||
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "minio.fullname" . }})
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo "MinIO web URL: http://$NODE_IP:$NODE_PORT/minio"
|
||||
|
||||
|
||||
@@ -1,85 +1,32 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "minio.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "minio.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "minio.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "minio.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "minio.name" . }}
|
||||
helm.sh/chart: {{ include "minio.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "minio.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "minio.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper MinIO image name
|
||||
*/}}
|
||||
{{- define "minio.image" -}}
|
||||
{{- $registryName := coalesce .Values.global.imageRegistry .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.image.tag | toString -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper MinIO Client image name
|
||||
*/}}
|
||||
{{- define "minio.clientImage" -}}
|
||||
{{- $registryName := coalesce .Values.global.imageRegistry .Values.clientImage.registry -}}
|
||||
{{- $repositoryName := .Values.clientImage.repository -}}
|
||||
{{- $tag := .Values.clientImage.tag | toString -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.clientImage "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "minio.volumePermissions.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "minio.imagePullSecrets" -}}
|
||||
{{- $imagePullSecrets := coalesce .Values.global.imagePullSecrets .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets -}}
|
||||
{{- if $imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range $imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.clientImage .Values.volumePermissions.image) "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
@@ -119,7 +66,7 @@ Get the credentials secret.
|
||||
{{- else if .Values.existingSecret -}}
|
||||
{{- printf "%s" .Values.existingSecret -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s" (include "minio.fullname" .) -}}
|
||||
{{- printf "%s" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -134,6 +81,19 @@ Return true if a secret object should be created
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns the proper service account name depending if an explicit service account name is set
|
||||
in the values file. If the name is not set it will default to either common.names.fullname if serviceAccount.create
|
||||
is true or default otherwise.
|
||||
*/}}
|
||||
{{- define "minio.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message, and call fail.
|
||||
*/}}
|
||||
@@ -170,96 +130,6 @@ minio: replicaCount
|
||||
|
||||
{{/* Check if there are rolling tags in the images */}}
|
||||
{{- define "minio.checkRollingTags" -}}
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.clientImage.repository) (not (.Values.clientImage.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.clientImage.repository }}:{{ .Values.clientImage.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||
{{- include "common.warnings.rollingTag" .Values.clientImage }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "minio.volumePermissions.image" -}}
|
||||
{{- $registryName := .Values.volumePermissions.image.registry -}}
|
||||
{{- $repositoryName := .Values.volumePermissions.image.repository -}}
|
||||
{{- $tag := .Values.volumePermissions.image.tag | toString -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
|
||||
Also, we can't use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imageRegistry }}
|
||||
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "minio.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "minio.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "minio.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns the proper service account name depending if an explicit service account name is set
|
||||
in the values file. If the name is not set it will default to either minio.fullname if serviceAccount.create
|
||||
is true or default otherwise.
|
||||
*/}}
|
||||
{{- define "minio.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "minio.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -2,25 +2,25 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if .Values.deployment.updateStrategy }}
|
||||
strategy: {{ toYaml .Values.deployment.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "minio.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "minio.labels" . | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
{{- if or .Values.podAnnotations (include "minio.createSecret" .) }}
|
||||
annotations:
|
||||
{{- if (include "minio.createSecret" .) }}
|
||||
checksum/credentials-secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{- include "minio.tplValue" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
@@ -28,15 +28,20 @@ spec:
|
||||
schedulerName: {{ .Values.schedulerName }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "minio.serviceAccountName" . }}
|
||||
{{- include "minio.imagePullSecrets" . | nindent 6 }}
|
||||
{{- include "minio.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "minio.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "minio.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "minio.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
@@ -153,7 +158,7 @@ spec:
|
||||
- name: data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "minio.fullname" . }}{{- end }}
|
||||
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "common.names.fullname" . }}{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- range $key, $value := .Values.ingress.labels }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
paths:
|
||||
- path: {{ default "/" .path }}
|
||||
backend:
|
||||
serviceName: {{ include "minio.fullname" $ }}
|
||||
serviceName: {{ include "common.names.fullname" $ }}
|
||||
servicePort: minio
|
||||
{{- end }}
|
||||
tls:
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
kind: NetworkPolicy
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "minio.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
ingress:
|
||||
# Allow inbound connections
|
||||
- ports:
|
||||
@@ -18,6 +16,6 @@ spec:
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ include "minio.fullname" . }}-client: "true"
|
||||
{{ include "common.names.fullname" . }}-client: "true"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
@@ -13,5 +13,5 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{ include "minio.storageClass" . }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 2 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
access-key: {{ include "minio.accessKey" . | b64enc | quote }}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.service.annotations }}
|
||||
annotations: {{- include "minio.tplValue" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
@@ -21,4 +21,4 @@ spec:
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "minio.matchLabels" . | nindent 4 }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
|
||||
@@ -4,7 +4,7 @@ kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "minio.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
secrets:
|
||||
- name: {{ include "minio.fullname" . }}
|
||||
- name: {{ include "common.names.fullname" . }}
|
||||
{{- end }}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "minio.matchLabels" . | nindent 6 }}
|
||||
serviceName: {{ include "minio.fullname" . }}-headless
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
serviceName: {{ include "common.names.fullname" . }}-headless
|
||||
replicas: {{ .Values.statefulset.replicaCount }}
|
||||
podManagementPolicy: {{ .Values.statefulset.podManagementPolicy }}
|
||||
updateStrategy:
|
||||
@@ -20,14 +20,14 @@ spec:
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "minio.labels" . | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
{{- if or .Values.podAnnotations (include "minio.createSecret" .) }}
|
||||
annotations:
|
||||
{{- if (include "minio.createSecret" .) }}
|
||||
checksum/credentials-secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{- include "minio.tplValue" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
@@ -35,15 +35,20 @@ spec:
|
||||
schedulerName: {{ .Values.schedulerName }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "minio.serviceAccountName" . }}
|
||||
{{- include "minio.imagePullSecrets" . | nindent 6 }}
|
||||
{{- include "minio.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "minio.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "minio.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "minio.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
@@ -84,7 +89,7 @@ spec:
|
||||
- name: MINIO_SKIP_CLIENT
|
||||
value: "yes"
|
||||
- name: MINIO_DISTRIBUTED_NODES
|
||||
{{- $minioFullname := include "minio.fullname" . }}
|
||||
{{- $minioFullname := include "common.names.fullname" . }}
|
||||
{{- $minioHeadlessServiceName := printf "%s-%s" $minioFullname "headless" | trunc 63 }}
|
||||
{{- $releaseNamespace := .Release.Namespace }}
|
||||
value: {{range $i, $e := until $replicaCount }}{{ $minioFullname }}-{{ $e }}.{{ $minioHeadlessServiceName }}.{{ $releaseNamespace }}.svc.{{ $.Values.clusterDomain }},{{ end }}
|
||||
@@ -166,13 +171,13 @@ spec:
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
labels: {{- include "minio.matchLabels" . | nindent 10 }}
|
||||
labels: {{- include "common.labels.matchLabels" . | nindent 10 }}
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations: {{- include "minio.tplValue" ( dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: {{ toYaml .Values.persistence.accessModes | nindent 10 }}
|
||||
{{ include "minio.storageClass" . }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 8 }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "minio.fullname" . }}-headless
|
||||
name: {{ include "common.names.fullname" . }}-headless
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
@@ -12,5 +12,5 @@ spec:
|
||||
- name: minio
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: minio
|
||||
selector: {{- include "minio.matchLabels" . | nindent 4 }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -5,7 +5,7 @@ kind: Secret
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "minio.labels" $ | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
tls.crt: {{ .certificate | b64enc }}
|
||||
|
||||
@@ -37,11 +37,11 @@ image:
|
||||
## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging
|
||||
debug: false
|
||||
|
||||
## String to partially override minio.fullname template (will maintain the release name)
|
||||
## String to partially override common.names.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override minio.fullname template
|
||||
## String to fully override common.names.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
@@ -201,18 +201,52 @@ podAnnotations:
|
||||
prometheus.io/path: "/minio/prometheus/metric"
|
||||
prometheus.io/port: "9000"
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
## Tolerations for pod assignment. Evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ image:
|
||||
## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging
|
||||
debug: false
|
||||
|
||||
## String to partially override minio.fullname template (will maintain the release name)
|
||||
## String to partially override common.names.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override minio.fullname template
|
||||
## String to fully override common.names.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
@@ -201,18 +201,52 @@ securityContext:
|
||||
##
|
||||
podAnnotations: {}
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
## Tolerations for pod assignment. Evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
|
||||
6
bitnami/mongodb-sharded/Chart.lock
Normal file
6
bitnami/mongodb-sharded/Chart.lock
Normal file
@@ -0,0 +1,6 @@
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 1.0.1
|
||||
digest: sha256:e66388f254b9de6470bca6d8c1c565d1c16a5569beef68a7bc99e486e73ccbdb
|
||||
generated: "2020-11-26T10:27:28.274317+01:00"
|
||||
@@ -2,6 +2,12 @@ annotations:
|
||||
category: Database
|
||||
apiVersion: v2
|
||||
appVersion: 4.4.2
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
tags:
|
||||
- bitnami-common
|
||||
version: 1.x.x
|
||||
description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. Sharded topology.
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/mongodb-sharded
|
||||
@@ -20,4 +26,4 @@ name: mongodb-sharded
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-mongodb-sharded
|
||||
- https://mongodb.org
|
||||
version: 3.0.4
|
||||
version: 3.1.0
|
||||
|
||||
@@ -134,9 +134,14 @@ The following table lists the configurable parameters of the MongoDB chart and t
|
||||
| `configsvr.podLabels` | Annotations to be added to the deployment or statefulsets | `{}` |
|
||||
| `configsvr.resources` | Pod resources | `{}` |
|
||||
| `configsvr.priorityClassName` | Pod priority class name | `` |
|
||||
| `configsvr.nodeSelector` | Node labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `configsvr.affinity` | Affinity for pod assignment (evaluated as a template) | `{}` |
|
||||
| `configsvr.tolerations` | Toleration labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `configsvr.podAffinityPreset` | Config Server Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `configsvr.podAntiAffinityPreset` | Config Server Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `configsvr.nodeAffinityPreset.type` | Config Server Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `configsvr.nodeAffinityPreset.key` | Config Server Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `configsvr.nodeAffinityPreset.values` | Config Server Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `configsvr.affinity` | Config Server Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `configsvr.nodeSelector` | Config Server Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `configsvr.tolerations` | Config Server Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `configsvr.podManagementPolicy` | Statefulsets pod management policy (evaluated as a template) | `OrderedReady` |
|
||||
| `configsvr.updateStrategy` | Statefulsets update strategy policy (evaluated as a template) | `RollingUpdate` |
|
||||
| `configsvr.schedulerName` | Name of the k8s scheduler (other than default) | `nil` |
|
||||
@@ -146,7 +151,7 @@ The following table lists the configurable parameters of the MongoDB chart and t
|
||||
| `configsvr.sidecars` | Attach additional containers (evaluated as a template) | `nil` |
|
||||
| `configsvr.initContainers` | Add additional init containers (evaluated as a template) | `nil` |
|
||||
| `configsvr.config` | MongoDB configuration | `nil` |
|
||||
| `configsvr.configCM` | ConfigMap name with MongoDB configuration (cannot be used with configsvr.config) | `nil` |
|
||||
| `configsvr.configCM` | ConfigMap name with Config Server configuration (cannot be used with configsvr.config) | `nil` |
|
||||
| `configsvr.mongodbExtraFlags` | MongoDB additional command line flags | `[]` |
|
||||
| `configsvr.extraEnvVars` | Array containing extra env vars (evaluated as a template) | `nil` |
|
||||
| `configsvr.extraEnvVarsCM` | ConfigMap containing extra env vars (evaluated as a template) | `nil` |
|
||||
@@ -160,12 +165,12 @@ The following table lists the configurable parameters of the MongoDB chart and t
|
||||
| `configsvr.persistence.accessModes` | Use volume as ReadOnly or ReadWrite | `[ReadWriteOnce]` |
|
||||
| `configsvr.persistence.size` | Size of data volume | `8Gi` |
|
||||
| `configsvr.persistence.annotations` | Persistent Volume annotations | `{}` |
|
||||
| `configsvr.external.host` | Primary node of an external config server replicaset | `nil` |
|
||||
| `configsvr.external.rootPassword` | Root passworrd of the external config server replicaset | `nil` |
|
||||
| `configsvr.external.replicasetName` | Replicaset name of an external config server | `nil` |
|
||||
| `configsvr.external.replicasetKey` | Replicaset key of an external config server | `nil` |
|
||||
| `configsvr.serviceAccount.name` | Name of a Service Account to be used by configsvr | `nil` |
|
||||
| `configsvr.serviceAccount.create` | Whether to create a Service Account for configsvr automatically | `false` |
|
||||
| `configsvr.external.host` | Primary node of an external Config Server replicaset | `nil` |
|
||||
| `configsvr.external.rootPassword` | Root passworrd of the external Config Server replicaset | `nil` |
|
||||
| `configsvr.external.replicasetName` | Replicaset name of an external Config Server | `nil` |
|
||||
| `configsvr.external.replicasetKey` | Replicaset key of an external Config Server | `nil` |
|
||||
| `configsvr.serviceAccount.name` | Name of a Service Account to be used by Config Server | `nil` |
|
||||
| `configsvr.serviceAccount.create` | Whether to create a Service Account for Config Server automatically | `false` |
|
||||
|
||||
### Mongos configuration
|
||||
|
||||
@@ -176,9 +181,14 @@ The following table lists the configurable parameters of the MongoDB chart and t
|
||||
| `mongos.podLabels` | Annotations to be added to the deployment or statefulsets | `{}` |
|
||||
| `mongos.resources` | Pod resources | `{}` |
|
||||
| `mongos.priorityClassName` | Pod priority class name | `` |
|
||||
| `mongos.nodeSelector` | Node labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `mongos.affinity` | Affinity for pod assignment (evaluated as a template) | `{}` |
|
||||
| `mongos.tolerations` | Toleration labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `mongos.podAffinityPreset` | Mongos Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `mongos.podAntiAffinityPreset` | Mongos Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `mongos.nodeAffinityPreset.type` | Mongos Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `mongos.nodeAffinityPreset.key` | Mongos Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `mongos.nodeAffinityPreset.values` | Mongos Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `mongos.affinity` | Mongos Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `mongos.nodeSelector` | Mongos Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `mongos.tolerations` | Mongos Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `mongos.updateStrategy` | Statefulsets update strategy policy (evaluated as a template) | `RollingUpdate` |
|
||||
| `mongos.schedulerName` | Name of the k8s scheduler (other than default) | `nil` |
|
||||
| `mongos.pdb.enabled` | Enable pod disruption budget | `false` |
|
||||
@@ -206,10 +216,15 @@ The following table lists the configurable parameters of the MongoDB chart and t
|
||||
| `shardsvr.dataNode.podLabels` | Annotations to be added to the deployment or statefulsets | `{}` |
|
||||
| `shardsvr.dataNode.resources` | Pod resources | `{}` |
|
||||
| `shardsvr.dataNode.priorityClassName` | Pod priority class name | `` |
|
||||
| `shardsvr.dataNode.nodeSelector` | Node labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `shardsvr.dataNode.affinity` | Affinity for pod assignment (evaluated as a template). Will include `.arbiterLoopId` which identifies the shard. | `{}` |
|
||||
| `shardsvr.dataNode.tolerations` | Toleration labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `shardsvr.dataNode.podManagementPolicy` | Statefulsets pod management policy (evaluated as a template) | `OrderedReady` |
|
||||
| `shardsvr.dataNode.podAffinityPreset` | Data nodes Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `shardsvr.dataNode.podAntiAffinityPreset` | Data nodes Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `shardsvr.dataNode.nodeAffinityPreset.type` | Data nodes Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `shardsvr.dataNode.nodeAffinityPreset.key` | Data nodes Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `shardsvr.dataNode.nodeAffinityPreset.values` | Data nodes Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `shardsvr.dataNode.affinity` | Data nodes Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `shardsvr.dataNode.nodeSelector` | Data nodes Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `shardsvr.dataNode.tolerations` | Data nodes Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `shardsvr.dataNode.podManagementPolicy` | Statefulsets pod management policy (evaluated as a template) | `OrderedReady` |
|
||||
| `shardsvr.dataNode.updateStrategy` | Statefulsets update strategy policy (evaluated as a template) | `RollingUpdate` |
|
||||
| `shardsvr.dataNode.schedulerName` | Name of the k8s scheduler (other than default) | `nil` |
|
||||
| `shardsvr.dataNode.pdb.enabled` | Enable pod disruption budget | `false` |
|
||||
@@ -244,9 +259,14 @@ The following table lists the configurable parameters of the MongoDB chart and t
|
||||
| `shardsvr.arbiter.podLabels` | Annotations to be added to the deployment or statefulsets | `{}` |
|
||||
| `shardsvr.arbiter.resources` | Pod resources | `{}` |
|
||||
| `shardsvr.arbiter.priorityClassName` | Pod priority class name | `` |
|
||||
| `shardsvr.arbiter.nodeSelector` | Node labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `shardsvr.arbiter.affinity` | Affinity for pod assignment (evaluated as a template). Will include `.arbiterLoopId` which identifies the shard. | `{}` |
|
||||
| `shardsvr.arbiter.tolerations` | Toleration labels for pod assignment (evaluated as a template) | `{}` |
|
||||
| `shardsvr.arbiter.podAffinityPreset` | Arbiters Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `shardsvr.arbiter.podAntiAffinityPreset` | Arbiters Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `shardsvr.arbiter.nodeAffinityPreset.type` | Arbiters Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `shardsvr.arbiter.nodeAffinityPreset.key` | Arbiters Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `shardsvr.arbiter.nodeAffinityPreset.values` | Arbiters Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `shardsvr.arbiter.affinity` | Arbiters Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `shardsvr.arbiter.nodeSelector` | Arbiters Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `shardsvr.arbiter.tolerations` | Arbiters Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `shardsvr.arbiter.podManagementPolicy` | Statefulsets pod management policy (evaluated as a template) | `OrderedReady` |
|
||||
| `shardsvr.arbiter.updateStrategy` | Statefulsets update strategy policy (evaluated as a template) | `RollingUpdate` |
|
||||
| `shardsvr.arbiter.schedulerName` | Name of the k8s scheduler (other than default) | `nil` |
|
||||
@@ -432,6 +452,12 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru
|
||||
|
||||
The Bitnami Kibana chart supports mounting extra volumes (either PVCs, secrets or configmaps) by using the `extraVolumes` and `extraVolumeMounts` properties (available in the `mongos`, `shardsvr.dataNode`, `shardsvr.arbiter`, `configsvr` and `common` sections). This can be combined with advanced operations like adding extra init containers and sidecars.
|
||||
|
||||
### Setting Pod's affinity
|
||||
|
||||
This chart allows you to set your custom affinity using the `XXX.affinity` paremeter(s). Find more infomation about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||
|
||||
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `XXX.podAffinityPreset`, `XXX.podAntiAffinityPreset`, or `XXX.nodeAffinityPreset` parameters.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||
@@ -446,6 +472,10 @@ $ helm upgrade my-release bitnami/mongodb-sharded --set mongodbRootPassword=[PAS
|
||||
|
||||
> Note: you need to substitute the placeholders [PASSWORD] and [REPLICASETKEY] with the values obtained in the installation notes.
|
||||
|
||||
### To 3.1.0
|
||||
|
||||
This version introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||
|
||||
### To 3.0.0
|
||||
|
||||
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||
|
||||
@@ -6,21 +6,21 @@ The MongoDB Sharded cluster can be accessed via the Mongos instances in port {{
|
||||
|
||||
To get the root password run:
|
||||
|
||||
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "mongodb-sharded.fullname" . }} -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
|
||||
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
|
||||
|
||||
{{- if and .Values.mongodbUsername .Values.mongodbDatabase }}
|
||||
{{- if .Values.mongodbPassword }}
|
||||
|
||||
To get the password for "{{ .Values.mongodbUsername }}" run:
|
||||
|
||||
export MONGODB_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "mongodb-sharded.fullname" . }} -o jsonpath="{.data.mongodb-password}" | base64 --decode)
|
||||
export MONGODB_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mongodb-password}" | base64 --decode)
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
To connect to your database run the following command:
|
||||
|
||||
kubectl run --namespace {{ .Release.Namespace }} {{ include "mongodb-sharded.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mongodb-sharded.image" . }} --command -- mongo admin --host {{ include "mongodb-sharded.serviceName" . }} {{- if .Values.usePassword }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
kubectl run --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mongodb-sharded.image" . }} --command -- mongo admin --host {{ include "mongodb-sharded.serviceName" . }} {{- if .Values.usePassword }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
|
||||
To connect to your database from outside the cluster execute the following commands:
|
||||
|
||||
@@ -46,10 +46,4 @@ To connect to your database from outside the cluster execute the following comma
|
||||
{{- end }}
|
||||
|
||||
{{- include "mongodb-sharded.validateValues" . -}}
|
||||
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
|
||||
{{- end }}
|
||||
{{- include "mongodb-sharded.checkRollingTags" . -}}
|
||||
|
||||
@@ -1,54 +1,16 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "mongodb-sharded.name" . }}
|
||||
helm.sh/chart: {{ include "mongodb-sharded.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "mongodb-sharded.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "mongodb-sharded.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns a ServiceAccount name for specified path or falls back to `common.serviceAccount.name`
|
||||
if `common.serviceAccount.create` is set to true. Falls back to Chart's fullname otherwise.
|
||||
|
||||
Usage:
|
||||
{{ include "mongodb-sharded.serviceAccountName" (dict "value" .Values.path.to.serviceAccount "context" $) }}
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.serviceAccountName" -}}
|
||||
{{- if .value.create }}
|
||||
{{- default (include "mongodb-sharded.fullname" .context) .value.name | quote }}
|
||||
{{- default (include "common.names.fullname" .context) .value.name | quote }}
|
||||
{{- else if .context.Values.common.serviceAccount.create }}
|
||||
{{- default (include "mongodb-sharded.fullname" .context) .context.Values.common.serviceAccount.name | quote }}
|
||||
{{- default (include "common.names.fullname" .context) .context.Values.common.serviceAccount.name | quote }}
|
||||
{{- else -}}
|
||||
{{- default "default" .value.name | quote }}
|
||||
{{- end }}
|
||||
@@ -66,41 +28,16 @@ kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.serviceAccountName" (dict "value" .value "context" .context) }}
|
||||
labels:
|
||||
{{- include "mongodb-sharded.labels" .context | nindent 4 }}
|
||||
{{- include "common.labels.standard" .context | nindent 4 }}
|
||||
---
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "mongodb-sharded.secret" -}}
|
||||
{{- if .Values.existingSecret -}}
|
||||
{{- .Values.existingSecret -}}
|
||||
{{- else }}
|
||||
{{- include "mongodb-sharded.fullname" . -}}
|
||||
{{- include "common.names.fullname" . -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -108,7 +45,7 @@ Create chart name and version as used by the chart label.
|
||||
{{- if .Values.configsvr.external.host -}}
|
||||
{{- .Values.configsvr.external.host }}
|
||||
{{- else -}}
|
||||
{{- printf "%s-configsvr-0.%s-headless.%s.svc.%s" (include "mongodb-sharded.fullname" . ) (include "mongodb-sharded.fullname" .) .Release.Namespace .Values.clusterDomain -}}
|
||||
{{- printf "%s-configsvr-0.%s-headless.%s.svc.%s" (include "common.names.fullname" . ) (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -116,7 +53,7 @@ Create chart name and version as used by the chart label.
|
||||
{{- if .Values.configsvr.external.replicasetName -}}
|
||||
{{- .Values.configsvr.external.replicasetName }}
|
||||
{{- else }}
|
||||
{{- printf "%s-configsvr" ( include "mongodb-sharded.fullname" . ) -}}
|
||||
{{- printf "%s-configsvr" ( include "common.names.fullname" . ) -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -124,7 +61,7 @@ Create chart name and version as used by the chart label.
|
||||
{{- if .Values.mongos.configCM -}}
|
||||
{{- .Values.mongos.configCM -}}
|
||||
{{- else }}
|
||||
{{- printf "%s-mongos" (include "mongodb-sharded.fullname" .) -}}
|
||||
{{- printf "%s-mongos" (include "common.names.fullname" .) -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -132,7 +69,7 @@ Create chart name and version as used by the chart label.
|
||||
{{- if .Values.shardsvr.dataNode.configCM -}}
|
||||
{{- .Values.shardsvr.dataNode.configCM -}}
|
||||
{{- else }}
|
||||
{{- printf "%s-shardsvr-data" (include "mongodb-sharded.fullname" .) -}}
|
||||
{{- printf "%s-shardsvr-data" (include "common.names.fullname" .) -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -140,7 +77,7 @@ Create chart name and version as used by the chart label.
|
||||
{{- if .Values.shardsvr.arbiter.configCM -}}
|
||||
{{- .Values.shardsvr.arbiter.configCM -}}
|
||||
{{- else }}
|
||||
{{- printf "%s-shardsvr-arbiter" (include "mongodb-sharded.fullname" .) -}}
|
||||
{{- printf "%s-shardsvr-arbiter" (include "common.names.fullname" .) -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -148,7 +85,7 @@ Create chart name and version as used by the chart label.
|
||||
{{- if .Values.configsvr.configCM -}}
|
||||
{{- .Values.configsvr.configCM -}}
|
||||
{{- else }}
|
||||
{{- printf "%s-configsvr" (include "mongodb-sharded.fullname" .) -}}
|
||||
{{- printf "%s-configsvr" (include "common.names.fullname" .) -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -156,14 +93,14 @@ Create chart name and version as used by the chart label.
|
||||
Get the initialization scripts Secret name.
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.initScriptsSecret" -}}
|
||||
{{- printf "%s" (include "mongodb-sharded.tplValue" (dict "value" .Values.common.initScriptsSecret "context" $)) -}}
|
||||
{{- printf "%s" (include "common.tplvalues.render" (dict "value" .Values.common.initScriptsSecret "context" $)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the initialization scripts configmap name.
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.initScriptsCM" -}}
|
||||
{{- printf "%s" (include "mongodb-sharded.tplValue" (dict "value" .Values.common.initScriptsCM "context" $)) -}}
|
||||
{{- printf "%s" (include "common.tplvalues.render" (dict "value" .Values.common.initScriptsCM "context" $)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
@@ -173,7 +110,7 @@ Create the name for the admin secret.
|
||||
{{- if .Values.auth.existingAdminSecret -}}
|
||||
{{- .Values.auth.existingAdminSecret -}}
|
||||
{{- else -}}
|
||||
{{- include "mongodb-sharded.fullname" . -}}-admin
|
||||
{{- include "common.names.fullname" . -}}-admin
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -184,7 +121,19 @@ Create the name for the key secret.
|
||||
{{- if .Values.auth.existingKeySecret -}}
|
||||
{{- .Values.auth.existingKeySecret -}}
|
||||
{{- else -}}
|
||||
{{- include "mongodb-sharded.fullname" . -}}-keyfile
|
||||
{{- include "common.names.fullname" . -}}-keyfile
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns the proper Service name depending if an explicit service name is set
|
||||
in the values file. If the name is not explicitly set it will take the "common.names.fullname"
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.serviceName" -}}
|
||||
{{- if .Values.service.name -}}
|
||||
{{ .Values.service.name }}
|
||||
{{- else -}}
|
||||
{{ include "common.names.fullname" .}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -192,87 +141,28 @@ Create the name for the key secret.
|
||||
Return the proper MongoDB image name
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.image.tag | toString -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
|
||||
Also, we can't use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imageRegistry }}
|
||||
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the metrics image)
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.metrics.image" -}}
|
||||
{{- $registryName := .Values.metrics.image.registry -}}
|
||||
{{- $repositoryName := .Values.metrics.image.repository -}}
|
||||
{{- $tag := .Values.metrics.image.tag | toString -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
|
||||
Also, we can't use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imageRegistry }}
|
||||
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- $imagePullSecrets := coalesce .Values.global.imagePullSecrets .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets .Values.metrics.image.pullSecrets -}}
|
||||
{{- if $imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range $imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.volumePermissions.image" -}}
|
||||
{{- $registryName := .Values.volumePermissions.image.registry -}}
|
||||
{{- $repositoryName := .Values.volumePermissions.image.repository -}}
|
||||
{{- $tag := .Values.volumePermissions.image.tag | toString -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
|
||||
Also, we can't use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imageRegistry }}
|
||||
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.imagePullSecrets" -}}
|
||||
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image) "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
@@ -368,84 +258,8 @@ mongodb: configSvrNodeConflictingConfig
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.shardsvr.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.shardsvr.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.shardsvr.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.shardsvr.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.shardsvr.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.shardsvr.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.shardsvr.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.configsvr.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.configsvr.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.configsvr.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.configsvr.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.configsvr.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.configsvr.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.configsvr.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns the proper Service name depending if an explicit service name is set
|
||||
in the values file. If the name is not explicitly set it will take the "mongodb-sharded.fullname"
|
||||
*/}}
|
||||
{{- define "mongodb-sharded.serviceName" -}}
|
||||
{{- if .Values.service.name -}}
|
||||
{{ .Values.service.name }}
|
||||
{{- else -}}
|
||||
{{ include "mongodb-sharded.fullname" .}}
|
||||
{{- end -}}
|
||||
{{/* Check if there are rolling tags in the images */}}
|
||||
{{- define "mongodb-sharded.checkRollingTags" -}}
|
||||
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-configsvr
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-configsvr
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: configsvr
|
||||
data:
|
||||
mongodb.conf: |-
|
||||
{{- include "mongodb-sharded.tplValue" (dict "value" .Values.configsvr.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.configsvr.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
kind: PodDisruptionBudget
|
||||
apiVersion: policy/v1beta1
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-configsvr
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-configsvr
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: configsvr
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: configsvr
|
||||
{{- if .Values.configsvr.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.configsvr.pdb.minAvailable | int }}
|
||||
|
||||
@@ -2,34 +2,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-configsvr
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-configsvr
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: configsvr
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: configsvr
|
||||
serviceName: {{ include "mongodb-sharded.fullname" . }}-headless
|
||||
serviceName: {{ include "common.names.fullname" . }}-headless
|
||||
replicas: {{ .Values.configsvr.replicas }}
|
||||
podManagementPolicy: {{ .Values.configsvr.podManagementPolicy }}
|
||||
updateStrategy: {{- toYaml .Values.configsvr.updateStrategy | nindent 4 }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app.kubernetes.io/component: configsvr
|
||||
{{- if $.Values.configsvr.podLabels }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.configsvr.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.configsvr.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.common.podAnnotations .Values.configsvr.podAnnotations .Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if .Values.common.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.configsvr.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.configsvr.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
@@ -37,9 +37,20 @@ spec:
|
||||
schedulerName: {{ .Values.common.schedulerName | quote }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" .Values.configsvr.serviceAccount "context" $) }}
|
||||
nodeSelector: {{- include "mongodb-sharded.tplValue" ( dict "value" .Values.configsvr.nodeSelector "context" $ ) | nindent 8 }}
|
||||
affinity: {{- include "mongodb-sharded.tplValue" ( dict "value" .Values.configsvr.affinity "context" $ ) | nindent 8 }}
|
||||
tolerations: {{- include "mongodb-sharded.tplValue" ( dict "value" .Values.configsvr.tolerations "context" $ ) | nindent 8 }}
|
||||
{{- if .Values.configsvr.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.configsvr.podAffinityPreset "component" "configsvr" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.configsvr.podAntiAffinityPreset "component" "configsvr" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.configsvr.nodeAffinityPreset.type "key" .Values.configsvr.nodeAffinityPreset.key "values" .Values.configsvr.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
@@ -59,10 +70,10 @@ spec:
|
||||
mountPath: {{ .Values.configsvr.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- with $.Values.configsvr.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: mongodb
|
||||
@@ -100,10 +111,10 @@ spec:
|
||||
- name: MONGODB_INITIAL_PRIMARY_HOST
|
||||
value: {{ include "mongodb-sharded.configServer.primaryHost" . }}
|
||||
- name: MONGODB_REPLICA_SET_NAME
|
||||
value: {{ printf "%s-configsvr" ( include "mongodb-sharded.fullname" . ) }}
|
||||
value: {{ printf "%s-configsvr" ( include "common.names.fullname" . ) }}
|
||||
{{- if .Values.common.useHostnames }}
|
||||
- name: MONGODB_ADVERTISED_HOSTNAME
|
||||
value: "$(MONGODB_POD_NAME).{{ include "mongodb-sharded.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
{{- end }}
|
||||
{{- if .Values.usePasswordFile }}
|
||||
- name: MONGODB_ROOT_PASSWORD_FILE
|
||||
@@ -139,28 +150,28 @@ spec:
|
||||
value: {{ .Values.configsvr.mongodbExtraFlags | join " " | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.common.extraEnvVars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.extraEnvVars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.configsvr.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.configsvr.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.common.extraEnvVarsCM .Values.common.extraEnvVarsSecret .Values.configsvr.extraEnvVarsCM .Values.configsvr.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.common.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if .Values.common.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.configsvr.extraEnvVarsCM "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.configsvr.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.extraEnvVarsSecret }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.configsvr.extraEnvVarsSecret "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.configsvr.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
command:
|
||||
@@ -213,10 +224,10 @@ spec:
|
||||
mountPath: /docker-entrypoint-initdb.d/secret
|
||||
{{- end }}
|
||||
{{- if .Values.common.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.configsvr.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.configsvr.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
resources: {{- toYaml .Values.configsvr.resources | nindent 12 }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
@@ -281,15 +292,15 @@ spec:
|
||||
resources: {{ toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.configsvr.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: replicaset-entrypoint-configmap
|
||||
configMap:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-replicaset-entrypoint
|
||||
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint
|
||||
{{- if .Values.usePasswordFile }}
|
||||
- name: secrets
|
||||
secret:
|
||||
@@ -313,10 +324,10 @@ spec:
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if .Values.common.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.configsvr.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.configsvr.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
@@ -334,7 +345,7 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.configsvr.persistence.size | quote }}
|
||||
{{ include "mongodb-sharded.configsvr.storageClass" . }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.configsvr.persistence "global" .Values.global) | nindent 8 }}
|
||||
{{- else }}
|
||||
- name: datadir
|
||||
emptyDir: {}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-headless
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
annotations: {{- include "mongodb-sharded.tplValue" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-headless
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
@@ -11,6 +11,6 @@ spec:
|
||||
- name: mongodb
|
||||
port: {{ .Values.service.port }}
|
||||
{{- if .Values.service.extraPorts }}
|
||||
{{- include "mongodb-sharded.tplValue" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{ include "mongodb-sharded.matchLabels" . | nindent 4 }}
|
||||
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-mongos
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-mongos
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
data:
|
||||
mongodb.conf: |-
|
||||
{{- include "mongodb-sharded.tplValue" (dict "value" .Values.mongos.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.mongos.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-mongos
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-mongos
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
spec:
|
||||
strategy: {{- toYaml .Values.mongos.updateStrategy | nindent 4 }}
|
||||
replicas: {{ .Values.mongos.replicas }}
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
{{- if .Values.mongos.podLabels }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.mongos.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.mongos.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.common.podAnnotations .Values.mongos.podAnnotations .Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if .Values.common.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mongos.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.mongos.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.mongos.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
@@ -34,9 +34,20 @@ spec:
|
||||
schedulerName: {{ .Values.common.schedulerName | quote }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.mongos.serviceAccount "context" $) }}
|
||||
nodeSelector: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.mongos.nodeSelector "context" $ ) | nindent 8 }}
|
||||
affinity: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.mongos.affinity "context" $ ) | nindent 8 }}
|
||||
tolerations: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.mongos.tolerations "context" $ ) | nindent 8 }}
|
||||
{{- if .Values.mongos.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.mongos.podAffinityPreset "component" "mongos" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.mongos.podAntiAffinityPreset "component" "mongos" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.mongos.nodeAffinityPreset.type "key" .Values.mongos.nodeAffinityPreset.key "values" .Values.mongos.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mongos.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mongos.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
@@ -45,10 +56,10 @@ spec:
|
||||
{{- if or (ge (len $.Values.mongos.initContainers) 1) (ge (len $.Values.common.initContainers) 1) }}
|
||||
initContainers:
|
||||
{{- with $.Values.mongos.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
@@ -123,28 +134,28 @@ spec:
|
||||
value: {{ .Values.mongos.mongodbExtraFlags | join " " | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.common.extraEnvVars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mongos.extraEnvVars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.mongos.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.mongos.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.common.extraEnvVarsCM .Values.common.extraEnvVarsSecret .Values.mongos.extraEnvVarsCM .Values.mongos.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.common.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if .Values.common.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if .Values.configsvr.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.mongos.extraEnvVarsCM "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.mongos.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if .Values.mongos.extraEnvVarsSecret }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" .Values.mongos.extraEnvVarsSecret "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" .Values.mongos.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
@@ -186,10 +197,10 @@ spec:
|
||||
mountPath: /bitnami/mongodb/conf/
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.mongos.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.mongos.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.mongos.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
resources: {{- toYaml .Values.mongos.resources | nindent 12 }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
@@ -254,10 +265,10 @@ spec:
|
||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.mongos.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.usePasswordFile }}
|
||||
@@ -271,8 +282,8 @@ spec:
|
||||
name: {{ include "mongodb-sharded.mongos.configCM" . }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.mongos.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.mongos.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.mongos.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
kind: PodDisruptionBudget
|
||||
apiVersion: policy/v1beta1
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-mongos
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-mongos
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
{{- if .Values.mongos.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.mongos.pdb.minAvailable | int }}
|
||||
|
||||
@@ -2,9 +2,9 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.serviceName" . }}
|
||||
labels: {{ include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
labels: {{ include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
annotations: {{- include "mongodb-sharded.tplValue" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }}
|
||||
@@ -34,8 +34,8 @@ spec:
|
||||
targetPort: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.service.extraPorts }}
|
||||
{{- include "mongodb-sharded.tplValue" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{ include "mongodb-sharded.matchLabels" . | nindent 4 }}
|
||||
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mongos
|
||||
sessionAffinity: {{ default "None" .Values.service.sessionAffinity }}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-replicaset-entrypoint
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
data:
|
||||
replicaset-entrypoint.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}
|
||||
labels: {{- include "mongodb-sharded.labels" $ | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if .Values.configsvr.external.rootPassword }}
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "mongodb-sharded.fullname" . }}
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" . | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
endpoints:
|
||||
- port: metrics
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-shardsvr-arbiter
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-shardsvr-arbiter
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
data:
|
||||
mongodb.conf: |-
|
||||
{{- include "mongodb-sharded.tplValue" (dict "value" .Values.shardsvr.arbiter.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.arbiter.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -4,35 +4,35 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-arbiter" (include "mongodb-sharded.fullname" $ ) $i }}
|
||||
labels: {{- include "mongodb-sharded.labels" $ | nindent 4 }}
|
||||
name: {{ printf "%s-shard%d-arbiter" (include "common.names.fullname" $ ) $i }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" $ | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
podManagementPolicy: {{ $.Values.shardsvr.arbiter.podManagementPolicy }}
|
||||
updateStrategy: {{- toYaml $.Values.shardsvr.arbiter.updateStrategy | nindent 4 }}
|
||||
serviceName: {{ include "mongodb-sharded.fullname" $ }}-headless
|
||||
serviceName: {{ include "common.names.fullname" $ }}-headless
|
||||
replicas: {{ $.Values.shardsvr.arbiter.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "mongodb-sharded.labels" $ | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 8 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
{{- if $.Values.shardsvr.arbiter.podLabels }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
shard: {{ $i | quote }}
|
||||
{{- if or $.Values.common.podAnnotations $.Values.shardsvr.arbiter.podAnnotations $.Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if $.Values.common.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
@@ -40,9 +40,20 @@ spec:
|
||||
{{- if $.Values.common.schedulerName }}
|
||||
schedulerName: {{ $.Values.common.schedulerName | quote }}
|
||||
{{- end }}
|
||||
nodeSelector: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.nodeSelector "context" $ ) | nindent 8 }}
|
||||
affinity: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.affinity "context" (set $ "arbiterLoopId" $i) ) | nindent 8 }}
|
||||
tolerations: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.tolerations "context" $ ) | nindent 8 }}
|
||||
{{- if $.Values.shardsvr.arbiter.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.arbiter.podAffinityPreset "component" "shardsvr-arbiter" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.arbiter.podAntiAffinityPreset "component" "shardsvr-arbiter" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $.Values.shardsvr.arbiter.nodeAffinityPreset.type "key" $.Values.shardsvr.arbiter.nodeAffinityPreset.key "values" $.Values.shardsvr.arbiter.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ $.Values.securityContext.fsGroup }}
|
||||
@@ -51,10 +62,10 @@ spec:
|
||||
{{- if or (ge (len $.Values.shardsvr.arbiter.initContainers) 1) (ge (len $.Values.common.initContainers) 1) }}
|
||||
initContainers:
|
||||
{{- with $.Values.shardsvr.arbiter.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
@@ -93,12 +104,12 @@ spec:
|
||||
- name: MONGODB_REPLICA_SET_MODE
|
||||
value: "arbiter"
|
||||
- name: MONGODB_INITIAL_PRIMARY_HOST
|
||||
value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "mongodb-sharded.fullname" $ ) $i (include "mongodb-sharded.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }}
|
||||
value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "common.names.fullname" $ ) $i (include "common.names.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }}
|
||||
- name: MONGODB_REPLICA_SET_NAME
|
||||
value: {{ printf "%s-shard-%d" ( include "mongodb-sharded.fullname" $ ) $i }}
|
||||
value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }}
|
||||
{{- if $.Values.common.useHostnames }}
|
||||
- name: MONGODB_ADVERTISED_HOSTNAME
|
||||
value: "$(MONGODB_POD_NAME).{{ include "mongodb-sharded.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}"
|
||||
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}"
|
||||
{{- end }}
|
||||
- name: MONGODB_ENABLE_IPV6
|
||||
{{- if $.Values.common.mongodbEnableIPv6 }}
|
||||
@@ -137,19 +148,19 @@ spec:
|
||||
envFrom:
|
||||
{{- if $.Values.common.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVarsCM "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraEnvVarsSecret }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVarsSecret "context" $ ) }}
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $.Values.livenessProbe.enabled }}
|
||||
@@ -190,10 +201,10 @@ spec:
|
||||
mountPath: /docker-entrypoint-initdb.d/secret
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
resources: {{- toYaml $.Values.shardsvr.arbiter.resources | nindent 12 }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
@@ -258,10 +269,10 @@ spec:
|
||||
resources: {{ toYaml $.Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.shardsvr.arbiter.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if or $.Values.shardsvr.arbiter.config $.Values.shardsvr.arbiter.configCM }}
|
||||
@@ -287,10 +298,10 @@ spec:
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.arbiter.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if lt $i (sub $replicas 1) }}
|
||||
---
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mongodb-sharded.fullname" . }}-shardsvr-data
|
||||
labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
|
||||
name: {{ include "common.names.fullname" . }}-shardsvr-data
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
data:
|
||||
mongodb.conf: |-
|
||||
{{- include "mongodb-sharded.tplValue" (dict "value" .Values.shardsvr.dataNode.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.dataNode.config "context" $) | indent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
kind: PodDisruptionBudget
|
||||
apiVersion: policy/v1beta1
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-data" (include "mongodb-sharded.fullname" $ ) $i }}
|
||||
labels: {{- include "mongodb-sharded.labels" $ | nindent 4 }}
|
||||
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" $ | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
shard: {{ $i | quote }}
|
||||
{{- if $.Values.shardsvr.dataNode.pdb.minAvailable }}
|
||||
|
||||
@@ -4,44 +4,55 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-data" (include "mongodb-sharded.fullname" $ ) $i }}
|
||||
labels: {{- include "mongodb-sharded.labels" $ | nindent 4 }}
|
||||
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "mongodb-sharded.matchLabels" $ | nindent 6 }}
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
podManagementPolicy: {{ $.Values.shardsvr.dataNode.podManagementPolicy }}
|
||||
updateStrategy: {{- toYaml $.Values.shardsvr.dataNode.updateStrategy | nindent 4 }}
|
||||
serviceName: {{ include "mongodb-sharded.fullname" $ }}-headless
|
||||
serviceName: {{ include "common.names.fullname" $ }}-headless
|
||||
replicas: {{ $.Values.shardsvr.dataNode.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "mongodb-sharded.labels" $ | nindent 8 }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 8 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
{{- if $.Values.shardsvr.dataNode.podLabels }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
shard: {{ $i | quote }}
|
||||
{{- if or $.Values.common.podAnnotations $.Values.shardsvr.dataNode.podAnnotations $.Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if $.Values.common.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.podAnnotations }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if $.Values.common.schedulerName }}
|
||||
schedulerName: {{ $.Values.common.schedulerName | quote }}
|
||||
{{- end }}
|
||||
nodeSelector: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.nodeSelector "context" $ ) | nindent 8 }}
|
||||
affinity: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.affinity "context" (set $ "dataNodeLoopId" $i) ) | nindent 8 }}
|
||||
tolerations: {{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.tolerations "context" $ ) | nindent 8 }}
|
||||
{{- if $.Values.shardsvr.dataNode.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.dataNode.podAffinityPreset "component" "shardsvr" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.dataNode.podAntiAffinityPreset "component" "shardsvr" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $.Values.shardsvr.dataNode.nodeAffinityPreset.type "key" $.Values.shardsvr.dataNode.nodeAffinityPreset.key "values" $.Values.shardsvr.dataNode.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.shardsvr.dataNode.serviceAccount "context" $) }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
@@ -62,10 +73,10 @@ spec:
|
||||
mountPath: {{ $.Values.shardsvr.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- with $.Values.shardsvr.dataNode.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.initContainers }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: mongodb
|
||||
@@ -101,14 +112,14 @@ spec:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: MONGODB_MONGOS_HOST
|
||||
value: {{ include "mongodb-sharded.fullname" $ }}
|
||||
value: {{ include "common.names.fullname" $ }}
|
||||
- name: MONGODB_INITIAL_PRIMARY_HOST
|
||||
value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "mongodb-sharded.fullname" $ ) $i (include "mongodb-sharded.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }}
|
||||
value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "common.names.fullname" $ ) $i (include "common.names.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }}
|
||||
- name: MONGODB_REPLICA_SET_NAME
|
||||
value: {{ printf "%s-shard-%d" ( include "mongodb-sharded.fullname" $ ) $i }}
|
||||
value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }}
|
||||
{{- if $.Values.common.useHostnames }}
|
||||
- name: MONGODB_ADVERTISED_HOSTNAME
|
||||
value: "$(MONGODB_POD_NAME).{{ include "mongodb-sharded.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}"
|
||||
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}"
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: MONGODB_ROOT_PASSWORD_FILE
|
||||
@@ -193,10 +204,10 @@ spec:
|
||||
mountPath: /docker-entrypoint-initdb.d/secret
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraVolumeMounts }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
resources: {{- toYaml $.Values.shardsvr.dataNode.resources | nindent 12 }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
@@ -261,15 +272,15 @@ spec:
|
||||
resources: {{ toYaml $.Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.shardsvr.dataNode.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.sidecars }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8}}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: replicaset-entrypoint-configmap
|
||||
configMap:
|
||||
name: {{ include "mongodb-sharded.fullname" $ }}-replicaset-entrypoint
|
||||
name: {{ include "common.names.fullname" $ }}-replicaset-entrypoint
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: secrets
|
||||
secret:
|
||||
@@ -293,10 +304,10 @@ spec:
|
||||
name: {{ include "mongodb-sharded.shardsvr.dataNode.configCM" $ }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraVolumes }}
|
||||
{{- include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
@@ -314,7 +325,7 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $.Values.shardsvr.persistence.size | quote }}
|
||||
{{- include "mongodb-sharded.shardsvr.storageClass" $ | nindent 8}}
|
||||
{{- include "common.storage.class" (dict "persistence" $.Values.shardsvr.persistence "global" $.Values.global) | nindent 8 }}
|
||||
{{- else }}
|
||||
- name: datadir
|
||||
emptyDir: {}
|
||||
|
||||
@@ -120,15 +120,46 @@ shardsvr:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: shardsvr.dataNode.podAffinityPreset, shardsvr.dataNode.podAntiAffinityPreset, and shardsvr.dataNode.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
@@ -244,15 +275,46 @@ shardsvr:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: shardsvr.arbiter.podAffinityPreset, shardsvr.arbiter.podAntiAffinityPreset, and shardsvr.arbiter.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
@@ -390,15 +452,46 @@ configsvr:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: configsvr.podAffinityPreset, configsvr.podAntiAffinityPreset, and configsvr.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
@@ -562,15 +655,46 @@ mongos:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: mongos.podAffinityPreset, mongos.podAntiAffinityPreset, and mongos.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
@@ -100,15 +100,46 @@ shardsvr:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: shardsvr.dataNode.podAffinityPreset, shardsvr.dataNode.podAntiAffinityPreset, and shardsvr.dataNode.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
@@ -224,15 +255,46 @@ shardsvr:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: shardsvr.arbiter.podAffinityPreset, shardsvr.arbiter.podAntiAffinityPreset, and shardsvr.arbiter.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
@@ -370,15 +432,46 @@ configsvr:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: configsvr.podAffinityPreset, configsvr.podAntiAffinityPreset, and configsvr.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
@@ -542,15 +635,46 @@ mongos:
|
||||
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName:
|
||||
## Node selector
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Affinity
|
||||
podAffinityPreset: ""
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: mongos.podAffinityPreset, mongos.podAntiAffinityPreset, and mongos.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
## Tolerations
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 1.0.0
|
||||
digest: sha256:a2093836b2b6a85d7bf34143d3159b5c413c5e7423bde212de9cb416c985b976
|
||||
generated: "2020-11-10T23:25:28.110724755Z"
|
||||
version: 1.0.1
|
||||
digest: sha256:e66388f254b9de6470bca6d8c1c565d1c16a5569beef68a7bc99e486e73ccbdb
|
||||
generated: "2020-11-26T09:50:33.33661+01:00"
|
||||
|
||||
@@ -26,4 +26,4 @@ name: mongodb
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-mongodb
|
||||
- https://mongodb.org
|
||||
version: 10.0.5
|
||||
version: 10.1.0
|
||||
|
||||
@@ -70,7 +70,7 @@ The standalone architecture installs a deployment (or statefulset) with one Mong
|
||||
|
||||
The chart supports the replicaset architecture with and without a [MongoDB Arbiter](https://docs.mongodb.com/manual/core/replica-set-arbiter/):
|
||||
|
||||
* When the MongoDB Arbiter is enabled, the chart installs two statefulsets: A statefulset with N MongoDB servers (organised with one primary and N-1 secondary nodes), and a statefulset with one MongoDB arbiter node (it cannot be scaled).
|
||||
- When the MongoDB Arbiter is enabled, the chart installs two statefulsets: A statefulset with N MongoDB servers (organised with one primary and N-1 secondary nodes), and a statefulset with one MongoDB arbiter node (it cannot be scaled).
|
||||
|
||||
```
|
||||
┌────────────────┐ ┌────────────────┐ ┌────────────────┐ ┌─────────────┐
|
||||
@@ -91,7 +91,7 @@ The chart supports the replicaset architecture with and without a [MongoDB Arbit
|
||||
|
||||
_Note:_ An update takes your MongoDB replicaset offline if the Arbiter is enabled and the number of MongoDB replicas is two. Helm applies updates to the statefulsets for the MongoDB instance _and_ the Arbiter at the same time so you loose two out of three quorum votes.
|
||||
|
||||
* Without the Arbiter, the chart deploys a single statefulset with N MongoDB servers (organised with one primary and N-1 secondary nodes)
|
||||
- Without the Arbiter, the chart deploys a single statefulset with N MongoDB servers (organised with one primary and N-1 secondary nodes)
|
||||
|
||||
```
|
||||
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
|
||||
@@ -152,7 +152,7 @@ The following tables lists the configurable parameters of the MongoDB chart and
|
||||
| `auth.password` | MongoDB custom user password | _random 10 character long alphanumeric string_ |
|
||||
| `auth.database` | MongoDB custom database | `nil` |
|
||||
| `auth.replicaSetKey` | Key used for authentication in the replicaset (only when `architecture=replicaset`) | _random 10 character long alphanumeric string_ |
|
||||
| `auth.existingSecret` | Existing secret with MongoDB credentials (keys: `mongodb-password`, `mongodb-root-password`, ` mongodb-replica-set-key`) | `nil` |
|
||||
| `auth.existingSecret` | Existing secret with MongoDB credentials (keys: `mongodb-password`, `mongodb-root-password`, ` mongodb-replica-set-key`) | `nil` |
|
||||
| `replicaSetName` | Name of the replica set (only when `architecture=replicaset`) | `rs0` |
|
||||
| `replicaSetHostnames` | Enable DNS hostnames in the replicaset config (only when `architecture=replicaset`) | `true` |
|
||||
| `enableIPv6` | Switch to enable/disable IPv6 on MongoDB | `false` |
|
||||
@@ -171,7 +171,7 @@ The following tables lists the configurable parameters of the MongoDB chart and
|
||||
| `extraEnvVarsSecret` | Name of existing Secret containing extra env vars (in case of sensitive data) | `nil` |
|
||||
| `tls.enabled` | Enable MongoDB TLS support between nodes in the cluster as well as between mongo clients and nodes | `false` |
|
||||
| `tls.image.registry` | Init container TLS certs setup image registry (nginx) | `docker.io` |
|
||||
| `tls.image.repository` | Init contianer TLS certs setup image name (nginx) | `bitnami/nginx` |
|
||||
| `tls.image.repository` | Init contianer TLS certs setup image name (nginx) | `bitnami/nginx` |
|
||||
| `tls.image.tag` | Init container TLS certs setup image tag (nginx) | `{TAG_NAME}` |
|
||||
| `tls.image.pullPolicy` | Init container TLS certs setup image pull policy (nginx) | `Always` |
|
||||
|
||||
@@ -188,9 +188,14 @@ The following tables lists the configurable parameters of the MongoDB chart and
|
||||
| `podLabels` | MongoDB pod labels | `{}` (evaluated as a template) |
|
||||
| `podAnnotations` | MongoDB Pod annotations | `{}` (evaluated as a template) |
|
||||
| `priorityClassName` | Name of the existing priority class to be used by MongoDB pod(s) | `""` |
|
||||
| `affinity` | Affinity for MongoDB pod(s) assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for MongoDB pod(s) assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for MongoDB pod(s) assignment | `[]` (evaluated as a template) |
|
||||
| `podAffinityPreset` | MongoDB Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `podAntiAffinityPreset` | MongoDB Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `nodeAffinityPreset.type` | MongoDB Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `nodeAffinityPreset.key` | MongoDB Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `nodeAffinityPreset.values` | MongoDB Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `affinity` | MongoDB Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | MongoDB Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | MongoDB Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `podSecurityContext` | MongoDB pod(s)' Security Context | Check `values.yaml` file |
|
||||
| `containerSecurityContext` | MongoDB containers' Security Context | Check `values.yaml` file |
|
||||
| `resources.limits` | The resources limits for MongoDB containers | `{}` |
|
||||
@@ -287,9 +292,14 @@ The following tables lists the configurable parameters of the MongoDB chart and
|
||||
| `arbiter.podLabels` | Arbiter pod labels | `{}` (evaluated as a template) |
|
||||
| `arbiter.podAnnotations` | Arbiter Pod annotations | `{}` (evaluated as a template) |
|
||||
| `arbiter.priorityClassName` | Name of the existing priority class to be used by Arbiter pod(s) | `""` |
|
||||
| `arbiter.affinity` | Affinity for Arbiter pod(s) assignment | `{}` (evaluated as a template) |
|
||||
| `arbiter.nodeSelector` | Node labels for Arbiter pod(s) assignment | `{}` (evaluated as a template) |
|
||||
| `arbiter.tolerations` | Tolerations for Arbiter pod(s) assignment | `[]` (evaluated as a template) |
|
||||
| `arbiter.podAffinityPreset` | Arbiter Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `arbiter.podAntiAffinityPreset` | Arbiter Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `arbiter.nodeAffinityPreset.type` | Arbiter Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `arbiter.nodeAffinityPreset.key` | Arbiter Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `arbiter.nodeAffinityPreset.values` | Arbiter Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `arbiter.affinity` | Arbiter Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `arbiter.nodeSelector` | Arbiter Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `arbiter.tolerations` | Arbiter Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `arbiter.podSecurityContext` | Arbiter pod(s)' Security Context | Check `values.yaml` file |
|
||||
| `arbiter.containerSecurityContext` | Arbiter containers' Security Context | Check `values.yaml` file |
|
||||
| `arbiter.resources.limits` | The resources limits for Arbiter containers | `{}` |
|
||||
@@ -316,8 +326,8 @@ The following tables lists the configurable parameters of the MongoDB chart and
|
||||
| `metrics.image.tag` | MongoDB Prometheus exporter image tag | `{TAG_NAME}` |
|
||||
| `metrics.image.pullPolicy` | MongoDB Prometheus exporter image pull policy | `Always` |
|
||||
| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `metrics.extraFlags` | Additional command line flags | `""` |
|
||||
| `metrics.extraUri` | Additional URI options of the metrics service | `""` |
|
||||
| `metrics.extraFlags` | Additional command line flags | `""` |
|
||||
| `metrics.extraUri` | Additional URI options of the metrics service | `""` |
|
||||
| `metrics.service.type` | Type of the Prometheus metrics service | `ClusterIP file` |
|
||||
| `metrics.service.port` | Port of the Prometheus metrics service | `9216` |
|
||||
| `metrics.service.annotations` | Annotations for Prometheus metrics service | Check `values.yaml` file |
|
||||
@@ -551,6 +561,12 @@ Note: You will be generating self signed certs for the MongoDB deployment. With
|
||||
|
||||
After the certs have been generated and made available to the containers at the correct mount points, the mongod server will be started with TLS enabled. The options for the TLS mode will be (disabled|allowTLS|preferTLS|requireTLS). This value can be changed via the MONGODB_EXTRA_FLAGS field using the tlsMode. The client should now be able to connect to the TLS enabled cluster with the provided certs.
|
||||
|
||||
### Setting Pod's affinity
|
||||
|
||||
This chart allows you to set your custom affinity using the `XXX.affinity` paremeter(s). Find more infomation about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||
|
||||
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `XXX.podAffinityPreset`, `XXX.podAntiAffinityPreset`, or `XXX.nodeAffinityPreset` parameters.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||
|
||||
8
bitnami/mongodb/ci/values-replicaset-with-rbac.yaml
Normal file
8
bitnami/mongodb/ci/values-replicaset-with-rbac.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
architecture: replicaset
|
||||
replicaCount: 3
|
||||
pdb:
|
||||
create: true
|
||||
rbac:
|
||||
create: true
|
||||
serviceAccount:
|
||||
create: true
|
||||
@@ -4,6 +4,10 @@
|
||||
{{- $releaseNamespace := include "mongodb.namespace" . }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
{{- $loadBalancerIPListLength := len .Values.externalAccess.service.loadBalancerIPs }}
|
||||
{{- $mongoList := list }}
|
||||
{{- range $e, $i := until $replicaCount }}
|
||||
{{- $mongoList = append $mongoList (printf "%s-%d.%s-headless.%s.svc.%s:%d" $fullname $i $fullname $releaseNamespace $clusterDomain $portNumber) }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and (eq .Values.architecture "replicaset") .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.externalAccess.service.type "LoadBalancer") }}
|
||||
|
||||
@@ -52,14 +56,10 @@ IPs for MongoDB nodes. To complete your deployment follow the steps below:
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
MongoDB can be accessed via port {{ .Values.service.port }} on the following DNS name(s) from within your cluster:
|
||||
MongoDB can be accessed on the following DNS name(s) and ports from within your cluster:
|
||||
|
||||
{{- if eq .Values.architecture "replicaset" }}
|
||||
|
||||
{{ range $e, $i := until $replicaCount }}
|
||||
{{- $fullname }}-{{ $i }}.{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}
|
||||
{{ end }}
|
||||
|
||||
{{ join "\n" $mongoList | nindent 4 }}
|
||||
{{- else }}
|
||||
|
||||
{{ $fullname }}.{{ $releaseNamespace }}.svc.{{ .Values.clusterDomain }}
|
||||
@@ -83,12 +83,12 @@ To get the password for "{{ .Values.auth.username }}" run:
|
||||
|
||||
To connect to your database, create a MongoDB client container:
|
||||
|
||||
kubectl run --namespace {{ template "mongodb.namespace" . }} {{ template "mongodb.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mongodb.image" . }} --command -- bash
|
||||
kubectl run --namespace {{ template "mongodb.namespace" . }} {{ template "mongodb.fullname" . }}-client --rm --tty -i --restart='Never' --env="MONGODB_ROOT_PASSWORD=$MONGODB_ROOT_PASSWORD" --image {{ template "mongodb.image" . }} --command -- bash
|
||||
|
||||
Then, run the following command:
|
||||
|
||||
{{- if eq .Values.architecture "replicaset" }}
|
||||
mongo admin --host "{{- range $e, $i := until $replicaCount }}{{ $fullname }}-{{ $i }}.{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }},{{ end }}" {{- if .Values.auth.enabled }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
mongo admin --host "{{ join "," $mongoList }}" {{- if .Values.auth.enabled }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
{{- else }}
|
||||
mongo admin --host "{{ template "mongodb.fullname" . }}" {{- if .Values.auth.enabled }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
{{- end }}
|
||||
@@ -143,11 +143,11 @@ To connect to your database from outside the cluster execute the following comma
|
||||
Watch the status with: 'kubectl get svc --namespace {{ template "mongodb.namespace" . }} -w {{ template "mongodb.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ template "mongodb.namespace" . }} {{ template "mongodb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
mongo --host $SERVICE_IP --port {{ .Values.service.port }} {{- if .Values.auth.enabled }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
mongo --host $SERVICE_IP --port {{ $portNumber }} {{- if .Values.auth.enabled }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
|
||||
kubectl port-forward --namespace {{ template "mongodb.namespace" . }} svc/{{ template "mongodb.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }} &
|
||||
kubectl port-forward --namespace {{ template "mongodb.namespace" . }} svc/{{ template "mongodb.fullname" . }} {{ $portNumber }}:{{ $portNumber }} &
|
||||
mongo --host 127.0.0.1 {{- if .Values.auth.enabled }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- if (include "mongodb.arbiter.enabled" .) }}
|
||||
apiVersion: apps/v1
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "mongodb.fullname" . }}-arbiter
|
||||
@@ -40,13 +40,18 @@ spec:
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "mongodb.serviceAccountName" . }}
|
||||
{{- if .Values.arbiter.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.affinity "context" .) | nindent 8 }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.arbiter.podAffinityPreset "component" "arbiter" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.arbiter.podAntiAffinityPreset "component" "arbiter" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.arbiter.nodeAffinityPreset.type "key" .Values.arbiter.nodeAffinityPreset.key "values" .Values.arbiter.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.arbiter.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.nodeSelector "context" .) | nindent 8 }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.arbiter.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.tolerations "context" .) | nindent 8 }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.arbiter.priorityClassName }}
|
||||
priorityClassName: {{ .Values.arbiter.priorityClassName }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- $loadBalancerIPListLength := len .Values.externalAccess.service.loadBalancerIPs }}
|
||||
{{- if not (and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.externalAccess.service.type "LoadBalancer")) }}
|
||||
apiVersion: apps/v1
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "mongodb.fullname" . }}
|
||||
@@ -50,13 +50,18 @@ spec:
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "mongodb.serviceAccountName" . }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" .) | nindent 8 }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "mongodb" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "mongodb" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" .) | nindent 8 }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- if not (eq .Values.architecture "replicaset") }}
|
||||
apiVersion: {{ if .Values.useStatefulSet }}apps/v1{{- else }}{{ include "common.capabilities.deployment.apiVersion" . }}{{- end }}
|
||||
apiVersion: {{ if .Values.useStatefulSet }}{{ include "common.capabilities.statefulset.apiVersion" . }}{{- else }}{{ include "common.capabilities.deployment.apiVersion" . }}{{- end }}
|
||||
kind: {{ if .Values.useStatefulSet }}StatefulSet{{- else }}Deployment{{- end }}
|
||||
metadata:
|
||||
name: {{ include "mongodb.fullname" . }}
|
||||
@@ -49,13 +49,18 @@ spec:
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "mongodb.serviceAccountName" . }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" .) | nindent 8 }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "mongodb" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "mongodb" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" .) | nindent 8 }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
|
||||
@@ -90,11 +90,11 @@ auth:
|
||||
# existingSecret: name-of-existing-secret
|
||||
|
||||
tls:
|
||||
## Enable or disable MongoDB TLS Support
|
||||
## Enable or disable MongoDB TLS Support
|
||||
enabled: false
|
||||
##
|
||||
## Bitnami Nginx image
|
||||
##
|
||||
##
|
||||
## Bitnami Nginx image
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/nginx
|
||||
@@ -240,8 +240,42 @@ strategyType: RollingUpdate
|
||||
##
|
||||
podManagementPolicy: OrderedReady
|
||||
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
@@ -593,17 +627,51 @@ arbiter:
|
||||
##
|
||||
labels: {}
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: arbiter.podAffinityPreset, arbiter.podAntiAffinityPreset, and arbiter.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template.
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment. Evaluated as a template.
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
@@ -90,11 +90,11 @@ auth:
|
||||
# existingSecret: name-of-existing-secret
|
||||
|
||||
tls:
|
||||
## Enable or disable MongoDB TLS Support
|
||||
## Enable or disable MongoDB TLS Support
|
||||
enabled: false
|
||||
##
|
||||
## Bitnami Nginx image
|
||||
##
|
||||
##
|
||||
## Bitnami Nginx image
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/nginx
|
||||
@@ -240,8 +240,42 @@ strategyType: RollingUpdate
|
||||
##
|
||||
podManagementPolicy: OrderedReady
|
||||
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
@@ -593,17 +627,51 @@ arbiter:
|
||||
##
|
||||
labels: {}
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template.
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: arbiter.podAffinityPreset, arbiter.podAntiAffinityPreset, and arbiter.nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template.
|
||||
## Node labels for pod assignment
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment. Evaluated as a template.
|
||||
## Tolerations for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
Reference in New Issue
Block a user