-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from RADAR-base/update-mongodb
Updated mongodb version
- Loading branch information
Showing
16 changed files
with
746 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: https://radar-base.github.io/radar-helm-charts | ||
version: 2.20.5 | ||
digest: sha256:a07de5441d415b0c47eff9b0f4f6659b283174e7fb522e605629a38fd2acce34 | ||
generated: "2024-08-06T17:28:24.095803994Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
external/mongodb/charts/common/templates/_compatibility.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{/* | ||
Copyright Broadcom, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
Return true if the detected platform is Openshift | ||
Usage: | ||
{{- include "common.compatibility.isOpenshift" . -}} | ||
*/}} | ||
{{- define "common.compatibility.isOpenshift" -}} | ||
{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1" -}} | ||
{{- true -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Render a compatible securityContext depending on the platform. By default it is maintained as it is. In other platforms like Openshift we remove default user/group values that do not work out of the box with the restricted-v1 SCC | ||
Usage: | ||
{{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) -}} | ||
*/}} | ||
{{- define "common.compatibility.renderSecurityContext" -}} | ||
{{- $adaptedContext := .secContext -}} | ||
|
||
{{- if (((.context.Values.global).compatibility).openshift) -}} | ||
{{- if or (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "force") (and (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "auto") (include "common.compatibility.isOpenshift" .context)) -}} | ||
{{/* Remove incompatible user/group values that do not work in Openshift out of the box */}} | ||
{{- $adaptedContext = omit $adaptedContext "fsGroup" "runAsUser" "runAsGroup" -}} | ||
{{- if not .secContext.seLinuxOptions -}} | ||
{{/* If it is an empty object, we remove it from the resulting context because it causes validation issues */}} | ||
{{- $adaptedContext = omit $adaptedContext "seLinuxOptions" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{/* Remove fields that are disregarded when running the container in privileged mode */}} | ||
{{- if $adaptedContext.privileged -}} | ||
{{- $adaptedContext = omit $adaptedContext "capabilities" "seLinuxOptions" -}} | ||
{{- end -}} | ||
{{- omit $adaptedContext "enabled" | toYaml -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{{/* | ||
Copyright Broadcom, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
Return a resource request/limit object based on a given preset. | ||
These presets are for basic testing and not meant to be used in production | ||
{{ include "common.resources.preset" (dict "type" "nano") -}} | ||
*/}} | ||
{{- define "common.resources.preset" -}} | ||
{{/* The limits are the requests increased by 50% (except ephemeral-storage and xlarge/2xlarge sizes)*/}} | ||
{{- $presets := dict | ||
"nano" (dict | ||
"requests" (dict "cpu" "100m" "memory" "128Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "150m" "memory" "192Mi" "ephemeral-storage" "2Gi") | ||
) | ||
"micro" (dict | ||
"requests" (dict "cpu" "250m" "memory" "256Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "375m" "memory" "384Mi" "ephemeral-storage" "2Gi") | ||
) | ||
"small" (dict | ||
"requests" (dict "cpu" "500m" "memory" "512Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "750m" "memory" "768Mi" "ephemeral-storage" "2Gi") | ||
) | ||
"medium" (dict | ||
"requests" (dict "cpu" "500m" "memory" "1024Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "750m" "memory" "1536Mi" "ephemeral-storage" "2Gi") | ||
) | ||
"large" (dict | ||
"requests" (dict "cpu" "1.0" "memory" "2048Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "1.5" "memory" "3072Mi" "ephemeral-storage" "2Gi") | ||
) | ||
"xlarge" (dict | ||
"requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "3.0" "memory" "6144Mi" "ephemeral-storage" "2Gi") | ||
) | ||
"2xlarge" (dict | ||
"requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") | ||
"limits" (dict "cpu" "6.0" "memory" "12288Mi" "ephemeral-storage" "2Gi") | ||
) | ||
}} | ||
{{- if hasKey $presets .type -}} | ||
{{- index $presets .type | toYaml -}} | ||
{{- else -}} | ||
{{- printf "ERROR: Preset key '%s' invalid. Allowed values are %s" .type (join "," (keys $presets)) | fail -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
external/mongodb/charts/common/templates/validations/_mysql.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
{{/* | ||
Copyright Broadcom, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Validate MySQL required passwords are not empty. | ||
Usage: | ||
{{ include "common.validations.values.mysql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }} | ||
Params: | ||
- secret - String - Required. Name of the secret where MySQL values are stored, e.g: "mysql-passwords-secret" | ||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false | ||
*/}} | ||
{{- define "common.validations.values.mysql.passwords" -}} | ||
{{- $existingSecret := include "common.mysql.values.auth.existingSecret" . -}} | ||
{{- $enabled := include "common.mysql.values.enabled" . -}} | ||
{{- $architecture := include "common.mysql.values.architecture" . -}} | ||
{{- $authPrefix := include "common.mysql.values.key.auth" . -}} | ||
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}} | ||
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}} | ||
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}} | ||
{{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}} | ||
|
||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}} | ||
{{- $requiredPasswords := list -}} | ||
|
||
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mysql-root-password" -}} | ||
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}} | ||
|
||
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }} | ||
{{- if not (empty $valueUsername) -}} | ||
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mysql-password" -}} | ||
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}} | ||
{{- end -}} | ||
|
||
{{- if (eq $architecture "replication") -}} | ||
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mysql-replication-password" -}} | ||
{{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}} | ||
{{- end -}} | ||
|
||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}} | ||
|
||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Auxiliary function to get the right value for existingSecret. | ||
Usage: | ||
{{ include "common.mysql.values.auth.existingSecret" (dict "context" $) }} | ||
Params: | ||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false | ||
*/}} | ||
{{- define "common.mysql.values.auth.existingSecret" -}} | ||
{{- if .subchart -}} | ||
{{- .context.Values.mysql.auth.existingSecret | quote -}} | ||
{{- else -}} | ||
{{- .context.Values.auth.existingSecret | quote -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Auxiliary function to get the right value for enabled mysql. | ||
Usage: | ||
{{ include "common.mysql.values.enabled" (dict "context" $) }} | ||
*/}} | ||
{{- define "common.mysql.values.enabled" -}} | ||
{{- if .subchart -}} | ||
{{- printf "%v" .context.Values.mysql.enabled -}} | ||
{{- else -}} | ||
{{- printf "%v" (not .context.Values.enabled) -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Auxiliary function to get the right value for architecture | ||
Usage: | ||
{{ include "common.mysql.values.architecture" (dict "subchart" "true" "context" $) }} | ||
Params: | ||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false | ||
*/}} | ||
{{- define "common.mysql.values.architecture" -}} | ||
{{- if .subchart -}} | ||
{{- .context.Values.mysql.architecture -}} | ||
{{- else -}} | ||
{{- .context.Values.architecture -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Auxiliary function to get the right value for the key auth | ||
Usage: | ||
{{ include "common.mysql.values.key.auth" (dict "subchart" "true" "context" $) }} | ||
Params: | ||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false | ||
*/}} | ||
{{- define "common.mysql.values.key.auth" -}} | ||
{{- if .subchart -}} | ||
mysql.auth | ||
{{- else -}} | ||
auth | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.