Add semaphore app
This commit is contained in:
parent
3217fbe8cb
commit
fd8c494161
21
argocd-apps/semaphore.yaml
Normal file
21
argocd-apps/semaphore.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: semaphore
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: my-apps
|
||||||
|
source:
|
||||||
|
repoURL: ssh://git@gitea-ssh.dev-tools.svc.cluster.local:2222/dvirlabs/my-apps.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: charts/semaphore-ui-chart
|
||||||
|
helm:
|
||||||
|
valueFiles:
|
||||||
|
- ../../manifests/semaphore/values.yaml
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: my-apps
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
19
charts/semaphore/.helmignore
Normal file
19
charts/semaphore/.helmignore
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
.DS_Store
|
||||||
|
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
9
charts/semaphore/Chart.lock
Normal file
9
charts/semaphore/Chart.lock
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: mariadb
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 23.2.2
|
||||||
|
- name: postgresql
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 18.1.4
|
||||||
|
digest: sha256:50086294528fadd8cdbfe4f6bf80cd4cbafbd1c28b06eeb430362113f25aef0c
|
||||||
|
generated: "2025-11-05T19:49:06.913964988Z"
|
||||||
39
charts/semaphore/Chart.yaml
Normal file
39
charts/semaphore/Chart.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
annotations:
|
||||||
|
artifacthub.io/license: Apache-2.0
|
||||||
|
artifacthub.io/links: |-
|
||||||
|
- name: Source
|
||||||
|
url: https://github.com/semaphoreui/semaphore
|
||||||
|
- name: Chart
|
||||||
|
url: https://github.com/semaphoreui/charts/tree/main/stable/semaphore
|
||||||
|
artifacthub.io/signKey: |
|
||||||
|
fingerprint: 2B62F542C0C5614F8B4625AE0DDA0DEB51EF789C
|
||||||
|
url: https://raw.githubusercontent.com/semaphoreui/charts/main/semaphore.key
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2.17.34
|
||||||
|
dependencies:
|
||||||
|
- condition: mariadb.enabled
|
||||||
|
name: mariadb
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 23.2.2
|
||||||
|
- condition: postgresql.enabled
|
||||||
|
name: postgresql
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 18.1.4
|
||||||
|
description: Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell
|
||||||
|
and other DevOps tools
|
||||||
|
home: https://semaphoreui.com/
|
||||||
|
icon: https://raw.githubusercontent.com/semaphoreui/semaphore/develop/web/public/favicon.svg
|
||||||
|
keywords:
|
||||||
|
- ansible
|
||||||
|
- awx
|
||||||
|
- tower
|
||||||
|
- semaphore
|
||||||
|
maintainers:
|
||||||
|
- email: denis@semaphoreui.com
|
||||||
|
name: Denis Gukov
|
||||||
|
url: https://github.com/fiftin
|
||||||
|
name: semaphore
|
||||||
|
sources:
|
||||||
|
- https://github.com/semaphoreui/semaphore
|
||||||
|
type: application
|
||||||
|
version: 16.1.2
|
||||||
299
charts/semaphore/README.md
Normal file
299
charts/semaphore/README.md
Normal file
@ -0,0 +1,299 @@
|
|||||||
|
# Semaphore UI official chart
|
||||||
|
|
||||||
|
  
|
||||||
|
|
||||||
|
Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools
|
||||||
|
|
||||||
|
**Homepage:** <https://semaphoreui.com/>
|
||||||
|
|
||||||
|
## Installing the Chart
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm repo add semaphoreui https://semaphoreui.github.io/charts
|
||||||
|
helm repo update
|
||||||
|
```
|
||||||
|
|
||||||
|
**Open-source version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install semaphore semaphoreui/semaphore
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pro version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install semaphore semaphoreui/semaphore --set image.repository=public.ecr.aws/semaphore/pro/server
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installing OCI from GitHub Container Registry (GitHub authentication required)
|
||||||
|
|
||||||
|
**Open-source version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install semaphore oci://ghcr.io/semaphoreui/charts/semaphore
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pro version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install semaphore oci://ghcr.io/semaphoreui/charts/semaphore --set image.repository=public.ecr.aws/semaphore/pro/server
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example for Values
|
||||||
|
|
||||||
|
### Create `admin` user
|
||||||
|
|
||||||
|
```yml
|
||||||
|
admin:
|
||||||
|
create: true
|
||||||
|
password: changeme
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you can login with username `admin` and password `changeme`.
|
||||||
|
|
||||||
|
### Ingress Enabled
|
||||||
|
|
||||||
|
```yml
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
hosts:
|
||||||
|
- host: semaphore.example.com
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
|
||||||
|
### Custom CA bundle for on-prem Git (appended to ca-certificates.crt)
|
||||||
|
|
||||||
|
```yml
|
||||||
|
customCertificates:
|
||||||
|
enabled: true
|
||||||
|
existingSecret: my-custom-ca
|
||||||
|
key: ca.crt
|
||||||
|
mountPath: /etc/ssl/certs/ca-certificates.crt
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bundled MariaDB
|
||||||
|
|
||||||
|
```console
|
||||||
|
database:
|
||||||
|
type: mysql
|
||||||
|
|
||||||
|
host: mariadb
|
||||||
|
port: 3306
|
||||||
|
|
||||||
|
password: p455w0rd
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
auth:
|
||||||
|
password: p455w0rd
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bundled PostgreSQL
|
||||||
|
|
||||||
|
```console
|
||||||
|
database:
|
||||||
|
type: postgres
|
||||||
|
|
||||||
|
host: postgresql
|
||||||
|
port: 5432
|
||||||
|
|
||||||
|
usernameFromSecret: false
|
||||||
|
passwordKey: password
|
||||||
|
existingSecret: postgresql
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
auth:
|
||||||
|
password: p455w0rd
|
||||||
|
```
|
||||||
|
|
||||||
|
### OpenID Connect
|
||||||
|
|
||||||
|
```console
|
||||||
|
oidc:
|
||||||
|
enable: true
|
||||||
|
|
||||||
|
providers:
|
||||||
|
keycloak:
|
||||||
|
display_name: Keycloak
|
||||||
|
provider_url: https://auth.example.com/auth/realms/example
|
||||||
|
redirect_url: https://semaphore.example.com/api/auth/oidc/keycloak/redirect
|
||||||
|
client_id: semaphore
|
||||||
|
client_secret: 0208901c-ecd7-46ae-931a-d03f02e8dcd2
|
||||||
|
username_claim: preferred_username
|
||||||
|
name_claim: preferred_username
|
||||||
|
email_claim: email
|
||||||
|
```
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
| Name | Email | Url |
|
||||||
|
| ---- | ------ | --- |
|
||||||
|
| Denis Gukov | <denis@semaphoreui.com> | <https://github.com/fiftin> |
|
||||||
|
|
||||||
|
## Source Code
|
||||||
|
|
||||||
|
* <https://github.com/semaphoreui/semaphore>
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
| Repository | Name | Version |
|
||||||
|
|------------|------|---------|
|
||||||
|
| oci://registry-1.docker.io/bitnamicharts | mariadb | 23.2.2 |
|
||||||
|
| oci://registry-1.docker.io/bitnamicharts | postgresql | 18.1.4 |
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Key | Type | Default | Description |
|
||||||
|
|-----|------|---------|-------------|
|
||||||
|
| admin.create | bool | `false` | Create an local admin user |
|
||||||
|
| admin.email | string | `"admin@localhost"` | Email for local admin |
|
||||||
|
| admin.emailKey | string | `"email"` | Key used within secret for email |
|
||||||
|
| admin.existingSecret | string | `nil` | Existing secret to use for admin |
|
||||||
|
| admin.fullname | string | `"Admin"` | Fullname for local admin |
|
||||||
|
| admin.fullnameKey | string | `"fullname"` | Key used within secret for fullname |
|
||||||
|
| admin.password | string | `nil` | Password for local admin |
|
||||||
|
| admin.passwordKey | string | `"password"` | Key used within secret for password |
|
||||||
|
| admin.username | string | `"admin"` | Username for local admin |
|
||||||
|
| admin.usernameKey | string | `"username"` | Key used within secret for username |
|
||||||
|
| affinity | object | `{}` | Affinity for the deployment |
|
||||||
|
| annotations | object | `{}` | Define additional annotations |
|
||||||
|
| config.forwarded_env_vars | list | `[]` | List of environment variables to forward into the application environment. Modify this list if additional environment variables need to be accessible. |
|
||||||
|
| customCertificates.enabled | bool | `false` | Enable appending custom CA bundle into ca-certificates.crt for outbound TLS (e.g. on-prem git) |
|
||||||
|
| customCertificates.existingConfigMap | string | `nil` | Existing configmap containing the CA bundle (required if enabled and no secret) |
|
||||||
|
| customCertificates.existingSecret | string | `nil` | Existing secret containing the CA bundle (required if enabled and no configmap) |
|
||||||
|
| customCertificates.key | string | `"ca.crt"` | Key in secret/configmap that holds the CA bundle |
|
||||||
|
| customCertificates.mountPath | string | `"/etc/ssl/certs/ca-certificates.crt"` | Path where the combined CA bundle is mounted (ca-certificates.crt) |
|
||||||
|
| database.existingSecret | string | `nil` | Existing secret to use for credentials |
|
||||||
|
| database.host | string | `nil` | Host for database connection |
|
||||||
|
| database.name | string | `"semaphore"` | Name of the used database |
|
||||||
|
| database.options | object | `{}` | Options for database connection |
|
||||||
|
| database.password | string | `nil` | Password for database |
|
||||||
|
| database.passwordKey | string | `"password"` | Key used within secret for password |
|
||||||
|
| database.path | string | `"/var/lib/semaphore/database.boltdb"` | Path for the boltdb |
|
||||||
|
| database.persistence.accessModes | list | `["ReadWriteOnce"]` | Access modes used for boltdb volume |
|
||||||
|
| database.persistence.enabled | bool | `true` | Enable persistence for boltdb |
|
||||||
|
| database.persistence.existingClaim | string | `nil` | Name of an already existing claim |
|
||||||
|
| database.persistence.size | string | `"5G"` | Size for boltdb volume |
|
||||||
|
| database.persistence.storageClass | string | `nil` | Storage class used for boltdb volume |
|
||||||
|
| database.port | string | `nil` | Port for database connection |
|
||||||
|
| database.type | string | `"bolt"` | Type of database backend |
|
||||||
|
| database.username | string | `"semaphore"` | Username for database |
|
||||||
|
| database.usernameFromSecret | bool | `true` | Read username from secret |
|
||||||
|
| database.usernameKey | string | `"username"` | Key used within secret for username |
|
||||||
|
| email.alert | bool | `false` | Enable email alerting |
|
||||||
|
| email.existingSecret | string | `nil` | Existing secret to use for email |
|
||||||
|
| email.host | string | `nil` | Host of the SMTP server |
|
||||||
|
| email.password | string | `nil` | Password for SMTP server |
|
||||||
|
| email.passwordKey | string | `"password"` | Key used within secret for password |
|
||||||
|
| email.port | string | `nil` | Port of the SMTP server |
|
||||||
|
| email.secure | bool | `false` | Enable a secure connection |
|
||||||
|
| email.sender | string | `nil` | Sender for email alerting |
|
||||||
|
| email.username | string | `nil` | Username for SMTP server |
|
||||||
|
| email.usernameKey | string | `"username"` | Key used within secret for username |
|
||||||
|
| envFromConfigMaps | list | `[]` | List of environment variables from existing configmaps |
|
||||||
|
| envFromSecrets | list | `[]` | List of environment variables from existing secrets |
|
||||||
|
| extraEnvSecrets | object | `{}` | Extra environment variables from secrets |
|
||||||
|
| extraEnvVariables | object | `{}` | Extra environment variables from mapping |
|
||||||
|
| extraInitContainers | list | `[]` | List of extra init containers |
|
||||||
|
| extraSidecarContainers | list | `[]` | List of extra sidecar containers |
|
||||||
|
| extraVolumeMounts | list | `[]` | List of extra volume mounts |
|
||||||
|
| extraVolumes | list | `[]` | List of extra volumes |
|
||||||
|
| fullnameOverride | string | `""` | Override the fullname |
|
||||||
|
| general.additionalPythonPackages | list | `[]` | Additional Python packages |
|
||||||
|
| general.gitClient | string | `"cmd_git"` | Use Git client implementation |
|
||||||
|
| general.host | string | `nil` | Host to access Semaphore |
|
||||||
|
| general.maxParallelTasks | int | `0` | Maximum parallel tasks |
|
||||||
|
| general.nonAdminCanCreateProject | bool | `false` | Allow non-admins to create projects |
|
||||||
|
| general.passwordLoginDisable | bool | `false` | Disable password login |
|
||||||
|
| general.sshConfigPath | string | `nil` | Path to SSH config |
|
||||||
|
| general.tmpPath | string | `"/tmp/semaphore"` | Working directory for Semaphore |
|
||||||
|
| general.useRemoteRunner | bool | `false` | Enable usage of remote runners |
|
||||||
|
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
|
||||||
|
| image.pullSecrets | list | `[]` | Optional name of pull secret if using a private registry |
|
||||||
|
| image.repository | string | `"semaphoreui/semaphore"` | Image repository used by deployment |
|
||||||
|
| image.tag | string | `""` | Optional tag for the repository, defaults to app version |
|
||||||
|
| ingress.annotations | object | `{}` | Additional annotations for the ingress |
|
||||||
|
| ingress.className | string | `nil` | Class name for the ingress resource |
|
||||||
|
| ingress.enabled | bool | `false` | Enable ingress |
|
||||||
|
| ingress.hosts | list | `[{"host":"example.local","paths":[{"path":"/","pathType":"Prefix"}]}]` | Host definition for ingress |
|
||||||
|
| ingress.labels | object | `{}` | Additional labels for the ingress |
|
||||||
|
| ingress.tls | list | `[]` | Optional TLS configuration for ingress |
|
||||||
|
| labels | object | `{}` | Define additional labels |
|
||||||
|
| ldap.binddn | string | `nil` | BindDN for LDAP authentication |
|
||||||
|
| ldap.binddnKey | string | `"username"` | Key used within secret for username |
|
||||||
|
| ldap.enable | bool | `false` | Enable LDAP authentication |
|
||||||
|
| ldap.existingSecret | string | `nil` | Existing secret to use for ldap |
|
||||||
|
| ldap.filter | string | `nil` | Search filter for LDAP |
|
||||||
|
| ldap.mappings | object | `{"cn":"cn","dn":"dn","mail":"mail","uid":"uid"}` | Mapping for LDAP attributes |
|
||||||
|
| ldap.needtls | bool | `false` | Enable TLS connection to LDAP |
|
||||||
|
| ldap.password | string | `nil` | Password for LDAP authentication |
|
||||||
|
| ldap.passwordKey | string | `"password"` | Key used within secret for username |
|
||||||
|
| ldap.searchdn | string | `nil` | |
|
||||||
|
| ldap.server | string | `nil` | Address of LDAP server |
|
||||||
|
| mariadb.architecture | string | `"standalone"` | Architecture for mariadb |
|
||||||
|
| mariadb.auth.database | string | `"semaphore"` | Database created for semaphore |
|
||||||
|
| mariadb.auth.password | string | `nil` | Password for semaphore database |
|
||||||
|
| mariadb.auth.username | string | `"semaphore"` | Username for semaphore database |
|
||||||
|
| mariadb.enabled | bool | `false` | Enable mariadb dependency |
|
||||||
|
| mariadb.fullnameOverride | string | `"mariadb"` | Override fullname of mariadb dependency |
|
||||||
|
| mariadb.metrics.enabled | bool | `true` | Enable metrics for mariadb |
|
||||||
|
| mariadb.metrics.serviceMonitor.enabled | bool | `false` | Enable service monitor for mariadb |
|
||||||
|
| mariadb.serviceAccount.create | bool | `true` | Create service account for mariadb |
|
||||||
|
| nameOverride | string | `""` | Override the name |
|
||||||
|
| nodeSelector | object | `{}` | Node selector for the deployment |
|
||||||
|
| oidc.enable | bool | `false` | Enable oidc authentication |
|
||||||
|
| oidc.providers | object | `{}` | Dictionary of oidc providers |
|
||||||
|
| persistence.accessModes | list | `["ReadWriteOnce"]` | Access modes used for workdir volume |
|
||||||
|
| persistence.enabled | bool | `true` | Enable persistence for workdir |
|
||||||
|
| persistence.existingClaim | string | `nil` | Name of an already existing claim |
|
||||||
|
| persistence.size | string | `"10G"` | Size for boltdb volume |
|
||||||
|
| persistence.storageClass | string | `nil` | Storage class used for workdir volume |
|
||||||
|
| podSecurityContext | object | `{}` | Security context for the pod |
|
||||||
|
| postgresql.architecture | string | `"standalone"` | Architecture for postgresql |
|
||||||
|
| postgresql.auth.database | string | `"semaphore"` | Database created for semaphore |
|
||||||
|
| postgresql.auth.password | string | `nil` | Password for semaphore database |
|
||||||
|
| postgresql.auth.username | string | `"semaphore"` | Username for semaphore database |
|
||||||
|
| postgresql.enabled | bool | `false` | Enable postgresql dependency |
|
||||||
|
| postgresql.fullnameOverride | string | `"postgresql"` | Override fullname of postgresql dependency |
|
||||||
|
| postgresql.metrics.enabled | bool | `true` | Enable metrics for postgresql |
|
||||||
|
| postgresql.metrics.serviceMonitor.enabled | bool | `false` | Enable service monitor for postgresql |
|
||||||
|
| postgresql.serviceAccount.create | bool | `true` | Create service account for postgresql |
|
||||||
|
| replicaCount | int | `1` | Replicas for the deployment |
|
||||||
|
| resources | object | `{"limits":{},"requests":{"cpu":"100m","memory":"64Mi"}}` | Resources for the deployment |
|
||||||
|
| runner.existingSecret | string | `nil` | Existing secret to use for runner |
|
||||||
|
| runner.token | string | `nil` | Runner registration token |
|
||||||
|
| runner.tokenKey | string | `"token"` | Key used within secret for token |
|
||||||
|
| secrets.accesskeyEncryption | string | `nil` | Access key encryption secret, generated if not present |
|
||||||
|
| secrets.accesskeyEncryptionKey | string | `"accesskeyEncryption"` | Key used within secret for accesskeyEncryption |
|
||||||
|
| secrets.cookieEncryption | string | `nil` | Cookie encryption secret, generated if not present |
|
||||||
|
| secrets.cookieEncryptionKey | string | `"cookieEncryption"` | Key used within secret for cookieEncryption |
|
||||||
|
| secrets.cookieHash | string | `nil` | Cookie hash secret, generated if not present |
|
||||||
|
| secrets.cookieHashKey | string | `"cookieHash"` | Key used within secret for cookieHash |
|
||||||
|
| secrets.existingSecret | string | `nil` | Existing secret to use for secrets |
|
||||||
|
| securityContext | object | `{"fsGroup":1001}` | Security context for the deployment |
|
||||||
|
| service.annotations | object | `{}` | Additional annotations for the service |
|
||||||
|
| service.internalPort | int | `3000` | Internal port of the service |
|
||||||
|
| service.labels | object | `{}` | Additional labels for the service |
|
||||||
|
| service.port | int | `3000` | Port of the service |
|
||||||
|
| service.type | string | `"ClusterIP"` | Type of the service |
|
||||||
|
| serviceAccount.annotations | object | `{}` | Define annotations for the service account |
|
||||||
|
| serviceAccount.create | bool | `true` | Create a new service account |
|
||||||
|
| serviceAccount.name | string | `""` | Optional name for an existing service account |
|
||||||
|
| slack.alert | bool | `false` | Enable slack alerting |
|
||||||
|
| slack.existingSecret | string | `nil` | Existing secret to use for slack |
|
||||||
|
| slack.url | string | `nil` | URL used for slack |
|
||||||
|
| slack.urlKey | string | `"url"` | Key used within secret for url |
|
||||||
|
| telegram.alert | bool | `false` | Enable telegram alerting |
|
||||||
|
| telegram.chat | string | `nil` | Chat used for telegram |
|
||||||
|
| telegram.chatKey | string | `"chat"` | Key used within secret for chat |
|
||||||
|
| telegram.existingSecret | string | `nil` | Existing secret to use for telegram |
|
||||||
|
| telegram.token | string | `nil` | Token used for telegram |
|
||||||
|
| telegram.tokenKey | string | `"token"` | Key used within secret for token |
|
||||||
|
| tolerations | list | `[]` | Tolerations for the deployment |
|
||||||
|
| updateStrategy | object | `{"type":"Recreate"}` | Update strategy for deployment |
|
||||||
141
charts/semaphore/README.md.gotmpl
Normal file
141
charts/semaphore/README.md.gotmpl
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
# Semaphore UI official chart
|
||||||
|
|
||||||
|
{{ template "chart.deprecationWarning" . }}
|
||||||
|
|
||||||
|
{{ template "chart.badgesSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.description" . }}
|
||||||
|
|
||||||
|
{{ template "chart.homepageLine" . }}
|
||||||
|
|
||||||
|
## Installing the Chart
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm repo add semaphoreui https://semaphoreui.github.io/charts
|
||||||
|
helm repo update
|
||||||
|
```
|
||||||
|
|
||||||
|
**Open-source version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install {{ template "chart.name" . }} semaphoreui/{{ template "chart.name" . }}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pro version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install {{ template "chart.name" . }} semaphoreui/{{ template "chart.name" . }} --set image.repository=public.ecr.aws/semaphore/pro/server
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installing OCI from GitHub Container Registry (GitHub authentication required)
|
||||||
|
|
||||||
|
**Open-source version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install {{ template "chart.name" . }} oci://ghcr.io/semaphoreui/charts/{{ template "chart.name" . }}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pro version:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install {{ template "chart.name" . }} oci://ghcr.io/semaphoreui/charts/{{ template "chart.name" . }} --set image.repository=public.ecr.aws/semaphore/pro/server
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example for Values
|
||||||
|
|
||||||
|
### Create `admin` user
|
||||||
|
|
||||||
|
```yml
|
||||||
|
admin:
|
||||||
|
create: true
|
||||||
|
password: changeme
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you can login with username `admin` and password `changeme`.
|
||||||
|
|
||||||
|
### Ingress Enabled
|
||||||
|
|
||||||
|
```yml
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
hosts:
|
||||||
|
- host: {{ template "chart.name" . }}.example.com
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
|
||||||
|
### Custom CA bundle for on-prem Git (appended to ca-certificates.crt)
|
||||||
|
|
||||||
|
```yml
|
||||||
|
customCertificates:
|
||||||
|
enabled: true
|
||||||
|
existingSecret: my-custom-ca
|
||||||
|
key: ca.crt
|
||||||
|
mountPath: /etc/ssl/certs/ca-certificates.crt
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bundled MariaDB
|
||||||
|
|
||||||
|
```console
|
||||||
|
database:
|
||||||
|
type: mysql
|
||||||
|
|
||||||
|
host: mariadb
|
||||||
|
port: 3306
|
||||||
|
|
||||||
|
password: p455w0rd
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
auth:
|
||||||
|
password: p455w0rd
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bundled PostgreSQL
|
||||||
|
|
||||||
|
```console
|
||||||
|
database:
|
||||||
|
type: postgres
|
||||||
|
|
||||||
|
host: postgresql
|
||||||
|
port: 5432
|
||||||
|
|
||||||
|
usernameFromSecret: false
|
||||||
|
passwordKey: password
|
||||||
|
existingSecret: postgresql
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
auth:
|
||||||
|
password: p455w0rd
|
||||||
|
```
|
||||||
|
|
||||||
|
### OpenID Connect
|
||||||
|
|
||||||
|
```console
|
||||||
|
oidc:
|
||||||
|
enable: true
|
||||||
|
|
||||||
|
providers:
|
||||||
|
keycloak:
|
||||||
|
display_name: Keycloak
|
||||||
|
provider_url: https://auth.example.com/auth/realms/example
|
||||||
|
redirect_url: https://semaphore.example.com/api/auth/oidc/keycloak/redirect
|
||||||
|
client_id: semaphore
|
||||||
|
client_secret: 0208901c-ecd7-46ae-931a-d03f02e8dcd2
|
||||||
|
username_claim: preferred_username
|
||||||
|
name_claim: preferred_username
|
||||||
|
email_claim: email
|
||||||
|
```
|
||||||
|
|
||||||
|
{{ template "chart.maintainersSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.sourcesSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.requirementsSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.valuesSection" . }}
|
||||||
25
charts/semaphore/charts/mariadb/.helmignore
Normal file
25
charts/semaphore/charts/mariadb/.helmignore
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
# img folder
|
||||||
|
img/
|
||||||
|
# Changelog
|
||||||
|
CHANGELOG.md
|
||||||
13
charts/semaphore/charts/mariadb/.relok8s-images.yaml
Normal file
13
charts/semaphore/charts/mariadb/.relok8s-images.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# relok8s image hints file
|
||||||
|
# This file makes this Helm Chart relocatable by relok8s
|
||||||
|
# More info here https://github.com/vmware-tanzu/asset-relocation-tool-for-kubernetes
|
||||||
|
#
|
||||||
|
# mariadb chart
|
||||||
|
|
||||||
|
# mariadb image
|
||||||
|
- "{{.image.registry}}/{{.image.repository}}:{{.image.tag}}"
|
||||||
|
# mysqld-exporter image
|
||||||
|
- "{{.metrics.image.registry}}/{{.metrics.image.repository}}:{{.metrics.image.tag}}"
|
||||||
|
# os-shell image
|
||||||
|
- "{{.volumePermissions.image.registry}}/{{.volumePermissions.image.repository}}:{{.volumePermissions.image.tag}}"
|
||||||
|
|
||||||
40
charts/semaphore/charts/mariadb/Chart.yaml
Normal file
40
charts/semaphore/charts/mariadb/Chart.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
annotations:
|
||||||
|
fips: "true"
|
||||||
|
images: |
|
||||||
|
- name: mariadb
|
||||||
|
version: 12.0.2
|
||||||
|
image: registry-1.docker.io/bitnami/mariadb:latest
|
||||||
|
- name: mysqld-exporter
|
||||||
|
version: 0.18.0
|
||||||
|
image: registry-1.docker.io/bitnami/mysqld-exporter:latest
|
||||||
|
- name: os-shell
|
||||||
|
version: "5"
|
||||||
|
image: registry-1.docker.io/bitnami/os-shell:latest
|
||||||
|
licenses: Apache-2.0
|
||||||
|
tanzuCategory: service
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 12.0.2
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
tags:
|
||||||
|
- bitnami-common
|
||||||
|
version: 2.33.1
|
||||||
|
description: MariaDB is an open source, community-developed SQL database server that
|
||||||
|
is widely in use around the world due to its enterprise features, flexibility, and
|
||||||
|
collaboration with leading tech firms.
|
||||||
|
home: https://bitnami.com
|
||||||
|
icon: https://dyltqmyl993wv.cloudfront.net/assets/stacks/mariadb/img/mariadb-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- mariadb
|
||||||
|
- mysql
|
||||||
|
- database
|
||||||
|
- sql
|
||||||
|
- prometheus
|
||||||
|
maintainers:
|
||||||
|
- name: Broadcom, Inc. All Rights Reserved.
|
||||||
|
url: https://github.com/bitnami/charts
|
||||||
|
name: mariadb
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts/tree/main/bitnami/mariadb
|
||||||
|
version: 23.2.2
|
||||||
924
charts/semaphore/charts/mariadb/README.md
Normal file
924
charts/semaphore/charts/mariadb/README.md
Normal file
@ -0,0 +1,924 @@
|
|||||||
|
<!--- app-name: MariaDB -->
|
||||||
|
|
||||||
|
# Bitnami Secure Images Helm chart for MariaDB
|
||||||
|
|
||||||
|
MariaDB is an open source, community-developed SQL database server that is widely in use around the world due to its enterprise features, flexibility, and collaboration with leading tech firms.
|
||||||
|
|
||||||
|
[Overview of MariaDB](https://mariadb.org/)
|
||||||
|
|
||||||
|
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install my-release oci://MY-OCI-REGISTRY/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
Looking to use MariaDB in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the commercial edition of the Bitnami catalog.
|
||||||
|
|
||||||
|
## ⚠️ Important Notice: Upcoming changes to the Bitnami Catalog
|
||||||
|
|
||||||
|
Beginning August 28th, 2025, Bitnami will evolve its public catalog to offer a curated set of hardened, security-focused images under the new [Bitnami Secure Images initiative](https://news.broadcom.com/app-dev/broadcom-introduces-bitnami-secure-images-for-production-ready-containerized-applications). As part of this transition:
|
||||||
|
|
||||||
|
- Granting community users access for the first time to security-optimized versions of popular container images.
|
||||||
|
- Bitnami will begin deprecating support for non-hardened, Debian-based software images in its free tier and will gradually remove non-latest tags from the public catalog. As a result, community users will have access to a reduced number of hardened images. These images are published only under the “latest” tag and are intended for development purposes
|
||||||
|
- Starting August 28th, over two weeks, all existing container images, including older or versioned tags (e.g., 2.50.0, 10.6), will be migrated from the public catalog (docker.io/bitnami) to the “Bitnami Legacy” repository (docker.io/bitnamilegacy), where they will no longer receive updates.
|
||||||
|
- For production workloads and long-term support, users are encouraged to adopt Bitnami Secure Images, which include hardened containers, smaller attack surfaces, CVE transparency (via VEX/KEV), SBOMs, and enterprise support.
|
||||||
|
|
||||||
|
These changes aim to improve the security posture of all Bitnami users by promoting best practices for software supply chain integrity and up-to-date deployments. For more details, visit the [Bitnami Secure Images announcement](https://github.com/bitnami/containers/issues/83267).
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart bootstraps a [MariaDB](https://github.com/bitnami/containers/tree/main/bitnami/mariadb) replication cluster deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data. The latest versions of MariaDB also include GIS and JSON features.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.23+
|
||||||
|
- Helm 3.8.0+
|
||||||
|
- PV provisioner support in the underlying infrastructure
|
||||||
|
|
||||||
|
## Installing the Chart
|
||||||
|
|
||||||
|
To install the chart with the release name `my-release`:
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
|
||||||
|
|
||||||
|
The command deploys MariaDB on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||||
|
|
||||||
|
> **Tip**: List all releases using `helm list`
|
||||||
|
|
||||||
|
## Configuration and installation details
|
||||||
|
|
||||||
|
### Resource requests and limits
|
||||||
|
|
||||||
|
Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the `resources` value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.
|
||||||
|
|
||||||
|
To make this process easier, the chart contains the `resourcesPreset` values, which automatically sets the `resources` section according to different presets. Check these presets in [the bitnami/common chart](https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15). However, in production workloads using `resourcesPreset` is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).
|
||||||
|
|
||||||
|
### Prometheus metrics
|
||||||
|
|
||||||
|
This chart can be integrated with Prometheus by setting `metrics.enabled` to `true`. This will deploy a sidecar container with [mysqld_exporter](https://github.com/prometheus/mysqld_exporter) in all pods and will expose it via the MariaDB service. This service will have the necessary annotations to be automatically scraped by Prometheus.
|
||||||
|
|
||||||
|
#### Prometheus requirements
|
||||||
|
|
||||||
|
It is necessary to have a working installation of Prometheus or Prometheus Operator for the integration to work. Install the [Bitnami Prometheus helm chart](https://github.com/bitnami/charts/tree/main/bitnami/prometheus) or the [Bitnami Kube Prometheus helm chart](https://github.com/bitnami/charts/tree/main/bitnami/kube-prometheus) to easily have a working Prometheus in your cluster.
|
||||||
|
|
||||||
|
#### Integration with Prometheus Operator
|
||||||
|
|
||||||
|
The chart can deploy `ServiceMonitor` objects for integration with Prometheus Operator installations. To do so, set the value `metrics.serviceMonitor.enabled=true`. Ensure that the Prometheus Operator `CustomResourceDefinitions` are installed in the cluster or it will fail with the following error:
|
||||||
|
|
||||||
|
```text
|
||||||
|
no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the [Bitnami Kube Prometheus helm chart](https://github.com/bitnami/charts/tree/main/bitnami/kube-prometheus) for having the necessary CRDs and the Prometheus Operator.
|
||||||
|
|
||||||
|
### [Rolling VS Immutable tags](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-understand-rolling-tags-containers-index.html)
|
||||||
|
|
||||||
|
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||||
|
|
||||||
|
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||||
|
|
||||||
|
### Change MariaDB version
|
||||||
|
|
||||||
|
To modify the MariaDB version used in this chart you can specify a [valid image tag](https://hub.docker.com/r/bitnami/mariadb/tags/) using the `image.tag` parameter. For example, `image.tag=X.Y.Z`. This approach is also applicable to other images like exporters.
|
||||||
|
|
||||||
|
### Update credentials
|
||||||
|
|
||||||
|
Bitnami charts, with its default settings, configure credentials at first boot. Any further change in the secrets or credentials can be done using one of the following methods:
|
||||||
|
|
||||||
|
### Manual update of the passwords and secrets
|
||||||
|
|
||||||
|
- Update the user password following [the upstream documentation](https://milvus.io/docs/authenticate.md#Update-user-password)
|
||||||
|
- Update the password secret with the new values (replace the SECRET_NAME, PASSWORD and ROOT_PASSWORD placeholders)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl create secret generic SECRET_NAME --from-literal=password=PASSWORD --from-literal=root-password=ROOT_PASSWORD --dry-run -o yaml | kubectl apply -f -
|
||||||
|
```
|
||||||
|
|
||||||
|
### Automated update using a password update job
|
||||||
|
|
||||||
|
The Bitnami MariaDB provides a password update job that will automatically change the MariaDB passwords when running helm upgrade. To enable the job set `passwordUpdateJob.enabled=true`. This job requires:
|
||||||
|
|
||||||
|
- The new passwords: this is configured using either `auth.rootPassword`, `auth.password` and `auth.replicationPassword` (if applicable) or setting `auth.existingSecret`.
|
||||||
|
- The previous passwords: This value is taken automatically from already deployed secret object. If you are using `auth.existingSecret` or `helm template` instead of `helm upgrade`, then set either `passwordUpdate.job.previousPasswords.rootPassword`, `passwordUpdate.job.previousPasswords.password`, `passwordUpdate.job.previousPasswords.replicationPassword` (when applicable), setting `auth.existingSecret`.
|
||||||
|
|
||||||
|
In the following example we update the password via values.yaml in a mariadb installation with replication
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
architecture: "replication"
|
||||||
|
|
||||||
|
auth:
|
||||||
|
user: "user"
|
||||||
|
rootPassword: "newRootPassword123"
|
||||||
|
password: "newUserPassword123"
|
||||||
|
replicationPassword: "newReplicationPassword123"
|
||||||
|
|
||||||
|
passwordUpdateJob:
|
||||||
|
enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example we use two existing secrets (`new-password-secret` and `previous-password-secret`) to update the passwords:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
auth:
|
||||||
|
existingSecret: new-password-secret
|
||||||
|
|
||||||
|
passwordUpdateJob:
|
||||||
|
enabled: true
|
||||||
|
previousPasswords:
|
||||||
|
existingSecret: previous-password-secret
|
||||||
|
```
|
||||||
|
|
||||||
|
You can add extra update commands using the `passwordUpdateJob.extraCommands` value.
|
||||||
|
|
||||||
|
### Initialize a fresh instance
|
||||||
|
|
||||||
|
The [Bitnami MariaDB](https://github.com/bitnami/containers/tree/main/bitnami/mariadb) image allows you to use your custom scripts to initialize a fresh instance. Custom scripts may be specified using the `initdbScripts` parameter. Alternatively, an external ConfigMap may be created with all the initialization scripts and the ConfigMap passed to the chart via the `initdbScriptsConfigMap` parameter. Note that this will override the `initdbScripts` parameter.
|
||||||
|
|
||||||
|
The allowed extensions are `.sh`, `.sql` and `.sql.gz`.
|
||||||
|
|
||||||
|
These scripts are treated differently depending on their extension. While `.sh` scripts are executed on all the nodes, `.sql` and `.sql.gz` scripts are only executed on the primary nodes. This is because `.sh` scripts support conditional tests to identify the type of node they are running on, while such tests are not supported in `.sql` or `.sql.gz` files.
|
||||||
|
|
||||||
|
When using a `.sh` script, you may wish to perform a "one-time" action like creating a database. This can be achieved by adding a condition in the script to ensure that it is executed only on one node, as shown in the example below:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
initdbScripts:
|
||||||
|
my_init_script.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
if [[ $(hostname) == *primary* ]]; then
|
||||||
|
echo "Primary node"
|
||||||
|
mysql -P 3306 -uroot -prandompassword -e "create database new_database";
|
||||||
|
else
|
||||||
|
echo "No primary node"
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
### Securing traffic using TLS
|
||||||
|
|
||||||
|
This chart supports encrypting communications using TLS. To enable this feature, set the `tls.enabled`.
|
||||||
|
|
||||||
|
It is necessary to create a secret containing the TLS certificates and pass it to the chart via the `tls.existingSecret` parameter. Every secret should contain a `tls.crt` and `tls.key` keys including the certificate and key files respectively and, optionally, a `ca.crt` key including the CA certificate. For example: create the secret with the certificates files:
|
||||||
|
|
||||||
|
```console
|
||||||
|
kubectl create secret generic tls-secret --from-file=./tls.crt --from-file=./tls.key --from-file=./ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
You can manually create the required TLS certificates or relying on the chart auto-generation capabilities. The chart supports two different ways to auto-generate the required certificates:
|
||||||
|
|
||||||
|
- Using Helm capabilities. Enable this feature by setting `tls.autoGenerated.enabled` to `true` and `tls.autoGenerated.engine` to `helm`.
|
||||||
|
- Relying on CertManager (please note it's required to have CertManager installed in your K8s cluster). Enable this feature by setting `tls.autoGenerated.enabled` to `true` and `tls.autoGenerated.engine` to `cert-manager`. Please note it's supported to use an existing Issuer/ClusterIssuer for issuing the TLS certificates by setting the `tls.autoGenerated.certManager.existingIssuer` and `tls.autoGenerated.certManager.existingIssuerKind` parameters.
|
||||||
|
|
||||||
|
### Securing data at rest using Transparent Data Encryption
|
||||||
|
|
||||||
|
This chart supports encrypting data at rest using Transparent Data Encryption (TDE). To enable this feature, set the `tde.enabled`.
|
||||||
|
|
||||||
|
The chart supports two different ways to enable TDE:
|
||||||
|
|
||||||
|
- Using Kubernetes secret to store the encryption keys. Enable this feature by setting `tde.enabled` to `true` and `tde.existingSecret` to the name of the secret containing the random key and the encrypted TDE key.
|
||||||
|
- Using the Secrets Store CSI Driver to store the encryption keys. Enable this feature by setting `tde.enabled` to `true` and `tde.secretsStoreProvider.enabled` to `true`. Currently only the `vault` provider is supported and requires further parameters to be set for secret keys and paths to the encryption keys.
|
||||||
|
|
||||||
|
To simplify the configuration the chart defaults most configuration values for TDE and [file key management encryption plugin](https://mariadb.com/kb/en/file-key-management-encryption-plugin/). For more information, on creating the required keys to enable TDE please refer to the mariaDB blog post [here](https://mariadb.com/resources/blog/mariadb-encryption-tde-using-mariadbs-file-key-management-encryption-plugin/).
|
||||||
|
|
||||||
|
> NOTE: The `tde.enabled` parameter impacts recoverability of the MariaDB data. If you enable TDE, the MariaDB data cannot be recovered if your encryption keys are lost. Always backup your encryption keys and store in a secure location outside of the cluster.
|
||||||
|
|
||||||
|
#### Using Kubernetes secret to store the encryption keys
|
||||||
|
|
||||||
|
To enable TDE using Kubernetes secret, create a secret containing the random key and the encrypted TDE key.
|
||||||
|
|
||||||
|
```console
|
||||||
|
kubectl create secret generic mariadb-tde-secret --namespace=mariadb \
|
||||||
|
--from-file=./mariadb/encryption/keyfile.key \
|
||||||
|
--from-file=./mariadb/encryption/keyfile.enc
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Using the Secrets Store CSI Driver to store the encryption keys in Hashicorp Vault
|
||||||
|
|
||||||
|
To enable TDE using the Secrets Store CSI Driver, create a secret containing the random key and the encrypted TDE key. When using the Secrets Store CSI Driver, the `tde.secretsStoreProvider.vault` parameters should be configured. Secrets in Hashicorp Vault are used to store the random key and the encrypted TDE key. The key files must be stored as base64 encoded values.
|
||||||
|
|
||||||
|
```console
|
||||||
|
export KEYFILE_KEY=$(cat ./mariadb/encryption/keyfile.key|base64)
|
||||||
|
export KEYFILE_ENC=$(cat ./mariadb/encryption/keyfile.enc|base64)
|
||||||
|
|
||||||
|
vault kv put secrets-kv/keyfile key="$KEYFILE_KEY" enc="$KEYFILE_ENC"
|
||||||
|
```
|
||||||
|
|
||||||
|
The `SecretProviderClass` for `vault` at minimum requires the `tde.secretsStoreProvider.vault.roleName`, `tde.secretsStoreProvider.vault.*KeySecretPath` and `tde.secretsStoreProvider.vault.*SecretKey` parameters to be set for the secret values to properly be mounted.
|
||||||
|
|
||||||
|
>NOTE: This guide does not include configuration for the Secrets Store CSI Driver or Hashicorp Vault provider which are prerequisites for enabling TDE with the Secrets Store CSI Driver.
|
||||||
|
|
||||||
|
### Sidecars and Init Containers
|
||||||
|
|
||||||
|
If additional containers are needed in the same pod as MariaDB (such as additional metrics or logging exporters), they can be defined using the `sidecars` parameter.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
sidecars:
|
||||||
|
- name: your-image-name
|
||||||
|
image: your-image
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- name: portname
|
||||||
|
containerPort: 1234
|
||||||
|
```
|
||||||
|
|
||||||
|
If these sidecars export extra ports, extra port definitions can be added using the `service.extraPorts` parameter (where available), as shown in the example below:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
service:
|
||||||
|
extraPorts:
|
||||||
|
- name: extraPort
|
||||||
|
port: 11311
|
||||||
|
targetPort: 11311
|
||||||
|
```
|
||||||
|
|
||||||
|
> NOTE: This Helm chart already includes sidecar containers for the Prometheus exporters (where applicable). These can be activated by adding the `--enable-metrics=true` parameter at deployment time. The `sidecars` parameter should therefore only be used for any extra sidecar containers.
|
||||||
|
|
||||||
|
If additional init containers are needed in the same pod, they can be defined using the `initContainers` parameter. Here is an example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
initContainers:
|
||||||
|
- name: your-image-name
|
||||||
|
image: your-image
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- name: portname
|
||||||
|
containerPort: 1234
|
||||||
|
```
|
||||||
|
|
||||||
|
Learn more about [sidecar containers](https://kubernetes.io/docs/concepts/workloads/pods/) and [init containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/).
|
||||||
|
|
||||||
|
### Backup and restore
|
||||||
|
|
||||||
|
To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using [Velero](https://velero.io/), a Kubernetes backup/restore tool. Find the instructions for using Velero in [this guide](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-backup-restore-deployments-velero-index.html).
|
||||||
|
|
||||||
|
### FIPS parameters
|
||||||
|
|
||||||
|
The FIPS parameters only have effect if you are using images from the [Bitnami Secure Images catalog](https://www.arrow.com/globalecs/uk/products/bitnami-secure-images/).
|
||||||
|
|
||||||
|
For more information on this new support, please refer to the [FIPS Compliance section](https://techdocs.broadcom.com/us/en/vmware-tanzu/bitnami-secure-images/bitnami-secure-images/services/bsi-doc/security-frameworks-FIPS-compliance.html).
|
||||||
|
|
||||||
|
## Persistence
|
||||||
|
|
||||||
|
The [Bitnami MariaDB](https://github.com/bitnami/containers/tree/main/bitnami/mariadb) image stores the MariaDB data and configurations at the `/bitnami/mariadb` path of the container.
|
||||||
|
|
||||||
|
The chart mounts a [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning, by default. An existing PersistentVolumeClaim can also be defined.
|
||||||
|
|
||||||
|
If you encounter errors when working with persistent volumes, refer to our [troubleshooting guide for persistent volumes](https://docs.bitnami.com/kubernetes/faq/troubleshooting/troubleshooting-persistence-volumes/).
|
||||||
|
|
||||||
|
### Adjust permissions of persistent volume mountpoint
|
||||||
|
|
||||||
|
As the image run as non-root by default, it is necessary to adjust the ownership of the persistent volume so that the container can write data into it.
|
||||||
|
|
||||||
|
By default, the chart is configured to use Kubernetes Security Context to automatically change the ownership of the volume. However, this feature does not work in all Kubernetes distributions.
|
||||||
|
|
||||||
|
As an alternative, this chart supports using an initContainer to change the ownership of the volume before mounting it in the final destination. You can enable this initContainer by setting `volumePermissions.enabled` to `true`.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
### Global parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||||
|
| `global.imageRegistry` | Global Docker Image registry | `""` |
|
||||||
|
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
|
||||||
|
| `global.defaultStorageClass` | Global default StorageClass for Persistent Volume(s) | `""` |
|
||||||
|
| `global.defaultFips` | Default value for the FIPS configuration (allowed values: '', restricted, relaxed, off). Can be overriden by the 'fips' object | `restricted` |
|
||||||
|
| `global.security.allowInsecureImages` | Allows skipping image verification | `false` |
|
||||||
|
| `global.compatibility.openshift.adaptSecurityContext` | Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) | `auto` |
|
||||||
|
|
||||||
|
### Common parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------- | --------------------------------------------------------------------------------------- | --------------- |
|
||||||
|
| `kubeVersion` | Force target Kubernetes version (using Helm capabilities if not set) | `""` |
|
||||||
|
| `nameOverride` | String to partially override mariadb.fullname | `""` |
|
||||||
|
| `fullnameOverride` | String to fully override mariadb.fullname | `""` |
|
||||||
|
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||||
|
| `commonAnnotations` | Common annotations to add to all MariaDB resources (sub-charts are not considered) | `{}` |
|
||||||
|
| `commonLabels` | Common labels to add to all MariaDB resources (sub-charts are not considered) | `{}` |
|
||||||
|
| `schedulerName` | Name of the scheduler (other than default) to dispatch pods | `""` |
|
||||||
|
| `runtimeClassName` | Name of the Runtime Class for all MariaDB pods | `""` |
|
||||||
|
| `extraDeploy` | Array of extra objects to deploy with the release (evaluated as a template) | `[]` |
|
||||||
|
| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
|
||||||
|
| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` |
|
||||||
|
| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` |
|
||||||
|
| `serviceBindings.enabled` | Create secret for service binding (Experimental) | `false` |
|
||||||
|
|
||||||
|
### MariaDB common parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
|
||||||
|
| `image.registry` | MariaDB image registry | `REGISTRY_NAME` |
|
||||||
|
| `image.repository` | MariaDB image repository | `REPOSITORY_NAME/mariadb` |
|
||||||
|
| `image.digest` | MariaDB image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` |
|
||||||
|
| `image.pullPolicy` | MariaDB image pull policy | `IfNotPresent` |
|
||||||
|
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
|
||||||
|
| `image.debug` | Specify if debug logs should be enabled | `false` |
|
||||||
|
| `architecture` | MariaDB architecture (`standalone` or `replication`) | `standalone` |
|
||||||
|
| `auth.rootPassword` | Password for the `root` user. Ignored if existing secret is provided. | `""` |
|
||||||
|
| `auth.database` | Name for a custom database to create | `my_database` |
|
||||||
|
| `auth.username` | Name for a custom user to create | `""` |
|
||||||
|
| `auth.password` | Password for the new user. Ignored if existing secret is provided | `""` |
|
||||||
|
| `auth.replicationUser` | MariaDB replication user | `replicator` |
|
||||||
|
| `auth.replicationPassword` | MariaDB replication user password. Ignored if existing secret is provided | `""` |
|
||||||
|
| `auth.existingSecret` | Use existing secret for password details (`auth.rootPassword`, `auth.password`, `auth.replicationPassword` will be ignored and picked up from this secret). The secret has to contain the keys `mariadb-root-password`, `mariadb-replication-password` and `mariadb-password` | `""` |
|
||||||
|
| `auth.forcePassword` | Force users to specify required passwords | `false` |
|
||||||
|
| `auth.usePasswordFiles` | Mount credentials as files instead of using environment variables | `true` |
|
||||||
|
| `auth.customPasswordFiles` | Use custom password files when `auth.usePasswordFiles` is set to `true`. Define path for keys `root` and `user`, also define `replicator` if `architecture` is set to `replication` | `{}` |
|
||||||
|
| `initdbScripts` | Dictionary of initdb scripts | `{}` |
|
||||||
|
| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `""` |
|
||||||
|
|
||||||
|
### TLS/SSL parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------- |
|
||||||
|
| `tls.enabled` | Enable TLS in MariaDB | `false` |
|
||||||
|
| `tls.existingSecret` | Existing secret that contains TLS certificates | `""` |
|
||||||
|
| `tls.certFilename` | The secret key from the existingSecret if 'cert' key different from the default (tls.crt) | `tls.crt` |
|
||||||
|
| `tls.certKeyFilename` | The secret key from the existingSecret if 'key' key different from the default (tls.key) | `tls.key` |
|
||||||
|
| `tls.certCAFilename` | The secret key from the existingSecret if 'ca' key different from the default (tls.crt) | `""` |
|
||||||
|
| `tls.ca` | CA certificate for TLS. Ignored if `tls.existingSecret` is set | `""` |
|
||||||
|
| `tls.cert` | TLS certificate for MariaDB. Ignored if `tls.existingSecret` is set | `""` |
|
||||||
|
| `tls.key` | TLS key for MariaDB. Ignored if `tls.existingSecret` is set | `""` |
|
||||||
|
| `tls.autoGenerated.enabled` | Enable automatic generation of TLS certificates | `true` |
|
||||||
|
| `tls.autoGenerated.engine` | Mechanism to generate the certificates (allowed values: helm, cert-manager) | `helm` |
|
||||||
|
| `tls.autoGenerated.extraSANs` | Extra Subject Alternative Names (SANs) for generated certificates | `[]` |
|
||||||
|
| `tls.autoGenerated.loopback` | Add loopback SANs (localhost and 127.0.0.1) to generated certificates | `false` |
|
||||||
|
| `tls.autoGenerated.certManager.existingIssuer` | The name of an existing Issuer to use for generating the certificates (only for `cert-manager` engine) | `""` |
|
||||||
|
| `tls.autoGenerated.certManager.existingIssuerKind` | Existing Issuer kind, defaults to Issuer (only for `cert-manager` engine) | `""` |
|
||||||
|
| `tls.autoGenerated.certManager.keyAlgorithm` | Key algorithm for the certificates (only for `cert-manager` engine) | `RSA` |
|
||||||
|
| `tls.autoGenerated.certManager.keySize` | Key size for the certificates (only for `cert-manager` engine) | `2048` |
|
||||||
|
| `tls.autoGenerated.certManager.duration` | Duration for the certificates (only for `cert-manager` engine) | `2160h` |
|
||||||
|
| `tls.autoGenerated.certManager.renewBefore` | Renewal period for the certificates (only for `cert-manager` engine) | `360h` |
|
||||||
|
|
||||||
|
### Transparent Data Encryption parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
||||||
|
| `tde.enabled` | Enable Transparent Data Encryption using the File Key Management Encryption Plugin for MariaDB | `false` |
|
||||||
|
| `tde.existingSecret` | Existing secret that contains Transparent Data Encryption key files used when secretsStoreProvider is not enabled | `""` |
|
||||||
|
| `tde.randomKeyFilename` | File name of the 'random keyfile' when it is different from the default (keyfile.key), is also used for key name in the existingSecret | `keyfile.key` |
|
||||||
|
| `tde.encryptedKeyFilename` | File name of the 'encrypted keyfile' when it is different from the default (keyfile.enc), is also used for key name in the existingSecret | `keyfile.enc` |
|
||||||
|
| `tde.fileKeyManagementEncryptionAlgorithm` | Encryption algorithm used for encrypting data (allowed values: AES_CTR, AES_CBC | default: AES_CTR) | `AES_CTR` |
|
||||||
|
| `tde.innodbEncryptTables` | Enables automatic encryption of all InnoDB tablespaces (allowed values: FORCE, ON, OFF | default: FORCE) | `FORCE` |
|
||||||
|
| `tde.innodbEncryptLog` | Enables encryption of the InnoDB redo log (allowed values: ON, OFF | default: ON) | `ON` |
|
||||||
|
| `tde.innodbEncryptTemporaryTables` | Enables automatic encryption of the InnoDB temporary tablespace (allowed values: ON, OFF | default: ON) | `ON` |
|
||||||
|
| `tde.innodbEncryptionThreads` | Number of threads to use for encryption (default: 4) | `4` |
|
||||||
|
| `tde.encryptTmpDiskTables` | Enables automatic encryption of all internal on-disk temporary tables that are created during query execution (allowed values: ON, OFF | default: ON) | `ON` |
|
||||||
|
| `tde.encryptTmpTiles` | Enables automatic encryption of temporary files, such as those created for filesort operations, binary log file caches, etc. (allowed values: ON, OFF | default: ON) | `ON` |
|
||||||
|
| `tde.encryptBINLOG` | Enables encrypting binary logs including relay logs (allowed values: ON, OFF | default: ON) | `ON` |
|
||||||
|
| `tde.ariaEncryptTables` | Enables automatic encryption of all Aria tablespaces (allowed values: ON, OFF | default: ON) | `ON` |
|
||||||
|
| `tde.secretsStoreProvider.enabled` | Enable use of secrets store provider for Transparent Data Encryption key files | `false` |
|
||||||
|
| `tde.secretsStoreProvider.provider` | Type of provider used in secrets store provider class (allowed values: vault) | `vault` |
|
||||||
|
| `tde.secretsStoreProvider.vault.roleName` | The name of the HashiCorp Vault role used for accessing the key files (only for `vault` provider) | `""` |
|
||||||
|
| `tde.secretsStoreProvider.vault.address` | The URL of the HashiCorp Vault server (only for `vault` provider) | `""` |
|
||||||
|
| `tde.secretsStoreProvider.vault.authMountPath` | The HashiCorp Vault auth mount path (only for `vault` provider) | `""` |
|
||||||
|
| `tde.secretsStoreProvider.vault.randomKeySecretPath` | The HashiCorp Vault secret path for the 'random keyfile' (only for `vault` provider) | `""` |
|
||||||
|
| `tde.secretsStoreProvider.vault.randomKeySecretKey` | The HashiCorp Vault secret key for the 'random keyfile' (only for `vault` provider) | `""` |
|
||||||
|
| `tde.secretsStoreProvider.vault.encryptedKeySecretPath` | The HashiCorp Vault secret path for the 'encrypted keyfile' (only for `vault` provider) | `""` |
|
||||||
|
| `tde.secretsStoreProvider.vault.encryptedKeySecretKey` | The HashiCorp Vault secret key for the 'encrypted keyfile' (only for `vault` provider) | `""` |
|
||||||
|
|
||||||
|
### MariaDB Primary parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
|
||||||
|
| `primary.name` | Name of the primary database (eg primary, master, leader, ...) | `primary` |
|
||||||
|
| `primary.command` | Override default container command on MariaDB Primary container(s) (useful when using custom images) | `[]` |
|
||||||
|
| `primary.args` | Override default container args on MariaDB Primary container(s) (useful when using custom images) | `[]` |
|
||||||
|
| `primary.lifecycleHooks` | for the MariaDB Primary container(s) to automate configuration before or after startup | `{}` |
|
||||||
|
| `primary.automountServiceAccountToken` | Mount Service Account token in pod | `false` |
|
||||||
|
| `primary.hostAliases` | Add deployment host aliases | `[]` |
|
||||||
|
| `primary.containerPorts.mysql` | Container port for mysql | `3306` |
|
||||||
|
| `primary.configuration` | MariaDB Primary configuration to be injected as ConfigMap | `""` |
|
||||||
|
| `primary.existingConfigmap` | Name of existing ConfigMap with MariaDB Primary configuration. | `""` |
|
||||||
|
| `primary.updateStrategy.type` | MariaDB primary statefulset strategy type | `RollingUpdate` |
|
||||||
|
| `primary.rollingUpdatePartition` | Partition update strategy for Mariadb Primary statefulset | `""` |
|
||||||
|
| `primary.podAnnotations` | Additional pod annotations for MariaDB primary pods | `{}` |
|
||||||
|
| `primary.podLabels` | Extra labels for MariaDB primary pods | `{}` |
|
||||||
|
| `primary.podAffinityPreset` | MariaDB primary pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `primary.podAntiAffinityPreset` | MariaDB primary pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||||
|
| `primary.nodeAffinityPreset.type` | MariaDB primary node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `primary.nodeAffinityPreset.key` | MariaDB primary node label key to match Ignored if `primary.affinity` is set. | `""` |
|
||||||
|
| `primary.nodeAffinityPreset.values` | MariaDB primary node label values to match. Ignored if `primary.affinity` is set. | `[]` |
|
||||||
|
| `primary.affinity` | Affinity for MariaDB primary pods assignment | `{}` |
|
||||||
|
| `primary.nodeSelector` | Node labels for MariaDB primary pods assignment | `{}` |
|
||||||
|
| `primary.tolerations` | Tolerations for MariaDB primary pods assignment | `[]` |
|
||||||
|
| `primary.schedulerName` | Name of the k8s scheduler (other than default) | `""` |
|
||||||
|
| `primary.terminationGracePeriodSeconds` | In seconds, time the given to the MySQL primary pod needs to terminate gracefully | `""` |
|
||||||
|
| `primary.podManagementPolicy` | podManagementPolicy to manage scaling operation of MariaDB primary pods | `""` |
|
||||||
|
| `primary.topologySpreadConstraints` | Topology Spread Constraints for MariaDB primary pods assignment | `[]` |
|
||||||
|
| `primary.priorityClassName` | Priority class for MariaDB primary pods assignment | `""` |
|
||||||
|
| `primary.runtimeClassName` | Runtime Class for MariaDB primary pods | `""` |
|
||||||
|
| `primary.podSecurityContext.enabled` | Enable security context for MariaDB primary pods | `true` |
|
||||||
|
| `primary.podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` |
|
||||||
|
| `primary.podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` |
|
||||||
|
| `primary.podSecurityContext.supplementalGroups` | Set filesystem extra groups | `[]` |
|
||||||
|
| `primary.podSecurityContext.fsGroup` | Group ID for the mounted volumes' filesystem | `1001` |
|
||||||
|
| `primary.containerSecurityContext.enabled` | MariaDB primary container securityContext | `true` |
|
||||||
|
| `primary.containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` |
|
||||||
|
| `primary.containerSecurityContext.runAsUser` | User ID for the MariaDB primary container | `1001` |
|
||||||
|
| `primary.containerSecurityContext.runAsGroup` | Group ID for the MariaDB primary container | `1001` |
|
||||||
|
| `primary.containerSecurityContext.runAsNonRoot` | Set primary container's Security Context runAsNonRoot | `true` |
|
||||||
|
| `primary.containerSecurityContext.privileged` | Set primary container's Security Context privileged | `false` |
|
||||||
|
| `primary.containerSecurityContext.allowPrivilegeEscalation` | Set primary container's Security Context allowPrivilegeEscalation | `false` |
|
||||||
|
| `primary.containerSecurityContext.readOnlyRootFilesystem` | Set container's Security Context readOnlyRootFilesystem | `true` |
|
||||||
|
| `primary.containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
|
||||||
|
| `primary.containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
|
||||||
|
| `primary.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if primary.resources is set (primary.resources is recommended for production). | `small` |
|
||||||
|
| `primary.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
|
| `primary.fips.openssl` | Configure OpenSSL FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used | `""` |
|
||||||
|
| `primary.startupProbe.enabled` | Enable startupProbe | `false` |
|
||||||
|
| `primary.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `120` |
|
||||||
|
| `primary.startupProbe.periodSeconds` | Period seconds for startupProbe | `15` |
|
||||||
|
| `primary.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
|
||||||
|
| `primary.startupProbe.failureThreshold` | Failure threshold for startupProbe | `10` |
|
||||||
|
| `primary.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
|
||||||
|
| `primary.livenessProbe.enabled` | Enable livenessProbe | `true` |
|
||||||
|
| `primary.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `120` |
|
||||||
|
| `primary.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
|
||||||
|
| `primary.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `1` |
|
||||||
|
| `primary.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
|
||||||
|
| `primary.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
|
||||||
|
| `primary.readinessProbe.enabled` | Enable readinessProbe | `true` |
|
||||||
|
| `primary.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` |
|
||||||
|
| `primary.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
|
||||||
|
| `primary.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
|
||||||
|
| `primary.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
|
||||||
|
| `primary.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
|
||||||
|
| `primary.customStartupProbe` | Override default startup probe for MariaDB primary containers | `{}` |
|
||||||
|
| `primary.customLivenessProbe` | Override default liveness probe for MariaDB primary containers | `{}` |
|
||||||
|
| `primary.customReadinessProbe` | Override default readiness probe for MariaDB primary containers | `{}` |
|
||||||
|
| `primary.startupWaitOptions` | Override default builtin startup wait check options for MariaDB primary containers | `{}` |
|
||||||
|
| `primary.extraFlags` | MariaDB primary additional command line flags | `""` |
|
||||||
|
| `primary.extraEnvVars` | Extra environment variables to be set on MariaDB primary containers | `[]` |
|
||||||
|
| `primary.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for MariaDB primary containers | `""` |
|
||||||
|
| `primary.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for MariaDB primary containers | `""` |
|
||||||
|
| `primary.persistence.enabled` | Enable persistence on MariaDB primary replicas using a `PersistentVolumeClaim`. If false, use emptyDir | `true` |
|
||||||
|
| `primary.persistence.existingClaim` | Name of an existing `PersistentVolumeClaim` for MariaDB primary replicas | `""` |
|
||||||
|
| `primary.persistence.subPath` | Subdirectory of the volume to mount at | `""` |
|
||||||
|
| `primary.persistence.storageClass` | MariaDB primary persistent volume storage Class | `""` |
|
||||||
|
| `primary.persistence.labels` | Labels for the PVC | `{}` |
|
||||||
|
| `primary.persistence.annotations` | MariaDB primary persistent volume claim annotations | `{}` |
|
||||||
|
| `primary.persistence.accessModes` | MariaDB primary persistent volume access Modes | `["ReadWriteOnce"]` |
|
||||||
|
| `primary.persistence.size` | MariaDB primary persistent volume size | `8Gi` |
|
||||||
|
| `primary.persistence.selector` | Selector to match an existing Persistent Volume | `{}` |
|
||||||
|
| `primary.extraVolumes` | Optionally specify extra list of additional volumes to the MariaDB Primary pod(s) | `[]` |
|
||||||
|
| `primary.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MariaDB Primary container(s) | `[]` |
|
||||||
|
| `primary.initContainers` | Add additional init containers for the MariaDB Primary pod(s) | `[]` |
|
||||||
|
| `primary.sidecars` | Add additional sidecar containers for the MariaDB Primary pod(s) | `[]` |
|
||||||
|
| `primary.service.type` | MariaDB Primary Kubernetes service type | `ClusterIP` |
|
||||||
|
| `primary.service.ports.mysql` | MariaDB Primary Kubernetes service port for MariaDB | `3306` |
|
||||||
|
| `primary.service.ports.metrics` | MariaDB Primary Kubernetes service port for metrics | `9104` |
|
||||||
|
| `primary.service.nodePorts.mysql` | MariaDB Primary Kubernetes service node port | `""` |
|
||||||
|
| `primary.service.clusterIP` | MariaDB Primary Kubernetes service clusterIP IP | `""` |
|
||||||
|
| `primary.service.loadBalancerIP` | MariaDB Primary loadBalancerIP if service type is `LoadBalancer` | `""` |
|
||||||
|
| `primary.service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
|
||||||
|
| `primary.service.loadBalancerSourceRanges` | Address that are allowed when MariaDB Primary service is LoadBalancer | `[]` |
|
||||||
|
| `primary.service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
|
||||||
|
| `primary.service.annotations` | Provide any additional annotations which may be required | `{}` |
|
||||||
|
| `primary.service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
|
||||||
|
| `primary.service.sessionAffinityConfig` | Additional settings for the sessionAffinity. Ignored if `primary.service.sessionAffinity` is `None` | `{}` |
|
||||||
|
| `primary.service.headless.annotations` | Annotations of the headless service | `{}` |
|
||||||
|
| `primary.pdb.create` | Enable/disable a Pod Disruption Budget creation for MariaDB primary pods | `true` |
|
||||||
|
| `primary.pdb.minAvailable` | Minimum number/percentage of MariaDB primary pods that must still be available after the eviction | `""` |
|
||||||
|
| `primary.pdb.maxUnavailable` | Maximum number/percentage of MariaDB primary pods that can be unavailable after the eviction. Defaults to `1` if both `primary.pdb.minAvailable` and `primary.pdb.maxUnavailable` are empty. | `""` |
|
||||||
|
| `primary.revisionHistoryLimit` | Maximum number of revisions that will be maintained in the StatefulSet | `10` |
|
||||||
|
|
||||||
|
### MariaDB Secondary parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
|
||||||
|
| `secondary.name` | Name of the secondary database (eg secondary, slave, ...) | `secondary` |
|
||||||
|
| `secondary.replicaCount` | Number of MariaDB secondary replicas | `1` |
|
||||||
|
| `secondary.command` | Override default container command on MariaDB Secondary container(s) (useful when using custom images) | `[]` |
|
||||||
|
| `secondary.args` | Override default container args on MariaDB Secondary container(s) (useful when using custom images) | `[]` |
|
||||||
|
| `secondary.lifecycleHooks` | for the MariaDB Secondary container(s) to automate configuration before or after startup | `{}` |
|
||||||
|
| `secondary.automountServiceAccountToken` | Mount Service Account token in pod | `false` |
|
||||||
|
| `secondary.hostAliases` | Add deployment host aliases | `[]` |
|
||||||
|
| `secondary.containerPorts.mysql` | Container port for mysql | `3306` |
|
||||||
|
| `secondary.configuration` | MariaDB Secondary configuration to be injected as ConfigMap | `""` |
|
||||||
|
| `secondary.existingConfigmap` | Name of existing ConfigMap with MariaDB Secondary configuration. | `""` |
|
||||||
|
| `secondary.updateStrategy.type` | MariaDB secondary statefulset strategy type | `RollingUpdate` |
|
||||||
|
| `secondary.rollingUpdatePartition` | Partition update strategy for Mariadb Secondary statefulset | `""` |
|
||||||
|
| `secondary.podAnnotations` | Additional pod annotations for MariaDB secondary pods | `{}` |
|
||||||
|
| `secondary.podLabels` | Extra labels for MariaDB secondary pods | `{}` |
|
||||||
|
| `secondary.podAffinityPreset` | MariaDB secondary pod affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `secondary.podAntiAffinityPreset` | MariaDB secondary pod anti-affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||||
|
| `secondary.nodeAffinityPreset.type` | MariaDB secondary node affinity preset type. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||||
|
| `secondary.nodeAffinityPreset.key` | MariaDB secondary node label key to match Ignored if `secondary.affinity` is set. | `""` |
|
||||||
|
| `secondary.nodeAffinityPreset.values` | MariaDB secondary node label values to match. Ignored if `secondary.affinity` is set. | `[]` |
|
||||||
|
| `secondary.affinity` | Affinity for MariaDB secondary pods assignment | `{}` |
|
||||||
|
| `secondary.nodeSelector` | Node labels for MariaDB secondary pods assignment | `{}` |
|
||||||
|
| `secondary.tolerations` | Tolerations for MariaDB secondary pods assignment | `[]` |
|
||||||
|
| `secondary.topologySpreadConstraints` | Topology Spread Constraints for MariaDB secondary pods assignment | `[]` |
|
||||||
|
| `secondary.priorityClassName` | Priority class for MariaDB secondary pods assignment | `""` |
|
||||||
|
| `secondary.runtimeClassName` | Runtime Class for MariaDB secondary pods | `""` |
|
||||||
|
| `secondary.schedulerName` | Name of the k8s scheduler (other than default) | `""` |
|
||||||
|
| `secondary.terminationGracePeriodSeconds` | In seconds, time the given to the MySQL secondary pod needs to terminate gracefully | `""` |
|
||||||
|
| `secondary.podManagementPolicy` | podManagementPolicy to manage scaling operation of MariaDB secondary pods | `""` |
|
||||||
|
| `secondary.podSecurityContext.enabled` | Enable security context for MariaDB secondary pods | `true` |
|
||||||
|
| `secondary.podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` |
|
||||||
|
| `secondary.podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` |
|
||||||
|
| `secondary.podSecurityContext.supplementalGroups` | Set filesystem extra groups | `[]` |
|
||||||
|
| `secondary.podSecurityContext.fsGroup` | Group ID for the mounted volumes' filesystem | `1001` |
|
||||||
|
| `secondary.containerSecurityContext.enabled` | MariaDB secondary container securityContext | `true` |
|
||||||
|
| `secondary.containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` |
|
||||||
|
| `secondary.containerSecurityContext.runAsUser` | User ID for the MariaDB secondary container | `1001` |
|
||||||
|
| `secondary.containerSecurityContext.runAsGroup` | Group ID for the MariaDB secondary container | `1001` |
|
||||||
|
| `secondary.containerSecurityContext.runAsNonRoot` | Set secondary container's Security Context runAsNonRoot | `true` |
|
||||||
|
| `secondary.containerSecurityContext.privileged` | Set secondary container's Security Context privileged | `false` |
|
||||||
|
| `secondary.containerSecurityContext.allowPrivilegeEscalation` | Set secondary container's Security Context allowPrivilegeEscalation | `false` |
|
||||||
|
| `secondary.containerSecurityContext.readOnlyRootFilesystem` | Set container's Security Context readOnlyRootFilesystem | `true` |
|
||||||
|
| `secondary.containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
|
||||||
|
| `secondary.containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
|
||||||
|
| `secondary.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if secondary.resources is set (secondary.resources is recommended for production). | `small` |
|
||||||
|
| `secondary.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
|
| `secondary.startupProbe.enabled` | Enable startupProbe | `false` |
|
||||||
|
| `secondary.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `120` |
|
||||||
|
| `secondary.startupProbe.periodSeconds` | Period seconds for startupProbe | `15` |
|
||||||
|
| `secondary.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
|
||||||
|
| `secondary.startupProbe.failureThreshold` | Failure threshold for startupProbe | `10` |
|
||||||
|
| `secondary.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
|
||||||
|
| `secondary.livenessProbe.enabled` | Enable livenessProbe | `true` |
|
||||||
|
| `secondary.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `120` |
|
||||||
|
| `secondary.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
|
||||||
|
| `secondary.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `1` |
|
||||||
|
| `secondary.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
|
||||||
|
| `secondary.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
|
||||||
|
| `secondary.readinessProbe.enabled` | Enable readinessProbe | `true` |
|
||||||
|
| `secondary.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` |
|
||||||
|
| `secondary.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
|
||||||
|
| `secondary.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
|
||||||
|
| `secondary.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
|
||||||
|
| `secondary.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
|
||||||
|
| `secondary.customStartupProbe` | Override default startup probe for MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.customLivenessProbe` | Override default liveness probe for MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.customReadinessProbe` | Override default readiness probe for MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.startupWaitOptions` | Override default builtin startup wait check options for MariaDB secondary containers | `{}` |
|
||||||
|
| `secondary.extraFlags` | MariaDB secondary additional command line flags | `""` |
|
||||||
|
| `secondary.extraEnvVars` | Extra environment variables to be set on MariaDB secondary containers | `[]` |
|
||||||
|
| `secondary.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for MariaDB secondary containers | `""` |
|
||||||
|
| `secondary.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for MariaDB secondary containers | `""` |
|
||||||
|
| `secondary.persistence.enabled` | Enable persistence on MariaDB secondary replicas using a `PersistentVolumeClaim` | `true` |
|
||||||
|
| `secondary.persistence.subPath` | Subdirectory of the volume to mount at | `""` |
|
||||||
|
| `secondary.persistence.storageClass` | MariaDB secondary persistent volume storage Class | `""` |
|
||||||
|
| `secondary.persistence.labels` | Labels for the PVC | `{}` |
|
||||||
|
| `secondary.persistence.annotations` | MariaDB secondary persistent volume claim annotations | `{}` |
|
||||||
|
| `secondary.persistence.accessModes` | MariaDB secondary persistent volume access Modes | `["ReadWriteOnce"]` |
|
||||||
|
| `secondary.persistence.size` | MariaDB secondary persistent volume size | `8Gi` |
|
||||||
|
| `secondary.persistence.selector` | Selector to match an existing Persistent Volume | `{}` |
|
||||||
|
| `secondary.extraVolumes` | Optionally specify extra list of additional volumes to the MariaDB secondary pod(s) | `[]` |
|
||||||
|
| `secondary.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MariaDB secondary container(s) | `[]` |
|
||||||
|
| `secondary.initContainers` | Add additional init containers for the MariaDB secondary pod(s) | `[]` |
|
||||||
|
| `secondary.sidecars` | Add additional sidecar containers for the MariaDB secondary pod(s) | `[]` |
|
||||||
|
| `secondary.service.type` | MariaDB secondary Kubernetes service type | `ClusterIP` |
|
||||||
|
| `secondary.service.ports.mysql` | MariaDB secondary Kubernetes service port for MariaDB | `3306` |
|
||||||
|
| `secondary.service.ports.metrics` | MariaDB secondary Kubernetes service port for metrics | `9104` |
|
||||||
|
| `secondary.service.nodePorts.mysql` | MariaDB secondary Kubernetes service node port | `""` |
|
||||||
|
| `secondary.service.clusterIP` | MariaDB secondary Kubernetes service clusterIP IP | `""` |
|
||||||
|
| `secondary.service.loadBalancerIP` | MariaDB secondary loadBalancerIP if service type is `LoadBalancer` | `""` |
|
||||||
|
| `secondary.service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
|
||||||
|
| `secondary.service.loadBalancerSourceRanges` | Address that are allowed when MariaDB secondary service is LoadBalancer | `[]` |
|
||||||
|
| `secondary.service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
|
||||||
|
| `secondary.service.annotations` | Provide any additional annotations which may be required | `{}` |
|
||||||
|
| `secondary.service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
|
||||||
|
| `secondary.service.sessionAffinityConfig` | Additional settings for the sessionAffinity. Ignored if `secondary.service.sessionAffinity` is `None` | `{}` |
|
||||||
|
| `secondary.pdb.create` | Enable/disable a Pod Disruption Budget creation for MariaDB secondary pods | `true` |
|
||||||
|
| `secondary.pdb.minAvailable` | Minimum number/percentage of MariaDB secondary pods that should remain scheduled | `""` |
|
||||||
|
| `secondary.pdb.maxUnavailable` | Maximum number/percentage of MariaDB secondary pods that may be made unavailable. Defaults to `1` if both `secondary.pdb.minAvailable` and `secondary.pdb.maxUnavailable` are empty. | `""` |
|
||||||
|
| `secondary.revisionHistoryLimit` | Maximum number of revisions that will be maintained in the StatefulSet | `10` |
|
||||||
|
| `secondary.fips.openssl` | Configure OpenSSL FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used | `""` |
|
||||||
|
|
||||||
|
### RBAC parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| --------------------------------------------- | -------------------------------------------------------------- | ------- |
|
||||||
|
| `serviceAccount.create` | Enable the creation of a ServiceAccount for MariaDB pods | `true` |
|
||||||
|
| `serviceAccount.name` | Name of the created ServiceAccount | `""` |
|
||||||
|
| `serviceAccount.annotations` | Annotations for MariaDB Service Account | `{}` |
|
||||||
|
| `serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `false` |
|
||||||
|
| `rbac.create` | Whether to create and use RBAC resources or not | `false` |
|
||||||
|
|
||||||
|
### Password update job
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
|
||||||
|
| `passwordUpdateJob.enabled` | Enable password update job | `false` |
|
||||||
|
| `passwordUpdateJob.backoffLimit` | set backoff limit of the job | `10` |
|
||||||
|
| `passwordUpdateJob.command` | Override default container command on MariaDB Primary container(s) (useful when using custom images) | `[]` |
|
||||||
|
| `passwordUpdateJob.args` | Override default container args on MariaDB Primary container(s) (useful when using custom images) | `[]` |
|
||||||
|
| `passwordUpdateJob.extraCommands` | Extra commands to pass to the generation job | `""` |
|
||||||
|
| `passwordUpdateJob.previousPasswords.rootPassword` | Previous root password (set if the password secret was already changed) | `""` |
|
||||||
|
| `passwordUpdateJob.previousPasswords.password` | Previous password (set if the password secret was already changed) | `""` |
|
||||||
|
| `passwordUpdateJob.previousPasswords.replicationPassword` | Previous replication password (set if the password secret was already changed) | `""` |
|
||||||
|
| `passwordUpdateJob.previousPasswords.existingSecret` | Name of a secret containing the previous passwords (set if the password secret was already changed) | `""` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.enabled` | Enabled containers' Security Context | `true` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.runAsGroup` | Set containers' Security Context runAsGroup | `1001` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.runAsNonRoot` | Set container's Security Context runAsNonRoot | `true` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.privileged` | Set container's Security Context privileged | `false` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.readOnlyRootFilesystem` | Set container's Security Context readOnlyRootFilesystem | `true` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.allowPrivilegeEscalation` | Set container's Security Context allowPrivilegeEscalation | `false` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
|
||||||
|
| `passwordUpdateJob.containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
|
||||||
|
| `passwordUpdateJob.podSecurityContext.enabled` | Enabled credential init job pods' Security Context | `true` |
|
||||||
|
| `passwordUpdateJob.podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` |
|
||||||
|
| `passwordUpdateJob.podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` |
|
||||||
|
| `passwordUpdateJob.podSecurityContext.supplementalGroups` | Set filesystem extra groups | `[]` |
|
||||||
|
| `passwordUpdateJob.podSecurityContext.fsGroup` | Set credential init job pod's Security Context fsGroup | `1001` |
|
||||||
|
| `passwordUpdateJob.extraEnvVars` | Array containing extra env vars to configure the credential init job | `[]` |
|
||||||
|
| `passwordUpdateJob.extraEnvVarsCM` | ConfigMap containing extra env vars to configure the credential init job | `""` |
|
||||||
|
| `passwordUpdateJob.extraEnvVarsSecret` | Secret containing extra env vars to configure the credential init job (in case of sensitive data) | `""` |
|
||||||
|
| `passwordUpdateJob.extraVolumes` | Optionally specify extra list of additional volumes for the credential init job | `[]` |
|
||||||
|
| `passwordUpdateJob.extraVolumeMounts` | Array of extra volume mounts to be added to the jwt Container (evaluated as template). Normally used with `extraVolumes`. | `[]` |
|
||||||
|
| `passwordUpdateJob.initContainers` | Add additional init containers for the MariaDB Primary pod(s) | `[]` |
|
||||||
|
| `passwordUpdateJob.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if passwordUpdateJob.resources is set (passwordUpdateJob.resources is recommended for production). | `micro` |
|
||||||
|
| `passwordUpdateJob.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
|
| `passwordUpdateJob.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
|
||||||
|
| `passwordUpdateJob.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
|
||||||
|
| `passwordUpdateJob.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
|
||||||
|
| `passwordUpdateJob.automountServiceAccountToken` | Mount Service Account token in pod | `false` |
|
||||||
|
| `passwordUpdateJob.hostAliases` | Add deployment host aliases | `[]` |
|
||||||
|
| `passwordUpdateJob.annotations` | Add annotations to the job | `{}` |
|
||||||
|
| `passwordUpdateJob.podLabels` | Additional pod labels | `{}` |
|
||||||
|
| `passwordUpdateJob.podAnnotations` | Additional pod annotations | `{}` |
|
||||||
|
| `passwordUpdateJob.fips.openssl` | Configure OpenSSL FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used | `""` |
|
||||||
|
|
||||||
|
### Volume Permissions parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
||||||
|
| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
|
||||||
|
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `REGISTRY_NAME` |
|
||||||
|
| `volumePermissions.image.repository` | Init container volume-permissions image repository | `REPOSITORY_NAME/os-shell` |
|
||||||
|
| `volumePermissions.image.digest` | Init container volume-permissions image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` |
|
||||||
|
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` |
|
||||||
|
| `volumePermissions.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
|
||||||
|
| `volumePermissions.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if volumePermissions.resources is set (volumePermissions.resources is recommended for production). | `nano` |
|
||||||
|
| `volumePermissions.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
|
| `volumePermissions.fips.openssl` | Configure OpenSSL FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used | `""` |
|
||||||
|
|
||||||
|
### Metrics parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
||||||
|
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
|
||||||
|
| `metrics.image.registry` | Exporter image registry | `REGISTRY_NAME` |
|
||||||
|
| `metrics.image.repository` | Exporter image repository | `REPOSITORY_NAME/mysqld-exporter` |
|
||||||
|
| `metrics.image.digest` | Exporter image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` |
|
||||||
|
| `metrics.image.pullPolicy` | Exporter image pull policy | `IfNotPresent` |
|
||||||
|
| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
|
||||||
|
| `metrics.annotations` | Annotations for the Exporter pod | `{}` |
|
||||||
|
| `metrics.extraArgs` | Extra args to be passed to mysqld_exporter | `{}` |
|
||||||
|
| `metrics.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MariaDB metrics container(s) | `{}` |
|
||||||
|
| `metrics.containerPorts.http` | Container port for http | `9104` |
|
||||||
|
| `metrics.containerSecurityContext.enabled` | Enable security context for MariaDB metrics container | `false` |
|
||||||
|
| `metrics.containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` |
|
||||||
|
| `metrics.containerSecurityContext.runAsUser` | User ID for the MariaDB metrics container | `1001` |
|
||||||
|
| `metrics.containerSecurityContext.runAsGroup` | Group ID for the MariaDB metrics container | `1001` |
|
||||||
|
| `metrics.containerSecurityContext.runAsNonRoot` | Set metrics container's Security Context runAsNonRoot | `true` |
|
||||||
|
| `metrics.containerSecurityContext.privileged` | Set metrics container's Security Context privileged | `false` |
|
||||||
|
| `metrics.containerSecurityContext.allowPrivilegeEscalation` | Set metrics container's Security Context allowPrivilegeEscalation | `false` |
|
||||||
|
| `metrics.containerSecurityContext.readOnlyRootFilesystem` | Set container's Security Context readOnlyRootFilesystem | `true` |
|
||||||
|
| `metrics.containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
|
||||||
|
| `metrics.containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
|
||||||
|
| `metrics.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if metrics.resources is set (metrics.resources is recommended for production). | `nano` |
|
||||||
|
| `metrics.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
|
| `metrics.fips.openssl` | Configure OpenSSL FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used | `""` |
|
||||||
|
| `metrics.fips.golang` | Configure Golang FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used | `relaxed` |
|
||||||
|
| `metrics.livenessProbe.enabled` | Enable livenessProbe | `true` |
|
||||||
|
| `metrics.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `120` |
|
||||||
|
| `metrics.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
|
||||||
|
| `metrics.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `1` |
|
||||||
|
| `metrics.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
|
||||||
|
| `metrics.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
|
||||||
|
| `metrics.readinessProbe.enabled` | Enable readinessProbe | `true` |
|
||||||
|
| `metrics.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` |
|
||||||
|
| `metrics.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
|
||||||
|
| `metrics.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
|
||||||
|
| `metrics.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
|
||||||
|
| `metrics.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
|
||||||
|
| `metrics.serviceMonitor.enabled` | Create ServiceMonitor Resource for scraping metrics using PrometheusOperator | `false` |
|
||||||
|
| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `""` |
|
||||||
|
| `metrics.serviceMonitor.jobLabel` | The name of the label on the target service to use as the job name in prometheus. | `""` |
|
||||||
|
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped | `30s` |
|
||||||
|
| `metrics.serviceMonitor.scrapeTimeout` | Specify the timeout after which the scrape is ended | `""` |
|
||||||
|
| `metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping | `[]` |
|
||||||
|
| `metrics.serviceMonitor.metricRelabelings` | MetricRelabelConfigs to apply to samples before ingestion | `[]` |
|
||||||
|
| `metrics.serviceMonitor.honorLabels` | honorLabels chooses the metric's labels on collisions with target labels | `false` |
|
||||||
|
| `metrics.serviceMonitor.selector` | ServiceMonitor selector labels | `{}` |
|
||||||
|
| `metrics.serviceMonitor.labels` | Extra labels for the ServiceMonitor | `{}` |
|
||||||
|
| `metrics.prometheusRule.enabled` | if `true`, creates a Prometheus Operator PrometheusRule (also requires `metrics.enabled` to be `true` and `metrics.prometheusRule.rules`) | `false` |
|
||||||
|
| `metrics.prometheusRule.namespace` | Namespace for the PrometheusRule Resource (defaults to the Release Namespace) | `""` |
|
||||||
|
| `metrics.prometheusRule.additionalLabels` | Additional labels that can be used so PrometheusRule will be discovered by Prometheus | `{}` |
|
||||||
|
| `metrics.prometheusRule.rules` | Prometheus Rule definitions | `[]` |
|
||||||
|
|
||||||
|
### NetworkPolicy parameters
|
||||||
|
|
||||||
|
| Name | Description | Value |
|
||||||
|
| --------------------------------------- | --------------------------------------------------------------- | ------ |
|
||||||
|
| `networkPolicy.enabled` | Enable creation of NetworkPolicy resources | `true` |
|
||||||
|
| `networkPolicy.allowExternal` | The Policy model to apply | `true` |
|
||||||
|
| `networkPolicy.allowExternalEgress` | Allow the pod to access any range of port and all destinations. | `true` |
|
||||||
|
| `networkPolicy.extraIngress` | Add extra ingress rules to the NetworkPolicy | `[]` |
|
||||||
|
| `networkPolicy.extraEgress` | Add extra ingress rules to the NetworkPolicy | `[]` |
|
||||||
|
| `networkPolicy.ingressNSMatchLabels` | Labels to match to allow traffic from other namespaces | `{}` |
|
||||||
|
| `networkPolicy.ingressNSPodMatchLabels` | Pod labels to match to allow traffic from other namespaces | `{}` |
|
||||||
|
|
||||||
|
The above parameters map to the env variables defined in [bitnami/mariadb](https://github.com/bitnami/containers/tree/main/bitnami/mariadb). For more information please refer to the [bitnami/mariadb](https://github.com/bitnami/containers/tree/main/bitnami/mariadb) image documentation.
|
||||||
|
|
||||||
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install my-release \
|
||||||
|
--set auth.rootPassword=secretpassword,auth.database=app_database \
|
||||||
|
oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
|
||||||
|
|
||||||
|
The above command sets the MariaDB `root` account password to `secretpassword`. Additionally it creates a database named `my_database`.
|
||||||
|
|
||||||
|
> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
|
||||||
|
|
||||||
|
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install my-release -f values.yaml oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
|
||||||
|
> **Tip**: You can use the default [values.yaml](https://github.com/bitnami/charts/tree/main/bitnami/mariadb/values.yaml)
|
||||||
|
|
||||||
|
## 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 20.2.0
|
||||||
|
|
||||||
|
This version introduces image verification for security purposes. To disable it, set `global.security.allowInsecureImages` to `true`. More details at [GitHub issue](https://github.com/bitnami/charts/issues/30850).
|
||||||
|
|
||||||
|
It's necessary to set the `auth.rootPassword` parameter when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use under the 'Administrator credentials' section. Please note down the password and run the command below to upgrade your chart:
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm upgrade my-release oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb --set auth.rootPassword=[ROOT_PASSWORD]
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
|
||||||
|
|
||||||
|
| Note: you need to substitute the placeholder _[ROOT_PASSWORD]_ with the value obtained in the installation notes.
|
||||||
|
|
||||||
|
### To 20.0.0
|
||||||
|
|
||||||
|
This major bump updates the StatefulSet objects `serviceName` to use a headless service, as the current non-headless service attached to it was not providing DNS entries. This will cause an upgrade issue because it changes "immutable fields". To workaround it, delete the StatefulSet objects as follows (replace the RELEASE_NAME placeholder):
|
||||||
|
|
||||||
|
```shell
|
||||||
|
|
||||||
|
# If architecture = "standalone"
|
||||||
|
kubectl delete sts RELEASE_NAME --cascade=false
|
||||||
|
|
||||||
|
# If architecture = "replication"
|
||||||
|
kubectl delete sts RELEASE_NAME-primary --cascade=false
|
||||||
|
kubectl delete sts RELEASE_NAME-secondary --cascade=false
|
||||||
|
```
|
||||||
|
|
||||||
|
Then execute `helm upgrade` as usual.
|
||||||
|
|
||||||
|
Additionally, this new major provides a new, optional, password update job for automating this second-day operation in the chart. See the [Update credential](#password-update-job) for detailed instructions.
|
||||||
|
|
||||||
|
### To 19.0.0
|
||||||
|
|
||||||
|
This major release bumps the MariaDB version to 11.4. Follow the [upstream instructions](https://mariadb.com/kb/en/upgrading-between-minor-versions-on-linux/) for upgrading from MariaDB 11.3 to 11.4. No major issues are expected during the upgrade.
|
||||||
|
|
||||||
|
### To 18.0.0
|
||||||
|
|
||||||
|
This major release bumps the MariaDB version to 11.3. Follow the [upstream instructions](https://mariadb.com/kb/en/upgrading-between-minor-versions-on-linux/) for upgrading from MariaDB 11.2 to 11.3. No major issues are expected during the upgrade.
|
||||||
|
|
||||||
|
### To 17.0.0
|
||||||
|
|
||||||
|
This major bump changes the following security defaults:
|
||||||
|
|
||||||
|
- `runAsGroup` is changed from `0` to `1001`
|
||||||
|
- `readOnlyRootFilesystem` is set to `true`
|
||||||
|
- `resourcesPreset` is changed from `none` to the minimum size working in our test suites (NOTE: `resourcesPreset` is not meant for production usage, but `resources` adapted to your use case).
|
||||||
|
- `global.compatibility.openshift.adaptSecurityContext` is changed from `disabled` to `auto`.
|
||||||
|
|
||||||
|
This could potentially break any customization or init scripts used in your deployment. If this is the case, change the default values to the previous ones.
|
||||||
|
|
||||||
|
### To 16.0.0
|
||||||
|
|
||||||
|
This section enables NetworkPolicies by default to increase security of the application. It also adapts the values in the `networkPolicy` section to the current Bitnami standards. The removed sections are `networkPolicy.metrics.*`, `networkPolicy.ingressRules.*` and `networkPolicy.egressRules.*`. Check the Parameters table for the new structure.
|
||||||
|
|
||||||
|
### To 14.0.0
|
||||||
|
|
||||||
|
This major release bumps the MariaDB version to 11.1. Follow the [upstream instructions](https://mariadb.com/kb/en/upgrading-between-minor-versions-on-linux/) for upgrading from MariaDB 11.0 to 11.1. No major issues are expected during the upgrade.
|
||||||
|
|
||||||
|
### To 13.0.0
|
||||||
|
|
||||||
|
This major release bumps the MariaDB version to 11.0. Follow the [upstream instructions](https://mariadb.com/kb/en/upgrading-from-mariadb-10-11-to-mariadb-11-0/) for upgrading from MariaDB 10.11 to 11.0. No major issues are expected during the upgrade.
|
||||||
|
|
||||||
|
### To 11.0.0
|
||||||
|
|
||||||
|
This major release bumps default MariaDB branch to 10.6. Follow the [official instructions](https://mariadb.com/kb/en/upgrading-from-mariadb-105-to-mariadb-106/) from upgrading between 10.5 and 10.6.
|
||||||
|
|
||||||
|
No major issues are expected during the upgrade.
|
||||||
|
|
||||||
|
### To 10.0.0
|
||||||
|
|
||||||
|
This major release renames several values in this chart and adds missing features, in order to be inline with the rest of assets in the Bitnami charts repository.
|
||||||
|
|
||||||
|
Affected values:
|
||||||
|
|
||||||
|
- `primary.service.port` was deprecated, we recommend using `primary.service.ports.mysql` instead.
|
||||||
|
- `primary.service.nodePort` was deprecated, we recommend using `primary.service.nodePorts.mysql` instead.
|
||||||
|
- `secondary.service.port` was deprecated, we recommend using `secondary.service.ports.mysql` instead.
|
||||||
|
- `secondary.service.nodePort` was deprecated, we recommend using `secondary.service.nodePorts.mysql` instead.
|
||||||
|
- `metrics.serviceMonitor.additionalLabels` was deprecated, we recommend using `metrics.serviceMonitor.selector` instead.
|
||||||
|
- `primary.pdb.enabled` renamed as `primary.pdb.create`.
|
||||||
|
- `secondary.pdb.enabled` renamed as `secondary.pdb.create`.
|
||||||
|
- `primary.updateStrategy` changed from String type (previously default to 'rollingUpdate') to Object type, allowing users to configure other updateStrategy parameters, similar to other charts.
|
||||||
|
- Removed value `primary.rollingUpdatePartition`, now configured using `primary.updateStrategy` setting `primary.updateStrategy.rollingUpdate.partition`.
|
||||||
|
- `secondary.updateStrategy` changed from String type (previously default to 'rollingUpdate') to Object type, allowing users to configure other updateStrategy parameters, similar to other charts.
|
||||||
|
- Removed value `secondary.rollingUpdatePartition`, now configured using `secondary.updateStrategy` setting `secondary.updateStrategy.rollingUpdate.partition`.
|
||||||
|
- `metrics.serviceMonitor.relabellings`, previously used to configure ServiceMonitor metricRelabelings, has been replaced with the value `metrics.serviceMonitor.metricRelabelings`, and new value `metrics.serviceMonitor.relabelings` can be used to set ServiceMonitor relabelings parameter
|
||||||
|
|
||||||
|
### To 9.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.
|
||||||
|
|
||||||
|
### To 8.0.0
|
||||||
|
|
||||||
|
- Several parameters were renamed or disappeared in favor of new ones on this major version:
|
||||||
|
- The terms _master_ and _slave_ have been replaced by the terms _primary_ and _secondary_. Therefore, parameters prefixed with `master` or `slave` are now prefixed with `primary` or `secondary`, respectively.
|
||||||
|
- `securityContext.*` is deprecated in favor of `primary.podSecurityContext`, `primary.containerSecurityContext`, `secondary.podSecurityContext`, and `secondary.containerSecurityContext`.
|
||||||
|
- Credentials parameter are reorganized under the `auth` parameter.
|
||||||
|
- `replication.enabled` parameter is deprecated in favor of `architecture` parameter that accepts two values: `standalone` and `replication`.
|
||||||
|
- The default MariaDB version was updated from 10.3 to 10.5. According to the official documentation, upgrading from 10.3 should be painless. However, there are some things that have changed which could affect an upgrade:
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.3 to MariaDB 10.4](https://mariadb.com/kb/en/upgrading-from-mariadb-103-to-mariadb-104/#incompatible-changes-between-103-and-104).
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.4 to MariaDB 10.5](https://mariadb.com/kb/en/upgrading-from-mariadb-104-to-mariadb-105/#incompatible-changes-between-104-and-105).
|
||||||
|
- Chart labels were adapted to follow the [Helm charts standard labels](https://helm.sh/docs/chart_best_practices/labels/#standard-labels).
|
||||||
|
- This version also 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/main/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||||
|
|
||||||
|
Consequences:
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed. To upgrade to `8.0.0`, install a new release of the MariaDB chart, and migrate the data from your previous release. You have 2 alternatives to do so:
|
||||||
|
|
||||||
|
- Create a backup of the database, and restore it on the new release using tools such as [mysqldump](https://mariadb.com/kb/en/mysqldump/).
|
||||||
|
- Reuse the PVC used to hold the master data on your previous release. To do so, use the `primary.persistence.existingClaim` parameter. The following example assumes that the release name is `mariadb`:
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install mariadb oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb --set auth.rootPassword=[ROOT_PASSWORD] --set primary.persistence.existingClaim=[EXISTING_PVC]
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
|
||||||
|
|
||||||
|
| Note: you need to substitute the placeholder _[EXISTING_PVC]_ with the name of the PVC used on your previous release, and _[ROOT_PASSWORD]_ with the root password used in your previous release.
|
||||||
|
|
||||||
|
### To 7.0.0
|
||||||
|
|
||||||
|
Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec.
|
||||||
|
|
||||||
|
In <https://github.com/helm/charts/pull/17308> the `apiVersion` of the statefulset resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.
|
||||||
|
|
||||||
|
This major version bump signifies this change.
|
||||||
|
|
||||||
|
### To 6.0.0
|
||||||
|
|
||||||
|
MariaDB version was updated from 10.1 to 10.3, there are no changes in the chart itself. According to the official documentation, upgrading from 10.1 should be painless. However, there are some things that have changed which could affect an upgrade:
|
||||||
|
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.1 to MariaDB 10.2](https://mariadb.com/kb/en/library/upgrading-from-mariadb-101-to-mariadb-102//#incompatible-changes-between-101-and-102)
|
||||||
|
- [Incompatible changes upgrading from MariaDB 10.2 to MariaDB 10.3](https://mariadb.com/kb/en/library/upgrading-from-mariadb-102-to-mariadb-103/#incompatible-changes-between-102-and-103)
|
||||||
|
|
||||||
|
### To 5.0.0
|
||||||
|
|
||||||
|
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||||
|
Use the workaround below to upgrade from versions previous to 5.0.0. The following example assumes that the release name is mariadb:
|
||||||
|
|
||||||
|
```console
|
||||||
|
kubectl delete statefulset opencart-mariadb --cascade=false
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Copyright © 2025 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
26
charts/semaphore/charts/mariadb/charts/common/.helmignore
Normal file
26
charts/semaphore/charts/mariadb/charts/common/.helmignore
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
|
# img folder
|
||||||
|
img/
|
||||||
|
# Changelog
|
||||||
|
CHANGELOG.md
|
||||||
25
charts/semaphore/charts/mariadb/charts/common/Chart.yaml
Normal file
25
charts/semaphore/charts/mariadb/charts/common/Chart.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
annotations:
|
||||||
|
fips: "true"
|
||||||
|
images: |
|
||||||
|
[]
|
||||||
|
licenses: Apache-2.0
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2.33.1
|
||||||
|
description: A Library Helm Chart for grouping common logic between bitnami charts.
|
||||||
|
This chart is not deployable by itself.
|
||||||
|
home: https://bitnami.com
|
||||||
|
icon: https://dyltqmyl993wv.cloudfront.net/downloads/logos/bitnami-mark.png
|
||||||
|
keywords:
|
||||||
|
- common
|
||||||
|
- helper
|
||||||
|
- template
|
||||||
|
- function
|
||||||
|
- bitnami
|
||||||
|
maintainers:
|
||||||
|
- name: Broadcom, Inc. All Rights Reserved.
|
||||||
|
url: https://github.com/bitnami/charts
|
||||||
|
name: common
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts/tree/main/bitnami/common
|
||||||
|
type: library
|
||||||
|
version: 2.33.1
|
||||||
395
charts/semaphore/charts/mariadb/charts/common/README.md
Normal file
395
charts/semaphore/charts/mariadb/charts/common/README.md
Normal file
@ -0,0 +1,395 @@
|
|||||||
|
<!--- app-name: Common -->
|
||||||
|
|
||||||
|
# Common library for Bitnami packages
|
||||||
|
|
||||||
|
A Library Helm Chart for grouping common logic between bitnami charts. This chart is not deployable by itself.
|
||||||
|
|
||||||
|
[Overview of Common](https://github.com/bitnami/charts/tree/main/bitnami/common)
|
||||||
|
|
||||||
|
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
version: 2.x.x
|
||||||
|
repository: oci://MY-OCI-REGISTRY
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm dependency update
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
data:
|
||||||
|
myvalue: "Hello World"
|
||||||
|
```
|
||||||
|
|
||||||
|
Looking to use our applications in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the commercial edition of the Bitnami catalog.
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.23+
|
||||||
|
- Helm 3.8.0+
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following table lists the helpers available in the library which are scoped in different sections.
|
||||||
|
|
||||||
|
### Affinities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------ |
|
||||||
|
| `common.affinities.nodes.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.nodes.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.nodes` | Return a nodeAffinity definition | `dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.topologyKey` | Return a topologyKey definition | `dict "topologyKey" "FOO"` |
|
||||||
|
| `common.affinities.pods.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
| `common.affinities.pods.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
| `common.affinities.pods` | Return a podAffinity/podAntiAffinity definition | `dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
|
||||||
|
### Capabilities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------- |
|
||||||
|
| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context |
|
||||||
|
| `common.capabilities.apiVersions.has` | Return true if the apiVersion is supported | `dict "version" "batch/v1" "context" $` |
|
||||||
|
| `common.capabilities.job.apiVersion` | Return the appropriate apiVersion for job. | `.` Chart context |
|
||||||
|
| `common.capabilities.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` Chart context |
|
||||||
|
| `common.capabilities.daemonset.apiVersion` | Return the appropriate apiVersion for daemonset. | `.` Chart context |
|
||||||
|
| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context |
|
||||||
|
| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context |
|
||||||
|
| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context |
|
||||||
|
| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context |
|
||||||
|
| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context |
|
||||||
|
| `common.capabilities.policy.apiVersion` | Return the appropriate apiVersion for podsecuritypolicy. | `.` Chart context |
|
||||||
|
| `common.capabilities.networkPolicy.apiVersion` | Return the appropriate apiVersion for networkpolicy. | `.` Chart context |
|
||||||
|
| `common.capabilities.apiService.apiVersion` | Return the appropriate apiVersion for APIService. | `.` Chart context |
|
||||||
|
| `common.capabilities.hpa.apiVersion` | Return the appropriate apiVersion for Horizontal Pod Autoscaler | `.` Chart context |
|
||||||
|
| `common.capabilities.vpa.apiVersion` | Return the appropriate apiVersion for Vertical Pod Autoscaler. | `.` Chart context |
|
||||||
|
| `common.capabilities.psp.supported` | Returns true if PodSecurityPolicy is supported | `.` Chart context |
|
||||||
|
| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context |
|
||||||
|
| `common.capabilities.admissionConfiguration.supported` | Returns true if AdmissionConfiguration is supported | `.` Chart context |
|
||||||
|
| `common.capabilities.admissionConfiguration.apiVersion` | Return the appropriate apiVersion for AdmissionConfiguration. | `.` Chart context |
|
||||||
|
| `common.capabilities.podSecurityConfiguration.apiVersion` | Return the appropriate apiVersion for PodSecurityConfiguration. | `.` Chart context |
|
||||||
|
|
||||||
|
### Certificates
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.certs.sans`| Returns a space-separated list of Subject Alternative Names (SANs) to create a TLS certificate | `dict "namespace" "default" "clusterDomain" "cluster.local" "serviceName" "my-service" "headlessServiceName" "my-service-headless"` |
|
||||||
|
|
||||||
|
### Compatibility
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||||
|
| `common.compatibility.isOpenshift` | Return true if the detected platform is Openshift | `.` Chart context |
|
||||||
|
| `common.compatibility.renderSecurityContext` | 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 | `dict "secContext" .Values.containerSecurityContext "context" $` |
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||||
|
| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` |
|
||||||
|
| `common.errors.insecureImages` | Throw error when original container images are replaced. The error can be bypassed by setting the `global.security.allowInsecureImages` to true. | `dict "images" (list .Values.path.to.the.imageRoot) "context" $` |
|
||||||
|
|
||||||
|
### Images
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` |
|
||||||
|
| `common.images.renderPullSecrets` | Return the proper Docker Image Registry Secret Names (evaluates values as templates) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $` |
|
||||||
|
| `common.images.version` | Return the proper image version | `dict "imageRoot" .Values.path.to.the.image "chart" .Chart` , see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
|
||||||
|
### Ingress
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences |
|
||||||
|
| `common.ingress.certManagerRequest` | Prints "true" if required cert-manager annotations for TLS signed certificates are set in the Ingress annotations | `dict "annotations" .Values.path.to.the.ingress.annotations` |
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------- | --------------------------------------------------------------------------- | ----------------- |
|
||||||
|
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
|
||||||
|
| `common.labels.matchLabels` | Labels to use on `deploy.spec.selector.matchLabels` and `svc.spec.selector` | `.` Chart context |
|
||||||
|
|
||||||
|
### Names
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ---------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
|
||||||
|
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
|
||||||
|
| `common.names.namespace` | Allow the release namespace to be overridden | `.` Chart context |
|
||||||
|
| `common.names.fullname.namespace` | Create a fully qualified app name adding the installation's namespace | `.` Chart context |
|
||||||
|
| `common.names.chart` | Chart name plus version | `.` Chart context |
|
||||||
|
| `common.names.dependency.fullname` | Create a default fully qualified dependency name. | `dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $` |
|
||||||
|
|
||||||
|
### Resources
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
||||||
|
| `common.resources.preset` | 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. | `dict "type" "nano"` |
|
||||||
|
|
||||||
|
### Secrets
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.secrets.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "honorProvidedValues" false "context" $`, length, strong, honorProvidedValues and chartName fields are optional. |
|
||||||
|
| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` |
|
||||||
|
| `common.secrets.lookup` | Reuses the value from an existing secret, otherwise sets its value to a default value. | `dict "secret" "secret-name" "key" "keyName" "defaultValue" .Values.myValue "context" $` |
|
||||||
|
|
||||||
|
### Storage
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ---------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.storage.class` | Return the proper Storage Class | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. |
|
||||||
|
|
||||||
|
### TplValues
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ---------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` |
|
||||||
|
| `common.tplvalues.merge` | Merge a list of values that contains template after rendering them. | `dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $` |
|
||||||
|
| `common.tplvalues.merge-overwrite` | Merge a list of values that contains template after rendering them. | `dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $` |
|
||||||
|
|
||||||
|
### Utils
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
||||||
|
| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` |
|
||||||
|
| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` |
|
||||||
|
| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` |
|
||||||
|
| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` |
|
||||||
|
| `common.utils.checksumTemplate` | Checksum a template at "path" containing a *single* resource (ConfigMap,Secret) for use in pod annotations, excluding the metadata (see #18376) | `dict "path" "/configmap.yaml" "context" $` |
|
||||||
|
|
||||||
|
### Validations
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. |
|
||||||
|
|
||||||
|
### Warnings
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| -------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
|
| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.warnings.modifiedImages` | Warning about replaced images from the original. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.warnings.resources` | Warning about not setting the resource object in all deployments. | `dict "sections" (list "path1" "path2") context $` |
|
||||||
|
|
||||||
|
### FIPS
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| -------------------- | ------------------- | ------------------------------------------------------------------------------- |
|
||||||
|
| `common.fips.enabled` | Enable FIPS mode | `.` Chart context |
|
||||||
|
| `common.fips.config` | Configure FIPS mode | `dict "tech" "openssl|java|golang" "fips" .Values.fips "global" .Values.global` |
|
||||||
|
|
||||||
|
## Special input schemas
|
||||||
|
|
||||||
|
### ImageRoot
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
registry:
|
||||||
|
type: string
|
||||||
|
description: Docker registry where the image is located
|
||||||
|
example: docker.io
|
||||||
|
|
||||||
|
repository:
|
||||||
|
type: string
|
||||||
|
description: Repository and image name
|
||||||
|
example: bitnami/nginx
|
||||||
|
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
description: image tag
|
||||||
|
example: 1.16.1-debian-10-r63
|
||||||
|
|
||||||
|
pullPolicy:
|
||||||
|
type: string
|
||||||
|
description: Specify a imagePullPolicy.'
|
||||||
|
|
||||||
|
pullSecrets:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: Optionally specify an array of imagePullSecrets (evaluated as templates).
|
||||||
|
|
||||||
|
debug:
|
||||||
|
type: boolean
|
||||||
|
description: Set to true if you would like to see extra information on logs
|
||||||
|
example: false
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# registry: docker.io
|
||||||
|
# repository: bitnami/nginx
|
||||||
|
# tag: 1.16.1-debian-10-r63
|
||||||
|
# pullPolicy: IfNotPresent
|
||||||
|
# debug: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Persistence
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Whether enable persistence.
|
||||||
|
example: true
|
||||||
|
|
||||||
|
storageClass:
|
||||||
|
type: string
|
||||||
|
description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
|
||||||
|
example: "-"
|
||||||
|
|
||||||
|
accessMode:
|
||||||
|
type: string
|
||||||
|
description: Access mode for the Persistent Volume Storage.
|
||||||
|
example: ReadWriteOnce
|
||||||
|
|
||||||
|
size:
|
||||||
|
type: string
|
||||||
|
description: Size the Persistent Volume Storage.
|
||||||
|
example: 8Gi
|
||||||
|
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
|
description: Path to be persisted.
|
||||||
|
example: /bitnami
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# enabled: true
|
||||||
|
# storageClass: "-"
|
||||||
|
# accessMode: ReadWriteOnce
|
||||||
|
# size: 8Gi
|
||||||
|
# path: /bitnami
|
||||||
|
```
|
||||||
|
|
||||||
|
### ExistingSecret
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Name of the existing secret.
|
||||||
|
example: mySecret
|
||||||
|
keyMapping:
|
||||||
|
description: Mapping between the expected key name and the name of the key in the existing secret.
|
||||||
|
type: object
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# name: mySecret
|
||||||
|
# keyMapping:
|
||||||
|
# password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example of use
|
||||||
|
|
||||||
|
When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# templates/secret.yaml
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ include "common.names.fullname" . }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
password: {{ .Values.password | b64enc | quote }}
|
||||||
|
|
||||||
|
# templates/dpl.yaml
|
||||||
|
---
|
||||||
|
...
|
||||||
|
env:
|
||||||
|
- name: PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
|
||||||
|
key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
|
||||||
|
...
|
||||||
|
|
||||||
|
# values.yaml
|
||||||
|
---
|
||||||
|
name: mySecret
|
||||||
|
keyMapping:
|
||||||
|
password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
### ValidateValue
|
||||||
|
|
||||||
|
#### NOTES.txt
|
||||||
|
|
||||||
|
```console
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
|
||||||
|
{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
```
|
||||||
|
|
||||||
|
If we force those values to be empty we will see some alerts
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install test mychart --set path.to.value00="",path.to.value01=""
|
||||||
|
'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 -d)
|
||||||
|
|
||||||
|
'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 -d)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
### To 1.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.
|
||||||
|
|
||||||
|
#### What changes were introduced in this major version?
|
||||||
|
|
||||||
|
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||||
|
- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
|
||||||
|
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||||
|
|
||||||
|
#### Considerations when upgrading to this version
|
||||||
|
|
||||||
|
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||||
|
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||||
|
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||||
|
|
||||||
|
#### Useful links
|
||||||
|
|
||||||
|
- <https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-resolve-helm2-helm3-post-migration-issues-index.html>
|
||||||
|
- <https://helm.sh/docs/topics/v2_v3_migration/>
|
||||||
|
- <https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Copyright © 2025 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
@ -0,0 +1,169 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.soft" -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
weight: 1
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.hard" -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.nodes.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.nodes.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a topologyKey definition
|
||||||
|
{{ include "common.affinities.topologyKey" (dict "topologyKey" "BAR") -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.topologyKey" -}}
|
||||||
|
{{ .topologyKey | default "kubernetes.io/hostname" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "customLabels" .Values.podLabels "extraMatchLabels" .Values.extraMatchLabels "topologyKey" "BAR" "extraPodAffinityTerms" .Values.extraPodAffinityTerms "extraNamespaces" (list "namespace1" "namespace2") "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.soft" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
{{- $customLabels := default (dict) .customLabels -}}
|
||||||
|
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
|
||||||
|
{{- $extraPodAffinityTerms := default (list) .extraPodAffinityTerms -}}
|
||||||
|
{{- $extraNamespaces := default (list) .extraNamespaces -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" .context )) | nindent 10 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := $extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $extraNamespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace }}
|
||||||
|
{{- with $extraNamespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
weight: 1
|
||||||
|
{{- range $extraPodAffinityTerms }}
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" $.context )) | nindent 10 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := .extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .namespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ $.context.Release.Namespace }}
|
||||||
|
{{- with .namespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
weight: {{ .weight | default 1 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "customLabels" .Values.podLabels "extraMatchLabels" .Values.extraMatchLabels "topologyKey" "BAR" "extraPodAffinityTerms" .Values.extraPodAffinityTerms "extraNamespaces" (list "namespace1" "namespace2") "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.hard" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
{{- $customLabels := default (dict) .customLabels -}}
|
||||||
|
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
|
||||||
|
{{- $extraPodAffinityTerms := default (list) .extraPodAffinityTerms -}}
|
||||||
|
{{- $extraNamespaces := default (list) .extraNamespaces -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" .context )) | nindent 8 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := $extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $extraNamespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace }}
|
||||||
|
{{- with $extraNamespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
{{- range $extraPodAffinityTerms }}
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" $.context )) | nindent 8 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := .extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .namespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ $.context.Release.Namespace }}
|
||||||
|
{{- with .namespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.pods.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.pods.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,178 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the target Kubernetes version
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.kubeVersion" -}}
|
||||||
|
{{- default (default .Capabilities.KubeVersion.Version .Values.kubeVersion) ((.Values.global).kubeVersion) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if the apiVersion is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.capabilities.apiVersions.has" (dict "version" "batch/v1" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.apiVersions.has" -}}
|
||||||
|
{{- $providedAPIVersions := default .context.Values.apiVersions ((.context.Values.global).apiVersions) -}}
|
||||||
|
{{- if and (empty $providedAPIVersions) (.context.Capabilities.APIVersions.Has .version) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else if has .version $providedAPIVersions -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for poddisruptionbudget.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.policy.apiVersion" -}}
|
||||||
|
{{- print "policy/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for networkpolicy.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.networkPolicy.apiVersion" -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for job.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.job.apiVersion" -}}
|
||||||
|
{{- print "batch/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for cronjob.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.cronjob.apiVersion" -}}
|
||||||
|
{{- print "batch/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for daemonset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.daemonset.apiVersion" -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for deployment.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.deployment.apiVersion" -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for statefulset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.statefulset.apiVersion" -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for ingress.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for RBAC resources.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.rbac.apiVersion" -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for CRDs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.crd.apiVersion" -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for APIService.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.apiService.apiVersion" -}}
|
||||||
|
{{- print "apiregistration.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for Horizontal Pod Autoscaler.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.hpa.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" .context -}}
|
||||||
|
{{- print "autoscaling/v2" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for Vertical Pod Autoscaler.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.vpa.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- print "autoscaling/v1beta2" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "autoscaling/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if PodSecurityPolicy is supported
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.psp.supported" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if or (empty $kubeVersion) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if AdmissionConfiguration is supported
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.admissionConfiguration.supported" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for AdmissionConfiguration.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.admissionConfiguration.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- print "apiserver.config.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apiserver.config.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for PodSecurityConfiguration.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.podSecurityConfiguration.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- print "pod-security.admission.config.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "pod-security.admission.config.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if the used Helm version is 3.3+.
|
||||||
|
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
|
||||||
|
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
|
||||||
|
**To be removed when the catalog's minimun Helm version is 3.3**
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.supportsHelmVersion" -}}
|
||||||
|
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns a space-separated list of Subject Alternative Names (SANs) to create a TLS certificate
|
||||||
|
Usage:
|
||||||
|
{{ include "common.certs.sans" (dict "namespace" "default" "clusterDomain" "cluster.local" "serviceName" "my-service" "headlessServiceName" "my-service-headless" "loopback" true "extraSANs" (list "custom.domain.com")) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- namespace - String - Required - Namespace where the app which we are generating the certificate for is deployed.
|
||||||
|
- clusterDomain - String - Optional - Cluster domain. Default is "cluster.local".
|
||||||
|
- serviceName - String - Optional - App service name. If provided, the following SANs will be generated:
|
||||||
|
- serviceName.namespace.svc.clusterDomain
|
||||||
|
- serviceName.namespace.svc
|
||||||
|
- serviceName.namespace
|
||||||
|
- serviceName
|
||||||
|
- headlessServiceName - String - Optional - App headless service name. If provided, the following wildcard SANs will be generated:
|
||||||
|
- *.headlessServiceName.namespace.svc.clusterDomain
|
||||||
|
- *.headlessServiceName.namespace.svc
|
||||||
|
- *.headlessServiceName.namespace
|
||||||
|
- *.headlessServiceName
|
||||||
|
- extraSANs - List<String> - Optional - Additional custom SANs to be added.
|
||||||
|
- loopback - Boolean - Optional - If true, "localhost" will be added to the SANs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.certs.sans" -}}
|
||||||
|
{{- $sans := list }}
|
||||||
|
{{- if .serviceName -}}
|
||||||
|
{{- $sans = append $sans (printf "%s.%s.svc.%s" .serviceName .namespace (default "cluster.local" .clusterDomain)) -}}
|
||||||
|
{{- $sans = append $sans (printf "%s.%s.svc" .serviceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans (printf "%s.%s" .serviceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans .serviceName -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .headlessServiceName -}}
|
||||||
|
{{- /* Include wildcard SANs for headless service */ -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s.%s.svc.%s" .headlessServiceName .namespace (default "cluster.local" .clusterDomain)) -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s.%s.svc" .headlessServiceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s.%s" .headlessServiceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s" .headlessServiceName) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- range .extraSANs }}
|
||||||
|
{{- $sans = append $sans . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if (default false .loopback) -}}
|
||||||
|
{{- $sans = append $sans "localhost" }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- join " " $sans | trim -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{/*
|
||||||
|
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 empty seLinuxOptions object if global.compatibility.omitEmptySeLinuxOptions is set to true */}}
|
||||||
|
{{- if and (((.context.Values.global).compatibility).omitEmptySeLinuxOptions) (not .secContext.seLinuxOptions) -}}
|
||||||
|
{{- $adaptedContext = omit $adaptedContext "seLinuxOptions" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{/* Remove fields that are disregarded when running the container in privileged mode */}}
|
||||||
|
{{- if $adaptedContext.privileged -}}
|
||||||
|
{{- $adaptedContext = omit $adaptedContext "capabilities" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- omit $adaptedContext "enabled" | toYaml -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Throw error when upgrading using empty passwords values that must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
|
||||||
|
|
||||||
|
Required password params:
|
||||||
|
- validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
|
||||||
|
- context - Context - Required. Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.errors.upgrade.passwords.empty" -}}
|
||||||
|
{{- $validationErrors := join "" .validationErrors -}}
|
||||||
|
{{- if and $validationErrors .context.Release.IsUpgrade -}}
|
||||||
|
{{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}}
|
||||||
|
{{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}}
|
||||||
|
{{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}}
|
||||||
|
{{- $errorString = print $errorString "\n%s" -}}
|
||||||
|
{{- printf $errorString $validationErrors | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Throw error when original container images are replaced.
|
||||||
|
The error can be bypassed by setting the "global.security.allowInsecureImages" to true. In this case,
|
||||||
|
a warning message will be shown instead.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.errors.insecureImages" (dict "images" (list .Values.path.to.the.imageRoot) "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.errors.insecureImages" -}}
|
||||||
|
{{- $relocatedImages := list -}}
|
||||||
|
{{- $replacedImages := list -}}
|
||||||
|
{{- $bitnamiLegacyImages := list -}}
|
||||||
|
{{- $retaggedImages := list -}}
|
||||||
|
{{- $globalRegistry := ((.context.Values.global).imageRegistry) -}}
|
||||||
|
{{- $originalImages := .context.Chart.Annotations.images -}}
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- $registryName := default .registry $globalRegistry -}}
|
||||||
|
{{- $fullImageNameNoTag := printf "%s/%s" $registryName .repository -}}
|
||||||
|
{{- $fullImageName := printf "%s:%s" $fullImageNameNoTag .tag -}}
|
||||||
|
{{- if not (contains $fullImageNameNoTag $originalImages) -}}
|
||||||
|
{{- if not (contains $registryName $originalImages) -}}
|
||||||
|
{{- $relocatedImages = append $relocatedImages $fullImageName -}}
|
||||||
|
{{- else if not (contains .repository $originalImages) -}}
|
||||||
|
{{- $replacedImages = append $replacedImages $fullImageName -}}
|
||||||
|
{{- if contains "docker.io/bitnamilegacy/" $fullImageNameNoTag -}}
|
||||||
|
{{- $bitnamiLegacyImages = append $bitnamiLegacyImages $fullImageName -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (contains (printf "%s:%s" .repository .tag) $originalImages) -}}
|
||||||
|
{{- $retaggedImages = append $retaggedImages $fullImageName -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if and (or (gt (len $relocatedImages) 0) (gt (len $replacedImages) 0)) (((.context.Values.global).security).allowInsecureImages) -}}
|
||||||
|
{{- print "\n\n⚠ SECURITY WARNING: Verifying original container images was skipped. Please note this Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Bitnami Secure Images containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables.\n" -}}
|
||||||
|
{{- else if (or (gt (len $relocatedImages) 0) (gt (len $replacedImages) 0)) -}}
|
||||||
|
{{- $errorString := "Original containers have been substituted for unrecognized ones. Deploying this chart with non-standard containers is likely to cause degraded security and performance, broken chart features, and missing environment variables." -}}
|
||||||
|
{{- $errorString = print $errorString "\n\nUnrecognized images:" -}}
|
||||||
|
{{- range (concat $relocatedImages $replacedImages) -}}
|
||||||
|
{{- $errorString = print $errorString "\n - " . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if and (eq (len $relocatedImages) 0) (eq (len $replacedImages) (len $bitnamiLegacyImages)) -}}
|
||||||
|
{{- $errorString = print "\n\n⚠ WARNING: " $errorString -}}
|
||||||
|
{{- print $errorString -}}
|
||||||
|
{{- else if or (contains "docker.io/bitnami/" $originalImages) (contains "docker.io/bitnamiprem/" $originalImages) (contains "docker.io/bitnamisecure/" $originalImages) -}}
|
||||||
|
{{- $errorString = print "\n\n⚠ ERROR: " $errorString -}}
|
||||||
|
{{- $errorString = print $errorString "\n\nIf you are sure you want to proceed with non-standard containers, you can skip container image verification by setting the global parameter 'global.security.allowInsecureImages' to true." -}}
|
||||||
|
{{- $errorString = print $errorString "\nFurther information can be obtained at https://github.com/bitnami/charts/issues/30850" -}}
|
||||||
|
{{- print $errorString | fail -}}
|
||||||
|
{{- else if gt (len $replacedImages) 0 -}}
|
||||||
|
{{- $errorString = print "\n\n⚠ WARNING: " $errorString -}}
|
||||||
|
{{- print $errorString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if gt (len $retaggedImages) 0 -}}
|
||||||
|
{{- $warnString := "\n\n⚠ WARNING: Original containers have been retagged. Please note this Helm chart was tested, and validated on multiple platforms using a specific set of Bitnami and Bitnami Secure Images containers. Substituting original image tags could cause unexpected behavior." -}}
|
||||||
|
{{- $warnString = print $warnString "\n\nRetagged images:" -}}
|
||||||
|
{{- range $retaggedImages -}}
|
||||||
|
{{- $warnString = print $warnString "\n - " . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- print $warnString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Enable FIPS features
|
||||||
|
{{ include "common.fips.enabled" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.enabled" -}}
|
||||||
|
{{- $fips := .Chart.Annotations.fips -}}
|
||||||
|
{{- if eq "true" $fips -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get FIPS environment variable value for the given tech
|
||||||
|
{{ include "common.fips.config" (dict "tech" "openssl|java|golang" "fips" .Values.fips "global" .Values.global) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.config" -}}
|
||||||
|
{{- $availableTechs := list "openssl" "java" "golang" -}}
|
||||||
|
{{- if not (has .tech $availableTechs) -}}
|
||||||
|
{{- printf "The common.fips.config method can only provide configuration for: %s" $availableTechs | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $tech := get (.fips) .tech -}}
|
||||||
|
{{- $value := $tech | default (.global).defaultFips -}}
|
||||||
|
{{- if empty $value -}}
|
||||||
|
{{- printf "Please configure a value for 'fips.%s' or 'global.defaultFips'" .tech | fail -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $method := printf "common.fips.%s" .tech -}}
|
||||||
|
{{- include $method (dict "value" $value) | trim | print -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Map OpenSSL values for FIPS configuration
|
||||||
|
{{ include "common.fips.openssl" (dict "value" "restricted") }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.openssl" -}}
|
||||||
|
{{- ternary "yes" "no" (eq .value "restricted") | print -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Map JAVA values for FIPS configuration
|
||||||
|
{{ include "common.fips.java" (dict "value" "restricted") }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.java" -}}
|
||||||
|
{{- $suffix := ternary "original" .value (eq .value "off") -}}
|
||||||
|
{{- $javaSecurityFile := printf "java.security.%s" $suffix -}}
|
||||||
|
{{/* The two equals signs mean the property file will completely override the master properties file */}}
|
||||||
|
{{- $javaSecurityOpt := printf "-Djava.security.properties==/opt/bitnami/java/conf/security/%s" $javaSecurityFile -}}
|
||||||
|
{{- $bcModulesFlag := "--module-path=/opt/bitnami/bc-fips/" -}}
|
||||||
|
{{- $restrictedFlags := printf "%s %s" $bcModulesFlag $javaSecurityOpt -}}
|
||||||
|
|
||||||
|
{{- ternary $restrictedFlags $javaSecurityOpt (eq .value "restricted") | print -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Map Golang values for FIPS configuration
|
||||||
|
{{ include "common.fips.golang" (dict "value" "restricted") }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.golang" -}}
|
||||||
|
{{- if eq .value "restricted" -}}
|
||||||
|
{{- print "fips140=only" -}}
|
||||||
|
{{- else if eq .value "relaxed" -}}
|
||||||
|
{{- print "fips140=on" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "fips140=off" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Return the proper image name.
|
||||||
|
If image tag and digest are not defined, termination fallbacks to chart appVersion.
|
||||||
|
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" .Values.global "chart" .Chart ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.image" -}}
|
||||||
|
{{- $registryName := default .imageRoot.registry ((.global).imageRegistry) -}}
|
||||||
|
{{- $repositoryName := .imageRoot.repository -}}
|
||||||
|
{{- $separator := ":" -}}
|
||||||
|
{{- $termination := .imageRoot.tag | toString -}}
|
||||||
|
|
||||||
|
{{- if not .imageRoot.tag }}
|
||||||
|
{{- if .chart }}
|
||||||
|
{{- $termination = .chart.AppVersion | toString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .imageRoot.digest }}
|
||||||
|
{{- $separator = "@" -}}
|
||||||
|
{{- $termination = .imageRoot.digest | toString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $registryName }}
|
||||||
|
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s%s%s" $repositoryName $separator $termination -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
|
||||||
|
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.pullSecrets" -}}
|
||||||
|
{{- $pullSecrets := list }}
|
||||||
|
|
||||||
|
{{- range ((.global).imagePullSecrets) -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets .name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- range .pullSecrets -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets .name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (not (empty $pullSecrets)) -}}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- range $pullSecrets | uniq }}
|
||||||
|
- name: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names evaluating values as templates
|
||||||
|
{{ include "common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.renderPullSecrets" -}}
|
||||||
|
{{- $pullSecrets := list }}
|
||||||
|
{{- $context := .context }}
|
||||||
|
|
||||||
|
{{- range (($context.Values.global).imagePullSecrets) -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" .name "context" $context)) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- range .pullSecrets -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" .name "context" $context)) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (not (empty $pullSecrets)) -}}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- range $pullSecrets | uniq }}
|
||||||
|
- name: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper image version (ingores image revision/prerelease info & fallbacks to chart appVersion)
|
||||||
|
{{ include "common.images.version" ( dict "imageRoot" .Values.path.to.the.image "chart" .Chart ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.version" -}}
|
||||||
|
{{- $imageTag := .imageRoot.tag | toString -}}
|
||||||
|
{{/* regexp from https://github.com/Masterminds/semver/blob/23f51de38a0866c5ef0bfc42b3f735c73107b700/version.go#L41-L44 */}}
|
||||||
|
{{- if regexMatch `^([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?$` $imageTag -}}
|
||||||
|
{{- $version := semver $imageTag -}}
|
||||||
|
{{- printf "%d.%d.%d" $version.Major $version.Minor $version.Patch -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print .chart.AppVersion -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate backend entry that is compatible with all Kubernetes API versions.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- serviceName - String. Name of an existing service backend
|
||||||
|
- servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.backend" -}}
|
||||||
|
service:
|
||||||
|
name: {{ .serviceName }}
|
||||||
|
port:
|
||||||
|
{{- if typeIs "string" .servicePort }}
|
||||||
|
name: {{ .servicePort }}
|
||||||
|
{{- else if or (typeIs "int" .servicePort) (typeIs "float64" .servicePort) }}
|
||||||
|
number: {{ .servicePort | int }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if cert-manager required annotations for TLS signed
|
||||||
|
certificates are set in the Ingress annotations
|
||||||
|
Ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.certManagerRequest" ( dict "annotations" .Values.path.to.the.ingress.annotations ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.certManagerRequest" -}}
|
||||||
|
{{ if or (hasKey .annotations "cert-manager.io/cluster-issuer") (hasKey .annotations "cert-manager.io/issuer") (hasKey .annotations "kubernetes.io/tls-acme") }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Kubernetes standard labels
|
||||||
|
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.standard" -}}
|
||||||
|
{{- if and (hasKey . "customLabels") (hasKey . "context") -}}
|
||||||
|
{{- $default := dict "app.kubernetes.io/name" (include "common.names.name" .context) "helm.sh/chart" (include "common.names.chart" .context) "app.kubernetes.io/instance" .context.Release.Name "app.kubernetes.io/managed-by" .context.Release.Service -}}
|
||||||
|
{{- with .context.Chart.AppVersion -}}
|
||||||
|
{{- $_ := set $default "app.kubernetes.io/version" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ template "common.tplvalues.merge" (dict "values" (list .customLabels $default) "context" .context) }}
|
||||||
|
{{- else -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- with .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ . | replace "+" "_" | quote }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Labels used on immutable fields such as deploy.spec.selector.matchLabels or svc.spec.selector
|
||||||
|
{{ include "common.labels.matchLabels" (dict "customLabels" .Values.podLabels "context" $) -}}
|
||||||
|
|
||||||
|
We don't want to loop over custom labels appending them to the selector
|
||||||
|
since it's very likely that it will break deployments, services, etc.
|
||||||
|
However, it's important to overwrite the standard labels if the user
|
||||||
|
overwrote them on metadata.labels fields.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.matchLabels" -}}
|
||||||
|
{{- if and (hasKey . "customLabels") (hasKey . "context") -}}
|
||||||
|
{{ merge (pick (include "common.tplvalues.render" (dict "value" .customLabels "context" .context) | fromYaml) "app.kubernetes.io/name" "app.kubernetes.io/instance") (dict "app.kubernetes.io/name" (include "common.names.name" .context) "app.kubernetes.io/instance" .context.Release.Name ) | toYaml }}
|
||||||
|
{{- else -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | 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).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride -}}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
|
{{- $releaseName := regexReplaceAll "(-?[^a-z\\d\\-])+-?" (lower .Release.Name) "-" -}}
|
||||||
|
{{- if contains $name $releaseName -}}
|
||||||
|
{{- $releaseName | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" $releaseName $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified dependency 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.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.dependency.fullname" -}}
|
||||||
|
{{- if .chartValues.fullnameOverride -}}
|
||||||
|
{{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .chartName .chartValues.nameOverride -}}
|
||||||
|
{{- if contains $name .context.Release.Name -}}
|
||||||
|
{{- .context.Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.namespace" -}}
|
||||||
|
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a fully qualified app name adding the installation's namespace.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname.namespace" -}}
|
||||||
|
{{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
@ -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 -}}
|
||||||
@ -0,0 +1,192 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Generate secret name.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/main/bitnami/common#existingsecret
|
||||||
|
- defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.name" -}}
|
||||||
|
{{- $name := (include "common.names.fullname" .context) -}}
|
||||||
|
|
||||||
|
{{- if .defaultNameSuffix -}}
|
||||||
|
{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .) -}}
|
||||||
|
{{- with .name -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret key.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/main/bitnami/common#existingsecret
|
||||||
|
- key - String - Required. Name of the key in the secret.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.key" -}}
|
||||||
|
{{- $key := .key -}}
|
||||||
|
|
||||||
|
{{- if .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .existingSecret) -}}
|
||||||
|
{{- if .existingSecret.keyMapping -}}
|
||||||
|
{{- $key = index .existingSecret.keyMapping $.key -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret password or retrieve one if already created.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "honorProvidedValues" false "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- key - String - Required - Name of the key in the secret.
|
||||||
|
- providedValues - List<String> - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||||
|
- length - int - Optional - Length of the generated random password.
|
||||||
|
- strong - Boolean - Optional - Whether to add symbols to the generated random password.
|
||||||
|
- chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
- failOnNew - Boolean - Optional - Default to true. If set to false, skip errors adding new keys to existing secrets.
|
||||||
|
- skipB64enc - Boolean - Optional - Default to false. If set to true, no the secret will not be base64 encrypted.
|
||||||
|
- skipQuote - Boolean - Optional - Default to false. If set to true, no quotes will be added around the secret.
|
||||||
|
- honorProvidedValues - Boolean - Optional - Default to false. If set to true, the values in providedValues have higher priority than an existing secret
|
||||||
|
The order in which this function returns a secret password:
|
||||||
|
1. Password provided via the values.yaml if honorProvidedValues = true
|
||||||
|
(If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
|
||||||
|
2. Already existing 'Secret' resource
|
||||||
|
(If a 'Secret' resource is found under the name provided to the 'secret' parameter to this function and that 'Secret' resource contains a key with the name passed as the 'key' parameter to this function then the value of this existing secret password will be returned)
|
||||||
|
3. Password provided via the values.yaml if honorProvidedValues = false
|
||||||
|
(If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
|
||||||
|
4. Randomly generated secret password
|
||||||
|
(A new random secret password with the length specified in the 'length' parameter will be generated and returned)
|
||||||
|
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.passwords.manage" -}}
|
||||||
|
|
||||||
|
{{- $password := "" }}
|
||||||
|
{{- $subchart := "" }}
|
||||||
|
{{- $chartName := default "" .chartName }}
|
||||||
|
{{- $passwordLength := default 10 .length }}
|
||||||
|
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
||||||
|
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
||||||
|
{{- $secretData := (lookup "v1" "Secret" (include "common.names.namespace" .context) .secret).data }}
|
||||||
|
{{- if $secretData }}
|
||||||
|
{{- if hasKey $secretData .key }}
|
||||||
|
{{- $password = index $secretData .key | b64dec }}
|
||||||
|
{{- else if not (eq .failOnNew false) }}
|
||||||
|
{{- printf "\nPASSWORDS ERROR: The secret \"%s\" does not contain the key \"%s\"\n" .secret .key | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and $providedPasswordValue .honorProvidedValues }}
|
||||||
|
{{- $password = tpl ($providedPasswordValue | toString) .context }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if not $password }}
|
||||||
|
{{- if $providedPasswordValue }}
|
||||||
|
{{- $password = tpl ($providedPasswordValue | toString) .context }}
|
||||||
|
{{- else }}
|
||||||
|
{{- if .context.Values.enabled }}
|
||||||
|
{{- $subchart = $chartName }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not (eq .failOnNew false) }}
|
||||||
|
{{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}}
|
||||||
|
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
|
||||||
|
{{- $passwordValidationErrors := list $requiredPasswordError -}}
|
||||||
|
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .strong }}
|
||||||
|
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
|
||||||
|
{{- $password = randAscii $passwordLength }}
|
||||||
|
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
||||||
|
{{- $password = printf "%s%s" $subStr $password | toString | shuffle }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $password = randAlphaNum $passwordLength }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not .skipB64enc }}
|
||||||
|
{{- $password = $password | b64enc }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .skipQuote -}}
|
||||||
|
{{- printf "%s" $password -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" $password | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Reuses the value from an existing secret, otherwise sets its value to a default value.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.lookup" (dict "secret" "secret-name" "key" "keyName" "defaultValue" .Values.myValue "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- key - String - Required - Name of the key in the secret.
|
||||||
|
- defaultValue - String - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.lookup" -}}
|
||||||
|
{{- $value := "" -}}
|
||||||
|
{{- $secretData := (lookup "v1" "Secret" (include "common.names.namespace" .context) .secret).data -}}
|
||||||
|
{{- if and $secretData (hasKey $secretData .key) -}}
|
||||||
|
{{- $value = index $secretData .key -}}
|
||||||
|
{{- else if .defaultValue -}}
|
||||||
|
{{- $value = .defaultValue | toString | b64enc -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $value -}}
|
||||||
|
{{- printf "%s" $value -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns whether a previous generated secret already exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.exists" -}}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" (include "common.names.namespace" .context) .secret) }}
|
||||||
|
{{- if $secret }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Storage Class
|
||||||
|
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.storage.class" -}}
|
||||||
|
{{- $storageClass := (.global).storageClass | default .persistence.storageClass | default (.global).defaultStorageClass | default "" -}}
|
||||||
|
{{- if $storageClass -}}
|
||||||
|
{{- if (eq "-" $storageClass) -}}
|
||||||
|
{{- printf "storageClassName: \"\"" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "storageClassName: %s" $storageClass -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Renders a value that contains template perhaps with scope if the scope is present.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
|
||||||
|
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.render" -}}
|
||||||
|
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
|
||||||
|
{{- if contains "{{" (toJson .value) }}
|
||||||
|
{{- if .scope }}
|
||||||
|
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
|
||||||
|
{{- else }}
|
||||||
|
{{- tpl $value .context }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Merge a list of values that contains template after rendering them.
|
||||||
|
Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.merge" -}}
|
||||||
|
{{- $dst := dict -}}
|
||||||
|
{{- range .values -}}
|
||||||
|
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ $dst | toYaml }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Merge a list of values that contains template after rendering them.
|
||||||
|
Merge precedence is consistent with https://masterminds.github.io/sprig/dicts.html#mergeoverwrite-mustmergeoverwrite
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.merge-overwrite" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.merge-overwrite" -}}
|
||||||
|
{{- $dst := dict -}}
|
||||||
|
{{- range .values -}}
|
||||||
|
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | mergeOverwrite $dst -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ $dst | toYaml }}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Print instructions to get a secret value.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.secret.getvalue" -}}
|
||||||
|
{{- $varname := include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
export {{ $varname }}=$(kubectl get secret --namespace {{ include "common.names.namespace" .context | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 -d)
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Build env var name given a field
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.fieldToEnvVar" -}}
|
||||||
|
{{- $fieldNameSplit := splitList "-" .field -}}
|
||||||
|
{{- $upperCaseFieldNameSplit := list -}}
|
||||||
|
|
||||||
|
{{- range $fieldNameSplit -}}
|
||||||
|
{{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ join "_" $upperCaseFieldNameSplit }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Gets a value from .Values given
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getValueFromKey" -}}
|
||||||
|
{{- $splitKey := splitList "." .key -}}
|
||||||
|
{{- $value := "" -}}
|
||||||
|
{{- $latestObj := $.context.Values -}}
|
||||||
|
{{- range $splitKey -}}
|
||||||
|
{{- if not $latestObj -}}
|
||||||
|
{{- printf "please review the entire path of '%s' exists in values" $.key | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $value = ( index $latestObj . ) -}}
|
||||||
|
{{- $latestObj = $value -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%v" (default "" $value) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns first .Values key with a defined value or first of the list if all non-defined
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getKeyFromList" -}}
|
||||||
|
{{- $key := first .keys -}}
|
||||||
|
{{- $reverseKeys := reverse .keys }}
|
||||||
|
{{- range $reverseKeys }}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }}
|
||||||
|
{{- if $value -}}
|
||||||
|
{{- $key = . }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Checksum a template at "path" containing a *single* resource (ConfigMap,Secret) for use in pod annotations, excluding the metadata (see #18376).
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.checksumTemplate" (dict "path" "/configmap.yaml" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.checksumTemplate" -}}
|
||||||
|
{{- $obj := include (print .context.Template.BasePath .path) .context | fromYaml -}}
|
||||||
|
{{ omit $obj "apiVersion" "kind" "metadata" | toYaml | sha256sum }}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,109 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Warning about using rolling tag.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.rollingTag" -}}
|
||||||
|
|
||||||
|
{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||||
|
WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||||
|
+info https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-understand-rolling-tags-containers-index.html
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Warning about replaced images from the original.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.modifiedImages" (dict "images" (list .Values.path.to.the.imageRoot) "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.modifiedImages" -}}
|
||||||
|
{{- $affectedImages := list -}}
|
||||||
|
{{- $printMessage := false -}}
|
||||||
|
{{- $originalImages := .context.Chart.Annotations.images -}}
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- $fullImageName := printf (printf "%s/%s:%s" .registry .repository .tag) -}}
|
||||||
|
{{- if not (contains $fullImageName $originalImages) }}
|
||||||
|
{{- $affectedImages = append $affectedImages (printf "%s/%s:%s" .registry .repository .tag) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $printMessage }}
|
||||||
|
|
||||||
|
⚠ SECURITY WARNING: Original containers have been substituted. This Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Tanzu Application Catalog containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables.
|
||||||
|
|
||||||
|
Substituted images detected:
|
||||||
|
{{- range $affectedImages }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Warning about not setting the resource object in all deployments.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.resources" (dict "sections" (list "path1" "path2") context $) }}
|
||||||
|
Example:
|
||||||
|
{{- include "common.warnings.resources" (dict "sections" (list "csiProvider.provider" "server" "volumePermissions" "") "context" $) }}
|
||||||
|
The list in the example assumes that the following values exist:
|
||||||
|
- csiProvider.provider.resources
|
||||||
|
- server.resources
|
||||||
|
- volumePermissions.resources
|
||||||
|
- resources
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.resources" -}}
|
||||||
|
{{- $values := .context.Values -}}
|
||||||
|
{{- $printMessage := false -}}
|
||||||
|
{{ $affectedSections := list -}}
|
||||||
|
{{- range .sections -}}
|
||||||
|
{{- if eq . "" -}}
|
||||||
|
{{/* Case where the resources section is at the root (one main deployment in the chart) */}}
|
||||||
|
{{- if not (index $values "resources") -}}
|
||||||
|
{{- $affectedSections = append $affectedSections "resources" -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{/* Case where the are multiple resources sections (more than one main deployment in the chart) */}}
|
||||||
|
{{- $keys := split "." . -}}
|
||||||
|
{{/* We iterate through the different levels until arriving to the resource section. Example: a.b.c.resources */}}
|
||||||
|
{{- $section := $values -}}
|
||||||
|
{{- range $keys -}}
|
||||||
|
{{- $section = index $section . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (index $section "resources") -}}
|
||||||
|
{{/* If the section has enabled=false or replicaCount=0, do not include it */}}
|
||||||
|
{{- if and (hasKey $section "enabled") -}}
|
||||||
|
{{- if index $section "enabled" -}}
|
||||||
|
{{/* enabled=true */}}
|
||||||
|
{{- $affectedSections = append $affectedSections (printf "%s.resources" .) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if and (hasKey $section "replicaCount") -}}
|
||||||
|
{{/* We need a casting to int because number 0 is not treated as an int by default */}}
|
||||||
|
{{- if (gt (index $section "replicaCount" | int) 0) -}}
|
||||||
|
{{/* replicaCount > 0 */}}
|
||||||
|
{{- $affectedSections = append $affectedSections (printf "%s.resources" .) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{/* Default case, add it to the affected sections */}}
|
||||||
|
{{- $affectedSections = append $affectedSections (printf "%s.resources" .) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $printMessage }}
|
||||||
|
|
||||||
|
WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
|
||||||
|
{{- range $affectedSections }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.dbUser.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled cassandra.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.cassandra.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key dbUser
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.key.dbUser" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
cassandra.dbUser
|
||||||
|
{{- else -}}
|
||||||
|
dbUser
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate MariaDB required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.mariadb.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.mariadb.values.enabled" . -}}
|
||||||
|
{{- $architecture := include "common.mariadb.values.architecture" . -}}
|
||||||
|
{{- $authPrefix := include "common.mariadb.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" "mariadb-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" "mariadb-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (eq $architecture "replication") -}}
|
||||||
|
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-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.mariadb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mariadb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mariadb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mariadb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mongodb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mongodb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mongodb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
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 -}}
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to decide whether evaluate global values.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- key - String - Required. Field to be evaluated within global, e.g: "existingSecret"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.use.global" -}}
|
||||||
|
{{- if .context.Values.global -}}
|
||||||
|
{{- if .context.Values.global.postgresql -}}
|
||||||
|
{{- index .context.Values.global.postgresql .key | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.existingSecret" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.existingSecret" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- default (.context.Values.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled postgresql.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key postgressPassword.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.postgressPassword" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if not $globalValue -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.postgresqlPassword
|
||||||
|
{{- else -}}
|
||||||
|
postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
global.postgresql.postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled.replication.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled.replication" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.replication.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" .context.Values.replication.enabled -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key replication.password.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.replicationPassword" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.replication.password
|
||||||
|
{{- else -}}
|
||||||
|
replication.password
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled redis.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.redis.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right prefix path for the values
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.keys.prefix" -}}
|
||||||
|
{{- if .subchart -}}redis.{{- else -}}{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Checks whether the redis chart's includes the standarizations (version >= 14)
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.standarized.version" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.standarized.version" -}}
|
||||||
|
|
||||||
|
{{- $standarizedAuth := printf "%s%s" (include "common.redis.values.keys.prefix" .) "auth" -}}
|
||||||
|
{{- $standarizedAuthValues := include "common.utils.getValueFromKey" (dict "key" $standarizedAuth "context" .context) }}
|
||||||
|
|
||||||
|
{{- if $standarizedAuthValues -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate values must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.multiple.empty" -}}
|
||||||
|
{{- range .required -}}
|
||||||
|
{{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate a value must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
- subchart - String - Optional - Name of the subchart that the validated password is part of.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.single.empty" -}}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }}
|
||||||
|
{{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }}
|
||||||
|
|
||||||
|
{{- if not $value -}}
|
||||||
|
{{- $varname := "my-value" -}}
|
||||||
|
{{- $getCurrentValue := "" -}}
|
||||||
|
{{- if and .secret .field -}}
|
||||||
|
{{- $varname = include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
{{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
# Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
# SPDX-License-Identifier: APACHE-2.0
|
||||||
|
|
||||||
|
## bitnami/common
|
||||||
|
## It is required by CI/CD tools and processes.
|
||||||
|
## @skip exampleValue
|
||||||
|
##
|
||||||
|
exampleValue: common-chart
|
||||||
89
charts/semaphore/charts/mariadb/templates/NOTES.txt
Normal file
89
charts/semaphore/charts/mariadb/templates/NOTES.txt
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
CHART NAME: {{ .Chart.Name }}
|
||||||
|
CHART VERSION: {{ .Chart.Version }}
|
||||||
|
APP VERSION: {{ .Chart.AppVersion }}
|
||||||
|
|
||||||
|
⚠ WARNING: Since August 28th, 2025, only a limited subset of images/charts are available for free.
|
||||||
|
Subscribe to Bitnami Secure Images to receive continued support and security updates.
|
||||||
|
More info at https://bitnami.com and https://github.com/bitnami/containers/issues/83267
|
||||||
|
|
||||||
|
** Please be patient while the chart is being deployed **
|
||||||
|
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
|
||||||
|
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
|
||||||
|
|
||||||
|
Get the list of pods by executing:
|
||||||
|
|
||||||
|
kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||||
|
|
||||||
|
Access the pod you want to debug by executing
|
||||||
|
|
||||||
|
kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- bash
|
||||||
|
|
||||||
|
In order to replicate the container startup scripts execute this command:
|
||||||
|
|
||||||
|
/opt/bitnami/scripts/mariadb/entrypoint.sh /opt/bitnami/scripts/mariadb/run.sh
|
||||||
|
|
||||||
|
{{- else }}
|
||||||
|
|
||||||
|
Tip:
|
||||||
|
|
||||||
|
Watch the deployment status using the command: kubectl get pods -w --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||||
|
|
||||||
|
Services:
|
||||||
|
|
||||||
|
echo Primary: {{ include "mariadb.primary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ coalesce .Values.primary.service.ports.mysql .Values.primary.service.port }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
echo Secondary: {{ include "mariadb.secondary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ coalesce .Values.secondary.service.ports.mysql .Values.secondary.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
Administrator credentials:
|
||||||
|
|
||||||
|
Username: root
|
||||||
|
Password : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.secretName" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 -d)
|
||||||
|
|
||||||
|
To connect to your database, create a client pod:
|
||||||
|
|
||||||
|
kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mariadb.image" . }} --namespace {{ .Release.Namespace }} --command -- bash
|
||||||
|
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
|
||||||
|
Copy your CA TLS certificates to your client pod:
|
||||||
|
|
||||||
|
kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ include "mariadb.tls.secretName" . }} -o json | jq -r '.data["{{ ternary "ca.crt" .Values.tls.certCAFilename .Values.tls.autoGenerated.enabled }}"]' | base64 --decode > /tmp/ca.crt
|
||||||
|
kubectl cp --namespace {{ include "common.names.namespace" . }} /tmp/ca.crt {{ include "common.names.fullname" . }}-client:/tmp/ca.crt
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
To connect to primary service (read/write):
|
||||||
|
|
||||||
|
mysql -h {{ include "mariadb.primary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} -uroot -p {{ .Values.auth.database }}{{ if .Values.tls.enabled }} --ssl --ssl-ca=/tmp/ca.crt{{ end }}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
|
||||||
|
To connect to secondary service (read-only):
|
||||||
|
|
||||||
|
mysql -h {{ include "mariadb.secondary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} -uroot -p {{ .Values.auth.database }}{{ if .Values.tls.enabled }} --ssl --ssl-ca=/tmp/ca.crt{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
To upgrade this helm chart:
|
||||||
|
|
||||||
|
1. Obtain the password as described on the 'Administrator credentials' section and set the 'auth.rootPassword' parameter as shown below:
|
||||||
|
|
||||||
|
ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.secretName" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 -d)
|
||||||
|
helm upgrade --namespace {{ .Release.Namespace }} {{ .Release.Name }} oci://MY-OCI-REGISTRY/mariadb --set auth.rootPassword=$ROOT_PASSWORD
|
||||||
|
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
|
||||||
|
{{- include "mariadb.validateValues" . }}
|
||||||
|
{{- if not .Values.auth.customPasswordFiles -}}
|
||||||
|
{{- $passwordValidationErrors := include "common.validations.values.mariadb.passwords" (dict "secret" (include "common.names.fullname" .) "context" $) -}}
|
||||||
|
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $passwordValidationErrors) "context" $) -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- include "common.warnings.resources" (dict "sections" (list "metrics" "primary" "secondary" "volumePermissions") "context" $) }}
|
||||||
|
{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.metrics.image) "context" $) }}
|
||||||
|
{{- include "common.errors.insecureImages" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.metrics.image) "context" $) }}
|
||||||
220
charts/semaphore/charts/mariadb/templates/_helpers.tpl
Normal file
220
charts/semaphore/charts/mariadb/templates/_helpers.tpl
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{- define "mariadb.primary.fullname" -}}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- printf "%s-%s" (include "common.names.fullname" .) .Values.primary.name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- include "common.names.fullname" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "mariadb.secondary.fullname" -}}
|
||||||
|
{{- printf "%s-%s" (include "common.names.fullname" .) .Values.secondary.name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper MariaDB image name
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper metrics image name
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.metrics.image" -}}
|
||||||
|
{{ 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 "mariadb.volumePermissions.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.imagePullSecrets" -}}
|
||||||
|
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image) "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ template "mariadb.initdbScriptsCM" . }}
|
||||||
|
{{/*
|
||||||
|
Get the initialization scripts ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.initdbScriptsCM" -}}
|
||||||
|
{{- if .Values.initdbScriptsConfigMap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.initdbScriptsConfigMap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-init-scripts" (include "mariadb.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the name of the secret containing the TLS certificates for MariaDB replicas
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.tls.secretName" -}}
|
||||||
|
{{- if or .Values.tls.autoGenerated.enabled (and (not (empty .Values.tls.cert)) (not (empty .Values.tls.key))) -}}
|
||||||
|
{{- printf "%s-crt" (include "common.names.fullname" .) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- required "An existing secret name must be provided with TLS certs for MariaDB replicas if cert and key are not provided!" (tpl .Values.tls.existingSecret .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the configmap with the MariaDB Primary configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.primary.configmapName" -}}
|
||||||
|
{{- if .Values.primary.existingConfigmap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.primary.existingConfigmap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" (include "mariadb.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for MariaDB Secondary
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.primary.createConfigmap" -}}
|
||||||
|
{{- if and .Values.primary.configuration (not .Values.primary.existingConfigmap) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the configmap with the MariaDB Primary configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secondary.configmapName" -}}
|
||||||
|
{{- if .Values.secondary.existingConfigmap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.secondary.existingConfigmap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" (include "mariadb.secondary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for MariaDB Secondary
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secondary.createConfigmap" -}}
|
||||||
|
{{- if and (eq .Values.architecture "replication") .Values.secondary.configuration (not .Values.secondary.existingConfigmap) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret with MariaDB credentials
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secretName" -}}
|
||||||
|
{{- if .Values.auth.existingSecret -}}
|
||||||
|
{{- printf "%s" (tpl .Values.auth.existingSecret $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- include "common.names.fullname" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret with previous MariaDB credentials
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.update-job.previousSecretName" -}}
|
||||||
|
{{- if .Values.passwordUpdateJob.previousPasswords.existingSecret -}}
|
||||||
|
{{- /* The secret with the new password is managed externally */ -}}
|
||||||
|
{{- tpl .Values.passwordUpdateJob.previousPasswords.existingSecret $ -}}
|
||||||
|
{{- else if .Values.passwordUpdateJob.previousPasswords.rootPassword -}}
|
||||||
|
{{- /* The secret with the new password is managed externally */ -}}
|
||||||
|
{{- printf "%s-previous-secret" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- /* The secret with the new password is managed by the helm chart. We use the current secret name as it has the old password */ -}}
|
||||||
|
{{- include "common.names.fullname" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret with new MariaDB credentials
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.update-job.newSecretName" -}}
|
||||||
|
{{- if and (not .Values.passwordUpdateJob.previousPasswords.existingSecret) (not .Values.passwordUpdateJob.previousPasswords.rootPassword) -}}
|
||||||
|
{{- /* The secret with the new password is managed by the helm chart. We create a new secret as the current one has the old password */ -}}
|
||||||
|
{{- printf "%s-new-secret" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- /* The secret with the new password is managed externally */ -}}
|
||||||
|
{{- include "mariadb.secretName" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a secret object should be created for MariaDB
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.createSecret" -}}
|
||||||
|
{{- if not (or .Values.auth.existingSecret .Values.auth.customPasswordFiles) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a secret object should be created for MariaDB
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.createPreviousSecret" -}}
|
||||||
|
{{- if and .Values.passwordUpdateJob.previousPasswords.rootPassword (not .Values.passwordUpdateJob.previousPasswords.existingSecret) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Compile all warnings into a single message, and call fail.
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.validateValues" -}}
|
||||||
|
{{- $messages := list -}}
|
||||||
|
{{- $messages := append $messages (include "mariadb.validateValues.architecture" .) -}}
|
||||||
|
{{- $messages := without $messages "" -}}
|
||||||
|
{{- $message := join "\n" $messages -}}
|
||||||
|
|
||||||
|
{{- if $message -}}
|
||||||
|
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Validate values of MariaDB - must provide a valid architecture */}}
|
||||||
|
{{- define "mariadb.validateValues.architecture" -}}
|
||||||
|
{{- if and (ne .Values.architecture "standalone") (ne .Values.architecture "replication") -}}
|
||||||
|
mariadb: architecture
|
||||||
|
Invalid architecture selected. Valid values are "standalone" and
|
||||||
|
"replication". Please set a valid architecture (--set architecture="xxxx")
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get existing password to access MariaDB
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.secret.existPassword" -}}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (include "mariadb.secretName" .)).data -}}
|
||||||
|
{{- if hasKey $secret "mariadb-password" }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate TDE secretProviderClass custom resource name
|
||||||
|
*/}}
|
||||||
|
{{- define "mariadb.tde.secretProviderClassName" -}}
|
||||||
|
{{- printf "%s-spc-tde" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
53
charts/semaphore/charts/mariadb/templates/ca-cert.yaml
Normal file
53
charts/semaphore/charts/mariadb/templates/ca-cert.yaml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "cert-manager") }}
|
||||||
|
{{- if empty .Values.tls.autoGenerated.certManager.existingIssuer }}
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Issuer
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-clusterissuer" (include "common.names.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
selfSigned: {}
|
||||||
|
---
|
||||||
|
{{- end }}
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Certificate
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }}
|
||||||
|
commonName: {{ printf "%s-ca" (include "common.names.fullname" .) }}
|
||||||
|
isCA: true
|
||||||
|
issuerRef:
|
||||||
|
name: {{ default (printf "%s-clusterissuer" (include "common.names.fullname" .)) .Values.tls.autoGenerated.certManager.existingIssuer }}
|
||||||
|
kind: {{ default "Issuer" .Values.tls.autoGenerated.certManager.existingIssuerKind }}
|
||||||
|
---
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Issuer
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
ca:
|
||||||
|
secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }}
|
||||||
|
{{- end }}
|
||||||
42
charts/semaphore/charts/mariadb/templates/cert.yaml
Normal file
42
charts/semaphore/charts/mariadb/templates/cert.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "cert-manager") }}
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Certificate
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-crt" (include "common.names.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
secretName: {{ template "mariadb.tls.secretName" . }}
|
||||||
|
commonName: {{ printf "%s.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain }}
|
||||||
|
issuerRef:
|
||||||
|
name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }}
|
||||||
|
kind: Issuer
|
||||||
|
subject:
|
||||||
|
organizations:
|
||||||
|
- "MariaDB"
|
||||||
|
dnsNames:
|
||||||
|
{{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- $dnsNames := include "common.certs.sans" (dict "namespace" (include "common.names.namespace" .) "clusterDomain" .Values.clusterDomain "serviceName" (include "mariadb.primary.fullname" .) "headlessServiceName" $headlessServiceName "loopback" .Values.tls.autoGenerated.loopback "extraSANs" (.Values.tls.autoGenerated.extraSANs | default (list))) | splitList " " | uniq }}
|
||||||
|
{{- $dnsNames = include "common.certs.sans" (dict "namespace" (include "common.names.namespace" .) "clusterDomain" .Values.clusterDomain "serviceName" (include "mariadb.secondary.fullname" .)) | splitList " " | concat $dnsNames | uniq }}
|
||||||
|
{{- range $dnsNames }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.autoGenerated.loopback }}
|
||||||
|
ipAddresses:
|
||||||
|
- 127.0.0.1
|
||||||
|
{{- end }}
|
||||||
|
privateKey:
|
||||||
|
algorithm: {{ .Values.tls.autoGenerated.certManager.keyAlgorithm }}
|
||||||
|
size: {{ int .Values.tls.autoGenerated.certManager.keySize }}
|
||||||
|
duration: {{ .Values.tls.autoGenerated.certManager.duration }}
|
||||||
|
renewBefore: {{ .Values.tls.autoGenerated.certManager.renewBefore }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- range .Values.extraDeploy }}
|
||||||
|
---
|
||||||
|
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
|
||||||
|
{{- end }}
|
||||||
36
charts/semaphore/charts/mariadb/templates/headless-svc.yaml
Normal file
36
charts/semaphore/charts/mariadb/templates/headless-svc.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if or .Values.primary.service.headless.annotations .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if or .Values.primary.service.headless.annotations .Values.commonAnnotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.service.headless.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
publishNotReadyAddresses: true
|
||||||
|
clusterIP: None
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: {{ .Values.primary.containerPorts.mysql }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: mysql
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.metrics.containerPorts.http }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: metrics
|
||||||
|
{{- end }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
77
charts/semaphore/charts/mariadb/templates/networkpolicy.yaml
Normal file
77
charts/semaphore/charts/mariadb/templates/networkpolicy.yaml
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.networkPolicy.enabled }}
|
||||||
|
kind: NetworkPolicy
|
||||||
|
apiVersion: {{ template "common.capabilities.networkPolicy.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
|
- Egress
|
||||||
|
{{- if .Values.networkPolicy.allowExternalEgress }}
|
||||||
|
egress:
|
||||||
|
- {}
|
||||||
|
{{- else }}
|
||||||
|
egress:
|
||||||
|
# Allow dns resolution
|
||||||
|
- ports:
|
||||||
|
- port: 53
|
||||||
|
protocol: UDP
|
||||||
|
- port: 53
|
||||||
|
protocol: TCP
|
||||||
|
# Allow connection to other cluster pods
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.primary.containerPorts.mysql }}
|
||||||
|
- port: {{ .Values.secondary.containerPorts.mysql }}
|
||||||
|
to:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||||
|
{{- if .Values.networkPolicy.extraEgress }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ingress:
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.primary.containerPorts.mysql }}
|
||||||
|
- port: {{ .Values.secondary.containerPorts.mysql }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- port: {{ .Values.metrics.containerPorts.http }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.networkPolicy.allowExternal }}
|
||||||
|
from:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{ template "common.names.fullname" . }}-client: "true"
|
||||||
|
- podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||||
|
{{- if .Values.networkPolicy.ingressNSMatchLabels }}
|
||||||
|
- namespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- range $key, $value := .Values.networkPolicy.ingressNSMatchLabels }}
|
||||||
|
{{ $key | quote }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.networkPolicy.ingressNSPodMatchLabels }}
|
||||||
|
podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- range $key, $value := .Values.networkPolicy.ingressNSPodMatchLabels }}
|
||||||
|
{{ $key | quote }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.networkPolicy.extraIngress }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if (include "mariadb.primary.createConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
my.cnf: |-
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.configuration "context" $ ) | nindent 4 }}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.initdbScripts (not .Values.initdbScriptsConfigMap) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-init-scripts" (include "mariadb.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.initdbScripts "context" .) | nindent 2 }}
|
||||||
|
{{ end }}
|
||||||
29
charts/semaphore/charts/mariadb/templates/primary/pdb.yaml
Normal file
29
charts/semaphore/charts/mariadb/templates/primary/pdb.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.primary.pdb.create }}
|
||||||
|
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.primary.pdb.minAvailable }}
|
||||||
|
minAvailable: {{ .Values.primary.pdb.minAvailable }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.pdb.maxUnavailable (not .Values.primary.pdb.minAvailable) }}
|
||||||
|
maxUnavailable: {{ .Values.primary.pdb.maxUnavailable | default 1 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,523 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
revisionHistoryLimit: {{ .Values.primary.revisionHistoryLimit }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- if .Values.primary.updateStrategy }}
|
||||||
|
updateStrategy: {{- toYaml .Values.primary.updateStrategy | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if (include "mariadb.primary.createConfigmap" .) }}
|
||||||
|
checksum/configuration: {{ include (print $.Template.BasePath "/primary/configmap.yaml") . | sha256sum }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.enabled }}
|
||||||
|
charts.bitnami.com/password-last-update: {{ now | date "20060102150405" | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
spec:
|
||||||
|
{{- include "mariadb.imagePullSecrets" . | nindent 6 }}
|
||||||
|
automountServiceAccountToken: {{ .Values.primary.automountServiceAccountToken }}
|
||||||
|
{{- if .Values.primary.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.primary.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.schedulerName .Values.schedulerName }}
|
||||||
|
schedulerName: {{ (coalesce .Values.primary.schedulerName .Values.schedulerName) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ template "mariadb.serviceAccountName" . }}
|
||||||
|
{{- if .Values.primary.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.primary.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAffinityPreset "component" "primary" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAntiAffinityPreset "component" "primary" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.primary.nodeAffinityPreset.type "key" .Values.primary.nodeAffinityPreset.key "values" .Values.primary.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.primary.tolerations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.schedulerName }}
|
||||||
|
schedulerName: {{ .Values.primary.schedulerName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.primary.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.primary.priorityClassName | quote }}
|
||||||
|
{{- else if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.runtimeClassName }}
|
||||||
|
runtimeClassName: {{ .Values.primary.runtimeClassName | quote }}
|
||||||
|
{{- else if .Values.runtimeClassName }}
|
||||||
|
runtimeClassName: {{ .Values.runtimeClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.primary.podSecurityContext "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.terminationGracePeriodSeconds }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.primary.terminationGracePeriodSeconds }}
|
||||||
|
{{- end }}
|
||||||
|
initContainers:
|
||||||
|
- name: preserve-logs-symlinks
|
||||||
|
image: {{ include "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.primary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.primary.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.resources }}
|
||||||
|
resources: {{ toYaml .Values.primary.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.primary.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.primary.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
args:
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /opt/bitnami/scripts/libfs.sh
|
||||||
|
# We copy the logs folder because it has symlinks to stdout and stderr
|
||||||
|
if ! is_dir_empty /opt/bitnami/mariadb/logs; then
|
||||||
|
cp -r /opt/bitnami/mariadb/logs /emptydir/app-logs-dir
|
||||||
|
fi
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
env:
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.volumePermissions.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /emptydir
|
||||||
|
{{- if and .Values.primary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.primary.persistence.enabled }}
|
||||||
|
- name: volume-permissions
|
||||||
|
image: {{ include "mariadb.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
chown -R {{ .Values.primary.containerSecurityContext.runAsUser }}:{{ .Values.primary.podSecurityContext.fsGroup }} /bitnami/mariadb
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
{{- if .Values.volumePermissions.resources }}
|
||||||
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.volumePermissions.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.volumePermissions.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
env:
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.volumePermissions.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.primary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.primary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.initContainers "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: {{ include "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.primary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.primary.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.primary.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.primary.command "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.primary.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.primary.args "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.lifecycleHooks }}
|
||||||
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.primary.lifecycleHooks "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if not (empty .Values.auth.username) }}
|
||||||
|
- name: MARIADB_USER
|
||||||
|
value: {{ .Values.auth.username | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-password" .Values.auth.customPasswordFiles.user }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
- name: MARIADB_DATABASE
|
||||||
|
value: {{ .Values.auth.database | quote }}
|
||||||
|
- name: MARIADB_ENABLE_SSL
|
||||||
|
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||||
|
{{- if and .Values.tls.enabled (or .Values.tls.autoGenerated.enabled .Values.tls.ca .Values.tls.existingSecret) }}
|
||||||
|
- name: MYSQL_CLIENT_CA_FILE
|
||||||
|
value: "/opt/bitnami/mariadb/certs/ca.crt"
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- name: MARIADB_REPLICATION_MODE
|
||||||
|
value: "master"
|
||||||
|
- name: MARIADB_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUser | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-replication-password" .Values.auth.customPasswordFiles.replicator }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraFlags }}
|
||||||
|
- name: MARIADB_EXTRA_FLAGS
|
||||||
|
value: "{{ .Values.primary.extraFlags }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.startupWaitOptions }}
|
||||||
|
- name: MARIADB_STARTUP_WAIT_RETRIES
|
||||||
|
value: "{{ .Values.primary.startupWaitOptions.retries | default 300 }}"
|
||||||
|
- name: MARIADB_STARTUP_WAIT_SLEEP_TIME
|
||||||
|
value: "{{ .Values.primary.startupWaitOptions.sleepTime | default 2 }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.primary.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.extraEnvVarsCM .Values.primary.extraEnvVarsSecret }}
|
||||||
|
envFrom:
|
||||||
|
{{- if .Values.primary.extraEnvVarsCM }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.primary.extraEnvVarsCM }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.primary.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
containerPort: {{ .Values.primary.containerPorts.mysql }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.primary.customStartupProbe }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customStartupProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.primary.startupProbe.enabled }}
|
||||||
|
startupProbe: {{- omit .Values.primary.startupProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mariadb-admin ping -uroot -p"${password_aux}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.primary.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.primary.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mariadb-admin status -uroot -p"${password_aux}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.primary.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.primary.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mariadb-admin ping -uroot -p"${password_aux}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.resources }}
|
||||||
|
resources: {{ toYaml .Values.primary.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.primary.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.primary.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.primary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.primary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
|
||||||
|
- name: custom-init-scripts
|
||||||
|
mountPath: /docker-entrypoint-initdb.d
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /opt/bitnami/mariadb/conf/my.cnf
|
||||||
|
subPath: my.cnf
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mariadb/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: tls-certs
|
||||||
|
mountPath: /opt/bitnami/mariadb/certs
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tde.enabled }}
|
||||||
|
- name: tde
|
||||||
|
mountPath: /opt/bitnami/mariadb/tde
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/mariadb/conf
|
||||||
|
subPath: app-conf-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/mariadb/tmp
|
||||||
|
subPath: app-tmp-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/mariadb/logs
|
||||||
|
subPath: app-logs-dir
|
||||||
|
{{- if .Values.primary.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ include "mariadb.metrics.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.metrics.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mysqld-exporter/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||||
|
{{- else }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
MYSQLD_EXPORTER_PASSWORD=${password_aux} /bin/mysqld_exporter --mysqld.address=localhost:{{ .Values.primary.containerPorts.mysql }} --mysqld.username=root --web.listen-address=:{{ .Values.metrics.containerPorts.http }} {{- range .Values.metrics.extraArgs.primary }} {{ . }} {{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: {{ .Values.metrics.containerPorts.http }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.metrics.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.metrics.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
env:
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.metrics.fips "global" .Values.global) | quote }}
|
||||||
|
- name: GODEBUG
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "golang" "fips" .Values.metrics.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mysqld-exporter/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.extraVolumeMounts.primary }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraVolumeMounts.primary "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.sidecars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.sidecars "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: empty-dir
|
||||||
|
emptyDir: {}
|
||||||
|
{{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "mariadb.primary.configmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
|
||||||
|
- name: custom-init-scripts
|
||||||
|
configMap:
|
||||||
|
name: {{ template "mariadb.initdbScriptsCM" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.secretName" . }}
|
||||||
|
items:
|
||||||
|
- key: mariadb-root-password
|
||||||
|
path: mariadb-root-password
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
- key: mariadb-password
|
||||||
|
path: mariadb-password
|
||||||
|
{{- end -}}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- key: mariadb-replication-password
|
||||||
|
path: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: tls-certs
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.tls.secretName" . }}
|
||||||
|
defaultMode: 256
|
||||||
|
items:
|
||||||
|
- key: {{ ternary "tls.crt" .Values.tls.certFilename .Values.tls.autoGenerated.enabled }}
|
||||||
|
path: tls.crt
|
||||||
|
- key: {{ ternary "tls.key" .Values.tls.certKeyFilename .Values.tls.autoGenerated.enabled }}
|
||||||
|
path: tls.key
|
||||||
|
{{- if or .Values.tls.autoGenerated.enabled .Values.tls.ca .Values.tls.existingSecret }}
|
||||||
|
- key: {{ ternary "ca.crt" .Values.tls.certCAFilename .Values.tls.autoGenerated.enabled }}
|
||||||
|
path: ca.crt
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.tde.enabled ( not .Values.tde.secretsStoreProvider.enabled ) }}
|
||||||
|
- name: tde
|
||||||
|
secret:
|
||||||
|
secretName: {{ .Values.tde.existingSecret }}
|
||||||
|
items:
|
||||||
|
- key: {{ .Values.tde.randomKeyFilename }}
|
||||||
|
path: {{ .Values.tde.randomKeyFilename }}
|
||||||
|
- key: {{ .Values.tde.encryptedKeyFilename }}
|
||||||
|
path: {{ .Values.tde.encryptedKeyFilename }}
|
||||||
|
defaultMode: 256
|
||||||
|
{{- else if and .Values.tde.enabled ( .Values.tde.secretsStoreProvider.enabled ) }}
|
||||||
|
- name: tde
|
||||||
|
csi:
|
||||||
|
driver: 'secrets-store.csi.k8s.io'
|
||||||
|
readOnly: true
|
||||||
|
volumeAttributes:
|
||||||
|
secretProviderClass: {{ include "mariadb.tde.secretProviderClassName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumes "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.persistence.enabled .Values.primary.persistence.existingClaim }}
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ tpl .Values.primary.persistence.existingClaim . }}
|
||||||
|
{{- else if not .Values.primary.persistence.enabled }}
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
{{- else if and .Values.primary.persistence.enabled (not .Values.primary.persistence.existingClaim) }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
{{- $claimLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.persistence.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.matchLabels" ( dict "customLabels" $claimLabels "context" $ ) | nindent 10 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.primary.persistence.annotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.primary.persistence.annotations "context" $ ) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.primary.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.primary.persistence.size | quote }}
|
||||||
|
{{ include "common.storage.class" (dict "persistence" .Values.primary.persistence "global" .Values.global) }}
|
||||||
|
{{- if .Values.primary.persistence.selector }}
|
||||||
|
selector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.selector "context" $) | nindent 10 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
63
charts/semaphore/charts/mariadb/templates/primary/svc.yaml
Normal file
63
charts/semaphore/charts/mariadb/templates/primary/svc.yaml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
annotations:
|
||||||
|
{{- if or .Values.primary.service.annotations .Values.commonAnnotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.service.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.primary.service.type }}
|
||||||
|
{{- if and .Values.primary.service.clusterIP (eq .Values.primary.service.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.primary.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.service.externalTrafficPolicy (or (eq .Values.primary.service.type "LoadBalancer") (eq .Values.primary.service.type "NodePort")) }}
|
||||||
|
externalTrafficPolicy: {{ .Values.primary.service.externalTrafficPolicy | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.primary.service.type "LoadBalancer") .Values.primary.service.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges: {{- toYaml .Values.primary.service.loadBalancerSourceRanges | nindent 4 }}
|
||||||
|
{{ end }}
|
||||||
|
{{- if (and (eq .Values.primary.service.type "LoadBalancer") (not (empty .Values.primary.service.loadBalancerIP))) }}
|
||||||
|
loadBalancerIP: {{ .Values.primary.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if ne .Values.primary.service.sessionAffinity "None"}}
|
||||||
|
sessionAffinity: {{ .Values.primary.service.sessionAffinity }}
|
||||||
|
{{- if .Values.primary.service.sessionAffinityConfig }}
|
||||||
|
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.primary.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: {{ coalesce .Values.primary.service.ports.mysql .Values.primary.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: mysql
|
||||||
|
{{- if (and (or (eq .Values.primary.service.type "NodePort") (eq .Values.primary.service.type "LoadBalancer")) (coalesce .Values.primary.service.nodePorts.mysql .Values.primary.service.nodePort)) }}
|
||||||
|
nodePort: {{ coalesce .Values.primary.service.nodePorts.mysql .Values.primary.service.nodePort }}
|
||||||
|
{{- else if eq .Values.primary.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled (gt (.Values.primary.service.ports.metrics | int) 0) }}
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.primary.service.ports.metrics }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.service.extraPorts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.service.extraPorts "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PrometheusRule
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ default .Release.Namespace .Values.metrics.prometheusRule.namespace | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: metrics
|
||||||
|
{{- if .Values.metrics.prometheusRule.additionalLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
groups:
|
||||||
|
- name: {{ include "common.names.fullname" . }}
|
||||||
|
rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
24
charts/semaphore/charts/mariadb/templates/role.yaml
Normal file
24
charts/semaphore/charts/mariadb/templates/role.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.serviceAccount.create .Values.rbac.create }}
|
||||||
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- endpoints
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
{{- end }}
|
||||||
24
charts/semaphore/charts/mariadb/templates/rolebinding.yaml
Normal file
24
charts/semaphore/charts/mariadb/templates/rolebinding.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.serviceAccount.create .Values.rbac.create }}
|
||||||
|
kind: RoleBinding
|
||||||
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ include "mariadb.serviceAccountName" . }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: {{ include "common.names.fullname" . -}}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if (include "mariadb.secondary.createConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
my.cnf: |-
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.secondary.configuration "context" $ ) | nindent 4 }}
|
||||||
|
{{- end -}}
|
||||||
29
charts/semaphore/charts/mariadb/templates/secondary/pdb.yaml
Normal file
29
charts/semaphore/charts/mariadb/templates/secondary/pdb.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and (eq .Values.architecture "replication") .Values.secondary.pdb.create }}
|
||||||
|
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.secondary.pdb.minAvailable }}
|
||||||
|
minAvailable: {{ .Values.secondary.pdb.minAvailable }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.secondary.pdb.maxUnavailable (not .Values.secondary.pdb.minAvailable) }}
|
||||||
|
maxUnavailable: {{ .Values.secondary.pdb.maxUnavailable | default 1 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.secondary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,491 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.secondary.replicaCount }}
|
||||||
|
revisionHistoryLimit: {{ .Values.secondary.revisionHistoryLimit }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.secondary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
podManagementPolicy: {{ .Values.secondary.podManagementPolicy }}
|
||||||
|
{{- if .Values.secondary.updateStrategy }}
|
||||||
|
updateStrategy: {{- toYaml .Values.secondary.updateStrategy | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if (include "mariadb.secondary.createConfigmap" .) }}
|
||||||
|
checksum/configuration: {{ include (print $.Template.BasePath "/secondary/configmap.yaml") . | sha256sum }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.enabled }}
|
||||||
|
charts.bitnami.com/password-last-update: {{ now | date "20060102150405" | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
spec:
|
||||||
|
{{- include "mariadb.imagePullSecrets" . | nindent 6 }}
|
||||||
|
{{- if or .Values.secondary.schedulerName .Values.schedulerName }}
|
||||||
|
schedulerName: {{ (coalesce .Values.secondary.schedulerName .Values.schedulerName) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ template "mariadb.serviceAccountName" . }}
|
||||||
|
automountServiceAccountToken: {{ .Values.secondary.automountServiceAccountToken }}
|
||||||
|
{{- if .Values.secondary.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.secondary.podAffinityPreset "component" "secondary" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.secondary.podAntiAffinityPreset "component" "secondary" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.secondary.nodeAffinityPreset.type "key" .Values.secondary.nodeAffinityPreset.key "values" .Values.secondary.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.tolerations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.secondary.priorityClassName | quote }}
|
||||||
|
{{- else if .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.runtimeClassName }}
|
||||||
|
runtimeClassName: {{ .Values.secondary.runtimeClassName | quote }}
|
||||||
|
{{- else if .Values.runtimeClassName }}
|
||||||
|
runtimeClassName: {{ .Values.runtimeClassName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.secondary.podSecurityContext "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.terminationGracePeriodSeconds }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.secondary.terminationGracePeriodSeconds }}
|
||||||
|
{{- end }}
|
||||||
|
initContainers:
|
||||||
|
- name: preserve-logs-symlinks
|
||||||
|
image: {{ include "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.secondary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.primary.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.resources }}
|
||||||
|
resources: {{ toYaml .Values.secondary.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.secondary.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.secondary.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
args:
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /opt/bitnami/scripts/libfs.sh
|
||||||
|
# We copy the logs folder because it has symlinks to stdout and stderr
|
||||||
|
if ! is_dir_empty /opt/bitnami/mariadb/logs; then
|
||||||
|
cp -r /opt/bitnami/mariadb/logs /emptydir/app-logs-dir
|
||||||
|
fi
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
env:
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.volumePermissions.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /emptydir
|
||||||
|
{{- if and .Values.secondary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.secondary.persistence.enabled }}
|
||||||
|
- name: volume-permissions
|
||||||
|
image: {{ include "mariadb.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
chown -R {{ .Values.secondary.containerSecurityContext.runAsUser }}:{{ .Values.secondary.podSecurityContext.fsGroup }} /bitnami/mariadb
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
{{- if .Values.volumePermissions.resources }}
|
||||||
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.volumePermissions.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.volumePermissions.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
env:
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.volumePermissions.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.secondary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.secondary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.initContainers "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: {{ include "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.secondary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.secondary.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.secondary.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.command "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.secondary.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.args "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.lifecycleHooks }}
|
||||||
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.lifecycleHooks "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||||
|
- name: MARIADB_REPLICATION_MODE
|
||||||
|
value: "slave"
|
||||||
|
- name: MARIADB_MASTER_HOST
|
||||||
|
value: {{ include "mariadb.primary.fullname" . }}
|
||||||
|
- name: MARIADB_MASTER_PORT_NUMBER
|
||||||
|
value: {{ coalesce .Values.primary.service.ports.mysql .Values.primary.service.port | quote }}
|
||||||
|
- name: MARIADB_MASTER_ROOT_USER
|
||||||
|
value: "root"
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_MASTER_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_MASTER_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
- name: MARIADB_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUser | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mariadb/secrets/mariadb-replication-password" .Values.auth.customPasswordFiles.replicator }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraFlags }}
|
||||||
|
- name: MARIADB_EXTRA_FLAGS
|
||||||
|
value: "{{ .Values.secondary.extraFlags }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.startupWaitOptions }}
|
||||||
|
- name: MARIADB_STARTUP_WAIT_RETRIES
|
||||||
|
value: "{{ .Values.secondary.startupWaitOptions.retries | default 300 }}"
|
||||||
|
- name: MARIADB_STARTUP_WAIT_SLEEP_TIME
|
||||||
|
value: "{{ .Values.secondary.startupWaitOptions.sleepTime | default 2 }}"
|
||||||
|
{{- end }}
|
||||||
|
- name: MARIADB_ENABLE_SSL
|
||||||
|
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||||
|
{{- if and .Values.tls.enabled (or .Values.tls.autoGenerated.enabled .Values.tls.ca .Values.tls.existingSecret) }}
|
||||||
|
- name: MYSQL_CLIENT_CA_FILE
|
||||||
|
value: "/opt/bitnami/mariadb/certs/ca.crt"
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.secondary.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.secondary.extraEnvVarsCM .Values.secondary.extraEnvVarsSecret }}
|
||||||
|
envFrom:
|
||||||
|
{{- if .Values.secondary.extraEnvVarsCM }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.secondary.extraEnvVarsCM }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.secondary.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
containerPort: {{ .Values.secondary.containerPorts.mysql }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.secondary.customStartupProbe }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customStartupProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.secondary.startupProbe.enabled }}
|
||||||
|
startupProbe: {{- omit .Values.secondary.startupProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_MASTER_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_MASTER_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mariadb-admin ping -uroot -p"${password_aux}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.secondary.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.secondary.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_MASTER_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_MASTER_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mariadb-admin status -uroot -p"${password_aux}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.secondary.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.secondary.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_MASTER_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_MASTER_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
mariadb-admin ping -uroot -p"${password_aux}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.resources }}
|
||||||
|
resources: {{ toYaml .Values.secondary.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.secondary.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.secondary.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/mariadb
|
||||||
|
{{- if .Values.secondary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.secondary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /opt/bitnami/mariadb/conf/my.cnf
|
||||||
|
subPath: my.cnf
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mariadb/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/mariadb/conf
|
||||||
|
subPath: app-conf-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/mariadb/tmp
|
||||||
|
subPath: app-tmp-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/mariadb/logs
|
||||||
|
subPath: app-logs-dir
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: tls-certs
|
||||||
|
mountPath: /opt/bitnami/mariadb/certs
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tde.enabled }}
|
||||||
|
- name: tde
|
||||||
|
mountPath: /opt/bitnami/mariadb/tde
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ include "mariadb.metrics.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.metrics.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD_FILE
|
||||||
|
value: {{ default "/opt/bitnami/mysqld-exporter/secrets/mariadb-root-password" .Values.auth.customPasswordFiles.root }}
|
||||||
|
{{- else }}
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.secretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.metrics.fips "global" .Values.global) | quote }}
|
||||||
|
- name: GODEBUG
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "golang" "fips" .Values.metrics.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||||
|
{{- else }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
password_aux="${MARIADB_ROOT_PASSWORD:-}"
|
||||||
|
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
|
||||||
|
password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
|
||||||
|
fi
|
||||||
|
MYSQLD_EXPORTER_PASSWORD=${password_aux} /bin/mysqld_exporter --mysqld.address=localhost:{{ .Values.secondary.containerPorts.mysql }} --mysqld.username=root --web.listen-address=:{{ .Values.metrics.containerPorts.http }} {{- range .Values.metrics.extraArgs.primary }} {{ . }} {{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: {{ .Values.metrics.containerPorts.http }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.metrics.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /metrics
|
||||||
|
port: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.metrics.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
mountPath: /opt/bitnami/mysqld-exporter/secrets/
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: app-tmp-dir
|
||||||
|
{{- if .Values.metrics.extraVolumeMounts.secondary }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraVolumeMounts.secondary "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.sidecars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.sidecars "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
{{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "mariadb.secondary.configmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
|
||||||
|
- name: mariadb-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.secretName" . }}
|
||||||
|
items:
|
||||||
|
- key: mariadb-root-password
|
||||||
|
path: mariadb-root-password
|
||||||
|
- key: mariadb-replication-password
|
||||||
|
path: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: tls-certs
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.tls.secretName" . }}
|
||||||
|
defaultMode: 256
|
||||||
|
items:
|
||||||
|
- key: {{ ternary "tls.crt" .Values.tls.certFilename .Values.tls.autoGenerated.enabled }}
|
||||||
|
path: tls.crt
|
||||||
|
- key: {{ ternary "tls.key" .Values.tls.certKeyFilename .Values.tls.autoGenerated.enabled }}
|
||||||
|
path: tls.key
|
||||||
|
{{- if or .Values.tls.autoGenerated.enabled .Values.tls.ca .Values.tls.existingSecret }}
|
||||||
|
- key: {{ ternary "ca.crt" .Values.tls.certCAFilename .Values.tls.autoGenerated.enabled }}
|
||||||
|
path: ca.crt
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.tde.enabled ( not .Values.tde.secretsStoreProvider.enabled ) }}
|
||||||
|
- name: tde
|
||||||
|
secret:
|
||||||
|
secretName: {{ .Values.tde.existingSecret }}
|
||||||
|
items:
|
||||||
|
- key: {{ .Values.tde.randomKeyFilename }}
|
||||||
|
path: {{ .Values.tde.randomKeyFilename }}
|
||||||
|
- key: {{ .Values.tde.encryptedKeyFilename }}
|
||||||
|
path: {{ .Values.tde.encryptedKeyFilename }}
|
||||||
|
defaultMode: 256
|
||||||
|
{{- else if and .Values.tde.enabled ( .Values.tde.secretsStoreProvider.enabled ) }}
|
||||||
|
- name: tde
|
||||||
|
csi:
|
||||||
|
driver: 'secrets-store.csi.k8s.io'
|
||||||
|
readOnly: true
|
||||||
|
volumeAttributes:
|
||||||
|
secretProviderClass: {{ include "mariadb.tde.secretProviderClassName" . }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
emptyDir: {}
|
||||||
|
{{- if .Values.secondary.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraVolumes "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.secondary.persistence.enabled }}
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
{{- else }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
{{- $claimLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.secondary.persistence.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.matchLabels" ( dict "customLabels" $claimLabels "context" $ ) | nindent 10 }}
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- if .Values.secondary.persistence.annotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.secondary.persistence.annotations "context" $ ) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.secondary.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.secondary.persistence.size | quote }}
|
||||||
|
{{ include "common.storage.class" (dict "persistence" .Values.secondary.persistence "global" .Values.global) }}
|
||||||
|
{{- if .Values.secondary.persistence.selector }}
|
||||||
|
selector: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.persistence.selector "context" $) | nindent 10 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
66
charts/semaphore/charts/mariadb/templates/secondary/svc.yaml
Normal file
66
charts/semaphore/charts/mariadb/templates/secondary/svc.yaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.secondary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
annotations:
|
||||||
|
{{- if or .Values.secondary.service.annotations .Values.commonAnnotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.secondary.service.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.secondary.service.type }}
|
||||||
|
{{- if and .Values.secondary.service.clusterIP (eq .Values.secondary.service.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.secondary.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.secondary.service.externalTrafficPolicy (or (eq .Values.secondary.service.type "LoadBalancer") (eq .Values.secondary.service.type "NodePort")) }}
|
||||||
|
externalTrafficPolicy: {{ .Values.secondary.service.externalTrafficPolicy | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.secondary.service.type "LoadBalancer") .Values.secondary.service.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges: {{- toYaml .Values.secondary.service.loadBalancerSourceRanges | nindent 4 }}
|
||||||
|
{{ end }}
|
||||||
|
{{- if and (eq .Values.secondary.service.type "LoadBalancer") (not (empty .Values.secondary.service.loadBalancerIP)) }}
|
||||||
|
loadBalancerIP: {{ .Values.secondary.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if ne .Values.secondary.service.sessionAffinity "None"}}
|
||||||
|
sessionAffinity: {{ .Values.secondary.service.sessionAffinity }}
|
||||||
|
{{- if .Values.secondary.service.sessionAffinityConfig }}
|
||||||
|
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: {{ coalesce .Values.secondary.service.ports.mysql .Values.secondary.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: mysql
|
||||||
|
{{- if (and (or (eq .Values.secondary.service.type "NodePort") (eq .Values.secondary.service.type "LoadBalancer")) (coalesce .Values.secondary.service.nodePorts.mysql .Values.secondary.service.nodePort)) }}
|
||||||
|
nodePort: {{ coalesce .Values.secondary.service.nodePorts.mysql .Values.secondary.service.nodePort }}
|
||||||
|
{{- else if eq .Values.secondary.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled (gt (.Values.secondary.service.ports.metrics | int) 0) }}
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.secondary.service.ports.metrics }}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secondary.service.extraPorts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.secondary.service.extraPorts "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.secondary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: secondary
|
||||||
|
{{- end }}
|
||||||
101
charts/semaphore/charts/mariadb/templates/secrets.yaml
Normal file
101
charts/semaphore/charts/mariadb/templates/secrets.yaml
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- $host := include "mariadb.primary.fullname" . }}
|
||||||
|
{{- $port := print .Values.primary.service.ports.mysql }}
|
||||||
|
{{- $rootPassword := include "common.secrets.passwords.manage" ( dict "secret" ( include "mariadb.secretName" . ) "key" "mariadb-root-password" "providedValues" ( list "auth.rootPassword" ) "honorProvidedValues" true "context" $ ) | trimAll "\"" | b64dec }}
|
||||||
|
{{- $password := .Values.auth.password }}
|
||||||
|
{{- if and .Values.auth.username ( include "mariadb.secret.existPassword" . ) }}
|
||||||
|
{{- $password = include "common.secrets.passwords.manage" ( dict "secret" ( include "mariadb.secretName" . ) "key" "mariadb-password" "providedValues" ( list "auth.password" ) "honorProvidedValues" true "context" $ ) | trimAll "\"" | b64dec }}
|
||||||
|
{{- else if ( and .Values.auth.username ( not .Values.auth.forcePassword ) ( empty .Values.auth.password ) ) }}
|
||||||
|
{{- $password = randAlphaNum 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if (include "mariadb.createSecret" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
{{- if ( not .Values.auth.forcePassword ) }}
|
||||||
|
mariadb-root-password: {{ print $rootPassword | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
mariadb-root-password: {{ required "A MariaDB Root Password is required!" .Values.auth.rootPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
{{- if ( not .Values.auth.forcePassword ) }}
|
||||||
|
mariadb-password: {{ print $password | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
mariadb-password: {{ required "A MariaDB Database Password is required!" $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- if ( not .Values.auth.forcePassword ) }}
|
||||||
|
mariadb-replication-password: {{ include "common.secrets.passwords.manage" ( dict "secret" ( include "common.names.fullname" . ) "key" "mariadb-replication-password" "providedValues" ( list "auth.replicationPassword" ) "honorProvidedValues" true "context" $ ) }}
|
||||||
|
{{- else }}
|
||||||
|
mariadb-replication-password: {{ required "A MariaDB Replication Password is required!" .Values.auth.replicationPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .Values.serviceBindings.enabled }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}-svcbind-root
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: servicebinding.io/mysql
|
||||||
|
data:
|
||||||
|
provider: {{ print "bitnami" | b64enc | quote }}
|
||||||
|
type: {{ print "mysql" | b64enc | quote }}
|
||||||
|
host: {{ print $host | b64enc | quote }}
|
||||||
|
port: {{ print $port | b64enc | quote }}
|
||||||
|
username: {{ print "root" | b64enc | quote }}
|
||||||
|
password: {{ print $rootPassword | b64enc | quote }}
|
||||||
|
uri: {{ printf "mysql://root:%s@%s:%s" $rootPassword $host $port | b64enc | quote }}
|
||||||
|
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
{{- $database := .Values.auth.database }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}-svcbind-custom-user
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: servicebinding.io/mysql
|
||||||
|
data:
|
||||||
|
provider: {{ print "bitnami" | b64enc | quote }}
|
||||||
|
type: {{ print "mysql" | b64enc | quote }}
|
||||||
|
host: {{ print $host | b64enc | quote }}
|
||||||
|
port: {{ print $port | b64enc | quote }}
|
||||||
|
username: {{ print .Values.auth.username | b64enc | quote }}
|
||||||
|
{{- if $database }}
|
||||||
|
database: {{ print $database | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.forcePassword ( empty $password ) }}
|
||||||
|
password: {{ required "A MariaDB Database Password is required!" $password | b64enc | quote }}
|
||||||
|
{{- else }}
|
||||||
|
password: {{ print $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
uri: {{ printf "mysql://%s:%s@%s:%s/%s" .Values.auth.username $password $host $port $database | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.tde.enabled ( .Values.tde.secretsStoreProvider.enabled ) }}
|
||||||
|
apiVersion: secrets-store.csi.x-k8s.io/v1
|
||||||
|
kind: SecretProviderClass
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.tde.secretProviderClassName" . | quote }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
provider: {{ .Values.tde.secretsStoreProvider.provider }}
|
||||||
|
parameters:
|
||||||
|
roleName: {{ .Values.tde.secretsStoreProvider.vault.roleName | quote }}
|
||||||
|
{{- if .Values.tde.secretsStoreProvider.vault.address }}
|
||||||
|
vaultAddress: {{ .Values.tde.secretsStoreProvider.vault.address | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tde.secretsStoreProvider.vault.authMountPath }}
|
||||||
|
vaultAuthMountPath: {{ .Values.tde.secretsStoreProvider.vault.authMountPath | quote }}
|
||||||
|
{{- end }}
|
||||||
|
objects: |
|
||||||
|
- objectName: {{ .Values.tde.randomKeyFilename | quote }}
|
||||||
|
secretPath: {{ .Values.tde.secretsStoreProvider.vault.randomKeySecretPath | quote }}
|
||||||
|
secretKey: {{ .Values.tde.secretsStoreProvider.vault.randomKeySecretKey | quote }}
|
||||||
|
encoding: "base64"
|
||||||
|
- objectName: {{ .Values.tde.encryptedKeyFilename | quote }}
|
||||||
|
secretPath: {{ .Values.tde.secretsStoreProvider.vault.encryptedKeySecretPath | quote }}
|
||||||
|
secretKey: {{ .Values.tde.secretsStoreProvider.vault.encryptedKeySecretKey | quote }}
|
||||||
|
encoding: "base64"
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mariadb.serviceAccountName" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceAccount.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
namespace: {{ default .Release.Namespace .Values.metrics.serviceMonitor.namespace | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | quote }}
|
||||||
|
endpoints:
|
||||||
|
- port: metrics
|
||||||
|
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||||
|
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.relabelings }}
|
||||||
|
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ include "common.names.namespace" . | quote }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.selector }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
50
charts/semaphore/charts/mariadb/templates/tls-secret.yaml
Normal file
50
charts/semaphore/charts/mariadb/templates/tls-secret.yaml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.tls.enabled (not .Values.tls.existingSecret) (or (not .Values.tls.autoGenerated.enabled) (and .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "helm"))) }}
|
||||||
|
{{- $secretName := include "mariadb.tls.secretName" . }}
|
||||||
|
{{- $caValue := "" }}
|
||||||
|
{{- $certValue := "" }}
|
||||||
|
{{- $keyValue := "" }}
|
||||||
|
{{- if .Values.tls.autoGenerated.enabled }}
|
||||||
|
{{- $releaseNamespace := include "common.names.namespace" . }}
|
||||||
|
{{- $clusterDomain := .Values.clusterDomain }}
|
||||||
|
{{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- $loopback := .Values.tls.autoGenerated.loopback }}
|
||||||
|
{{- $ipAddresses := ternary (list "127.0.0.1") nil $loopback }}
|
||||||
|
{{- $extraSANs := .Values.tls.autoGenerated.extraSANs | default (list) }}
|
||||||
|
{{- $ca := genCA "mariadb-ca" 365 }}
|
||||||
|
{{- $caValue = $ca.Cert }}
|
||||||
|
{{- /* Cert generation */ -}}
|
||||||
|
{{- $primaryServiceName := include "mariadb.primary.fullname" . }}
|
||||||
|
{{- $secondaryServiceName := include "mariadb.secondary.fullname" . }}
|
||||||
|
{{- $sans := include "common.certs.sans" (dict "namespace" $releaseNamespace "clusterDomain" $clusterDomain "serviceName" $primaryServiceName "headlessServiceName" $headlessServiceName "loopback" $loopback "extraSANs" $extraSANs) | splitList " " | uniq }}
|
||||||
|
{{- $sans = include "common.certs.sans" (dict "namespace" $releaseNamespace "clusterDomain" $clusterDomain "serviceName" $secondaryServiceName) | splitList " " | concat $sans | uniq }}
|
||||||
|
{{- $cert := genSignedCert $primaryServiceName $ipAddresses $sans 365 $ca }}
|
||||||
|
{{- $certValue = $cert.Cert }}
|
||||||
|
{{- $keyValue = $cert.Key }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $caValue = .Values.tls.ca }}
|
||||||
|
{{- $certValue = required "When tls.autoGenerated.enabled=false you need to provide tls.cert" .Values.tls.cert }}
|
||||||
|
{{- $keyValue = required "When tls.autoGenerated.enabled=false you need to provide tls.key" .Values.tls.key }}
|
||||||
|
{{- end }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ $secretName }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: kubernetes.io/tls
|
||||||
|
data:
|
||||||
|
tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $certValue "context" .) }}
|
||||||
|
tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $keyValue "context" .) }}
|
||||||
|
{{- if $caValue }}
|
||||||
|
ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $caValue "context" .) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,251 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.passwordUpdateJob.enabled }}
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-password-update" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: update-job
|
||||||
|
{{- $defaultAnnotations := dict "helm.sh/hook" "pre-upgrade" "helm.sh/hook-delete-policy" "hook-succeeded" }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonAnnotations $defaultAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
backoffLimit: {{ .Values.passwordUpdateJob.backoffLimit }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.passwordUpdateJob.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
||||||
|
app.kubernetes.io/part-of: mariadb
|
||||||
|
app.kubernetes.io/component: update-job
|
||||||
|
{{- if .Values.passwordUpdateJob.podAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.podAnnotations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "mariadb.imagePullSecrets" . | nindent 6 }}
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
{{- if .Values.passwordUpdateJob.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.passwordUpdateJob.podSecurityContext "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
automountServiceAccountToken: {{ .Values.passwordUpdateJob.automountServiceAccountToken }}
|
||||||
|
{{- if .Values.passwordUpdateJob.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
initContainers:
|
||||||
|
{{- if .Values.passwordUpdateJob.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.initContainers "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: update-credentials
|
||||||
|
image: {{ template "mariadb.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
{{- if .Values.passwordUpdateJob.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.command "context" $) | nindent 12 }}
|
||||||
|
{{- else }}
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ec
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.args "context" $) | nindent 12 }}
|
||||||
|
{{- else }}
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
{{- if .Values.usePasswordFiles }}
|
||||||
|
# We need to load all the secret env vars to the system
|
||||||
|
for file in $(find /bitnami/mariadb/secrets -type f); do
|
||||||
|
env_var_name="$(basename $file)"
|
||||||
|
echo "Exporting $env_var_name"
|
||||||
|
export $env_var_name="$(< $file)"
|
||||||
|
done
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
. /opt/bitnami/scripts/mariadb-env.sh
|
||||||
|
. /opt/bitnami/scripts/libmariadb.sh
|
||||||
|
. /opt/bitnami/scripts/liblog.sh
|
||||||
|
|
||||||
|
primary_host={{ include "mariadb.primary.fullname" . }}-0.{{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
info "Starting password update job"
|
||||||
|
if [[ -f /job-status/root-password-changed ]]; then
|
||||||
|
info "Root password already updated. Skipping"
|
||||||
|
else
|
||||||
|
info "Updating root password"
|
||||||
|
echo "SET PASSWORD for 'root'@'%' = PASSWORD('$MARIADB_NEW_ROOT_PASSWORD');" | mysql_remote_execute $primary_host {{ .Values.primary.containerPorts.mysql }} "" root $MARIADB_PREVIOUS_ROOT_PASSWORD
|
||||||
|
touch /job-status/root-password-changed
|
||||||
|
info "Root password successfully updated"
|
||||||
|
fi
|
||||||
|
{{- if not (empty .Values.auth.username) }}
|
||||||
|
if [[ -f /job-status/password-changed ]]; then
|
||||||
|
info "User password already updated. Skipping"
|
||||||
|
else
|
||||||
|
info "Updating user password"
|
||||||
|
echo "SET PASSWORD for '$MARIADB_USER'@'%' = PASSWORD('$MARIADB_NEW_PASSWORD');" | mysql_remote_execute $primary_host {{ .Values.primary.containerPorts.mysql }} "" $MARIADB_USER $MARIADB_PREVIOUS_PASSWORD
|
||||||
|
touch /job-status/password-changed
|
||||||
|
info "User password successfully updated"
|
||||||
|
fi
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
if [[ -f /job-status/replication-password-changed ]]; then
|
||||||
|
info "Replication password already updated. Skipping"
|
||||||
|
else
|
||||||
|
info "Updating replication password"
|
||||||
|
echo "SET PASSWORD for '$MARIADB_REPLICATION_USER'@'%' = PASSWORD('$MARIADB_NEW_REPLICATION_PASSWORD');" | mysql_remote_execute $primary_host {{ .Values.primary.containerPorts.mysql }} "" $MARIADB_REPLICATION_USER $MARIADB_PREVIOUS_REPLICATION_PASSWORD
|
||||||
|
touch /job-status/replication-password-changed
|
||||||
|
info "Replication password successfully updated"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in $(seq 0 {{ sub .Values.secondary.replicaCount 1 }}); do
|
||||||
|
if [[ -f /job-status/replica-$i-changed ]]; then
|
||||||
|
info "Replica $i already updated. Skipping"
|
||||||
|
else
|
||||||
|
replica_host={{ include "mariadb.secondary.fullname" . }}-$i.{{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
info "Updating primary password in replica $i"
|
||||||
|
echo "STOP SLAVE; CHANGE MASTER TO MASTER_PASSWORD='$MARIADB_NEW_REPLICATION_PASSWORD'; START SLAVE;" | mysql_remote_execute $replica_host {{ .Values.secondary.containerPorts.mysql }} "" root $MARIADB_NEW_ROOT_PASSWORD
|
||||||
|
touch /job-status/replica-$i-changed
|
||||||
|
info "Replica $i updated"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.extraCommands }}
|
||||||
|
info "Running extra commmands"
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.extraCommands "context" $) | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
info "Password update job finished successfully"
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
||||||
|
{{- if not .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_PREVIOUS_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.update-job.previousSecretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
- name: MARIADB_NEW_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.update-job.newSecretName" . }}
|
||||||
|
key: mariadb-root-password
|
||||||
|
{{- end }}
|
||||||
|
{{- if not (empty .Values.auth.username) }}
|
||||||
|
- name: MARIADB_USER
|
||||||
|
value: {{ .Values.auth.username | quote }}
|
||||||
|
{{- if not .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_PREVIOUS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.update-job.previousSecretName" . }}
|
||||||
|
key: mariadb-password
|
||||||
|
- name: MARIADB_NEW_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.update-job.newSecretName" . }}
|
||||||
|
key: mariadb-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- name: MARIADB_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUser | quote }}
|
||||||
|
{{- if not .Values.auth.usePasswordFiles }}
|
||||||
|
- name: MARIADB_PREVIOUS_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.update-job.previousSecretName" . }}
|
||||||
|
key: mariadb-replication-password
|
||||||
|
- name: MARIADB_NEW_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "mariadb.update-job.newSecretName" . }}
|
||||||
|
key: mariadb-replication-password
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.passwordUpdateJob.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.passwordUpdateJob.extraEnvVarsCM .Values.passwordUpdateJob.extraEnvVarsSecret }}
|
||||||
|
envFrom:
|
||||||
|
{{- if .Values.passwordUpdateJob.extraEnvVarsCM }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.passwordUpdateJob.extraEnvVarsCM }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.passwordUpdateJob.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.passwordUpdateJob.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.customStartupProbe }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.customStartupProbe "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /job-status
|
||||||
|
subPath: job-dir
|
||||||
|
{{- if .Values.usePasswordFiles }}
|
||||||
|
- name: mariadb-previous-credentials
|
||||||
|
mountPath: /bitnami/mariadb/secrets/previous
|
||||||
|
- name: mariadb-new-credentials
|
||||||
|
mountPath: /bitnami/mariadb/secrets/new
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.resources }}
|
||||||
|
resources: {{- toYaml .Values.passwordUpdateJob.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.passwordUpdateJob.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.passwordUpdateJob.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: empty-dir
|
||||||
|
emptyDir: {}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles }}
|
||||||
|
- name: mariadb-previous-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.update-job.previousSecretName" . }}
|
||||||
|
items:
|
||||||
|
- key: mariadb-root-password
|
||||||
|
path: MARIADB_PREVIOUS_ROOT_PASSWORD
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
- key: mariadb-password
|
||||||
|
path: MARIADB_PREVIOUS_PASSWORD
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- key: mariadb-replication-password
|
||||||
|
path: MARIADB_PREVIOUS_REPLICATION_PASSWORD
|
||||||
|
{{- end }}
|
||||||
|
- name: mariadb-new-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "mariadb.update-job.newSecretName" . }}
|
||||||
|
items:
|
||||||
|
- key: mariadb-root-password
|
||||||
|
path: MARIADB_NEW_ROOT_PASSWORD
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
- key: mariadb-password
|
||||||
|
path: MARIADB_NEW_PASSWORD
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- key: mariadb-replication-password
|
||||||
|
path: MARIADB_NEW_REPLICATION_PASSWORD
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.passwordUpdateJob.extraVolumes "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.passwordUpdateJob.enabled (include "mariadb.createSecret" .) (not ( include "mariadb.createPreviousSecret" . )) (not .Values.passwordUpdateJob.previousPasswords.existingSecret) }}
|
||||||
|
{{- $rootPassword := .Values.auth.rootPassword }}
|
||||||
|
{{- $password := .Values.auth.password }}
|
||||||
|
{{- $replicationPassword := .Values.auth.replicationPassword }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-new-secret" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- $defaultAnnotations := dict "helm.sh/hook" "pre-upgrade" "helm.sh/hook-delete-policy" "hook-succeeded" }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonAnnotations $defaultAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
mariadb-root-password: {{ required "The new root password is required!" $rootPassword | b64enc | quote }}
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
mariadb-password: {{ required "The new user password is required!" $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
mariadb-replication-password: {{ required "The new replication password is required!" $replicationPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.passwordUpdateJob.enabled (eq ( include "mariadb.createPreviousSecret" . ) "true") }}
|
||||||
|
{{- $rootPassword := .Values.passwordUpdateJob.previousPasswords.rootPassword }}
|
||||||
|
{{- $password := .Values.passwordUpdateJob.previousPasswords.password }}
|
||||||
|
{{- $replicationPassword := .Values.passwordUpdateJob.previousPasswords.replicationPassword }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-previous-secret" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- $defaultAnnotations := dict "helm.sh/hook" "pre-upgrade" "helm.sh/hook-delete-policy" "hook-succeeded" }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonAnnotations $defaultAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
mariadb-root-password: {{ required "The previous root password is required!" $rootPassword | b64enc | quote }}
|
||||||
|
{{- if .Values.auth.username }}
|
||||||
|
mariadb-password: {{ required "The previous user password is required!" $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
mariadb-replication-password: {{ required "The previous replication password is required!" $replicationPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
2289
charts/semaphore/charts/mariadb/values.schema.json
Normal file
2289
charts/semaphore/charts/mariadb/values.schema.json
Normal file
File diff suppressed because it is too large
Load Diff
1673
charts/semaphore/charts/mariadb/values.yaml
Normal file
1673
charts/semaphore/charts/mariadb/values.yaml
Normal file
File diff suppressed because it is too large
Load Diff
25
charts/semaphore/charts/postgresql/.helmignore
Normal file
25
charts/semaphore/charts/postgresql/.helmignore
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
# img folder
|
||||||
|
img/
|
||||||
|
# Changelog
|
||||||
|
CHANGELOG.md
|
||||||
13
charts/semaphore/charts/postgresql/.relok8s-images.yaml
Normal file
13
charts/semaphore/charts/postgresql/.relok8s-images.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# relok8s image hints file
|
||||||
|
# This file makes this Helm Chart relocatable by relok8s
|
||||||
|
# More info here https://github.com/vmware-tanzu/asset-relocation-tool-for-kubernetes
|
||||||
|
#
|
||||||
|
# postgresql chart
|
||||||
|
|
||||||
|
# postgresql image
|
||||||
|
- "{{.image.registry}}/{{.image.repository}}:{{.image.tag}}"
|
||||||
|
# os-shell image
|
||||||
|
- "{{.volumePermissions.image.registry}}/{{.volumePermissions.image.repository}}:{{.volumePermissions.image.tag}}"
|
||||||
|
# postgres-exporter image
|
||||||
|
- "{{.metrics.image.registry}}/{{.metrics.image.repository}}:{{.metrics.image.tag}}"
|
||||||
|
|
||||||
41
charts/semaphore/charts/postgresql/Chart.yaml
Normal file
41
charts/semaphore/charts/postgresql/Chart.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
annotations:
|
||||||
|
fips: "true"
|
||||||
|
images: |
|
||||||
|
- name: os-shell
|
||||||
|
version: "5"
|
||||||
|
image: registry-1.docker.io/bitnami/os-shell:latest
|
||||||
|
- name: postgres-exporter
|
||||||
|
version: 0.18.1
|
||||||
|
image: registry-1.docker.io/bitnami/postgres-exporter:latest
|
||||||
|
- name: postgresql
|
||||||
|
version: 18.0.0
|
||||||
|
image: registry-1.docker.io/bitnami/postgresql:latest
|
||||||
|
licenses: Apache-2.0
|
||||||
|
tanzuCategory: service
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 18.0.0
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
tags:
|
||||||
|
- bitnami-common
|
||||||
|
version: 2.33.1
|
||||||
|
description: PostgreSQL (Postgres) is an open source object-relational database known
|
||||||
|
for reliability and data integrity. ACID-compliant, it supports foreign keys, joins,
|
||||||
|
views, triggers and stored procedures.
|
||||||
|
home: https://bitnami.com
|
||||||
|
icon: https://dyltqmyl993wv.cloudfront.net/assets/stacks/postgresql/img/postgresql-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- postgresql
|
||||||
|
- postgres
|
||||||
|
- database
|
||||||
|
- sql
|
||||||
|
- replication
|
||||||
|
- cluster
|
||||||
|
maintainers:
|
||||||
|
- name: Broadcom, Inc. All Rights Reserved.
|
||||||
|
url: https://github.com/bitnami/charts
|
||||||
|
name: postgresql
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
|
||||||
|
version: 18.1.4
|
||||||
1174
charts/semaphore/charts/postgresql/README.md
Normal file
1174
charts/semaphore/charts/postgresql/README.md
Normal file
File diff suppressed because it is too large
Load Diff
26
charts/semaphore/charts/postgresql/charts/common/.helmignore
Normal file
26
charts/semaphore/charts/postgresql/charts/common/.helmignore
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
|
# img folder
|
||||||
|
img/
|
||||||
|
# Changelog
|
||||||
|
CHANGELOG.md
|
||||||
25
charts/semaphore/charts/postgresql/charts/common/Chart.yaml
Normal file
25
charts/semaphore/charts/postgresql/charts/common/Chart.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
annotations:
|
||||||
|
fips: "true"
|
||||||
|
images: |
|
||||||
|
[]
|
||||||
|
licenses: Apache-2.0
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2.33.1
|
||||||
|
description: A Library Helm Chart for grouping common logic between bitnami charts.
|
||||||
|
This chart is not deployable by itself.
|
||||||
|
home: https://bitnami.com
|
||||||
|
icon: https://dyltqmyl993wv.cloudfront.net/downloads/logos/bitnami-mark.png
|
||||||
|
keywords:
|
||||||
|
- common
|
||||||
|
- helper
|
||||||
|
- template
|
||||||
|
- function
|
||||||
|
- bitnami
|
||||||
|
maintainers:
|
||||||
|
- name: Broadcom, Inc. All Rights Reserved.
|
||||||
|
url: https://github.com/bitnami/charts
|
||||||
|
name: common
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts/tree/main/bitnami/common
|
||||||
|
type: library
|
||||||
|
version: 2.33.1
|
||||||
395
charts/semaphore/charts/postgresql/charts/common/README.md
Normal file
395
charts/semaphore/charts/postgresql/charts/common/README.md
Normal file
@ -0,0 +1,395 @@
|
|||||||
|
<!--- app-name: Common -->
|
||||||
|
|
||||||
|
# Common library for Bitnami packages
|
||||||
|
|
||||||
|
A Library Helm Chart for grouping common logic between bitnami charts. This chart is not deployable by itself.
|
||||||
|
|
||||||
|
[Overview of Common](https://github.com/bitnami/charts/tree/main/bitnami/common)
|
||||||
|
|
||||||
|
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
version: 2.x.x
|
||||||
|
repository: oci://MY-OCI-REGISTRY
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm dependency update
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
data:
|
||||||
|
myvalue: "Hello World"
|
||||||
|
```
|
||||||
|
|
||||||
|
Looking to use our applications in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the commercial edition of the Bitnami catalog.
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.23+
|
||||||
|
- Helm 3.8.0+
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following table lists the helpers available in the library which are scoped in different sections.
|
||||||
|
|
||||||
|
### Affinities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------ |
|
||||||
|
| `common.affinities.nodes.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.nodes.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.nodes` | Return a nodeAffinity definition | `dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
| `common.affinities.topologyKey` | Return a topologyKey definition | `dict "topologyKey" "FOO"` |
|
||||||
|
| `common.affinities.pods.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
| `common.affinities.pods.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||||
|
| `common.affinities.pods` | Return a podAffinity/podAntiAffinity definition | `dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||||
|
|
||||||
|
### Capabilities
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------- |
|
||||||
|
| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context |
|
||||||
|
| `common.capabilities.apiVersions.has` | Return true if the apiVersion is supported | `dict "version" "batch/v1" "context" $` |
|
||||||
|
| `common.capabilities.job.apiVersion` | Return the appropriate apiVersion for job. | `.` Chart context |
|
||||||
|
| `common.capabilities.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` Chart context |
|
||||||
|
| `common.capabilities.daemonset.apiVersion` | Return the appropriate apiVersion for daemonset. | `.` Chart context |
|
||||||
|
| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context |
|
||||||
|
| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context |
|
||||||
|
| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context |
|
||||||
|
| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context |
|
||||||
|
| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context |
|
||||||
|
| `common.capabilities.policy.apiVersion` | Return the appropriate apiVersion for podsecuritypolicy. | `.` Chart context |
|
||||||
|
| `common.capabilities.networkPolicy.apiVersion` | Return the appropriate apiVersion for networkpolicy. | `.` Chart context |
|
||||||
|
| `common.capabilities.apiService.apiVersion` | Return the appropriate apiVersion for APIService. | `.` Chart context |
|
||||||
|
| `common.capabilities.hpa.apiVersion` | Return the appropriate apiVersion for Horizontal Pod Autoscaler | `.` Chart context |
|
||||||
|
| `common.capabilities.vpa.apiVersion` | Return the appropriate apiVersion for Vertical Pod Autoscaler. | `.` Chart context |
|
||||||
|
| `common.capabilities.psp.supported` | Returns true if PodSecurityPolicy is supported | `.` Chart context |
|
||||||
|
| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context |
|
||||||
|
| `common.capabilities.admissionConfiguration.supported` | Returns true if AdmissionConfiguration is supported | `.` Chart context |
|
||||||
|
| `common.capabilities.admissionConfiguration.apiVersion` | Return the appropriate apiVersion for AdmissionConfiguration. | `.` Chart context |
|
||||||
|
| `common.capabilities.podSecurityConfiguration.apiVersion` | Return the appropriate apiVersion for PodSecurityConfiguration. | `.` Chart context |
|
||||||
|
|
||||||
|
### Certificates
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.certs.sans`| Returns a space-separated list of Subject Alternative Names (SANs) to create a TLS certificate | `dict "namespace" "default" "clusterDomain" "cluster.local" "serviceName" "my-service" "headlessServiceName" "my-service-headless"` |
|
||||||
|
|
||||||
|
### Compatibility
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||||
|
| `common.compatibility.isOpenshift` | Return true if the detected platform is Openshift | `.` Chart context |
|
||||||
|
| `common.compatibility.renderSecurityContext` | 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 | `dict "secContext" .Values.containerSecurityContext "context" $` |
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||||
|
| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` |
|
||||||
|
| `common.errors.insecureImages` | Throw error when original container images are replaced. The error can be bypassed by setting the `global.security.allowInsecureImages` to true. | `dict "images" (list .Values.path.to.the.imageRoot) "context" $` |
|
||||||
|
|
||||||
|
### Images
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` |
|
||||||
|
| `common.images.renderPullSecrets` | Return the proper Docker Image Registry Secret Names (evaluates values as templates) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $` |
|
||||||
|
| `common.images.version` | Return the proper image version | `dict "imageRoot" .Values.path.to.the.image "chart" .Chart` , see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
|
||||||
|
### Ingress
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences |
|
||||||
|
| `common.ingress.certManagerRequest` | Prints "true" if required cert-manager annotations for TLS signed certificates are set in the Ingress annotations | `dict "annotations" .Values.path.to.the.ingress.annotations` |
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------- | --------------------------------------------------------------------------- | ----------------- |
|
||||||
|
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
|
||||||
|
| `common.labels.matchLabels` | Labels to use on `deploy.spec.selector.matchLabels` and `svc.spec.selector` | `.` Chart context |
|
||||||
|
|
||||||
|
### Names
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ---------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
|
||||||
|
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
|
||||||
|
| `common.names.namespace` | Allow the release namespace to be overridden | `.` Chart context |
|
||||||
|
| `common.names.fullname.namespace` | Create a fully qualified app name adding the installation's namespace | `.` Chart context |
|
||||||
|
| `common.names.chart` | Chart name plus version | `.` Chart context |
|
||||||
|
| `common.names.dependency.fullname` | Create a default fully qualified dependency name. | `dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $` |
|
||||||
|
|
||||||
|
### Resources
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
||||||
|
| `common.resources.preset` | 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. | `dict "type" "nano"` |
|
||||||
|
|
||||||
|
### Secrets
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. |
|
||||||
|
| `common.secrets.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "honorProvidedValues" false "context" $`, length, strong, honorProvidedValues and chartName fields are optional. |
|
||||||
|
| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` |
|
||||||
|
| `common.secrets.lookup` | Reuses the value from an existing secret, otherwise sets its value to a default value. | `dict "secret" "secret-name" "key" "keyName" "defaultValue" .Values.myValue "context" $` |
|
||||||
|
|
||||||
|
### Storage
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ---------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.storage.class` | Return the proper Storage Class | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. |
|
||||||
|
|
||||||
|
### TplValues
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ---------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` |
|
||||||
|
| `common.tplvalues.merge` | Merge a list of values that contains template after rendering them. | `dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $` |
|
||||||
|
| `common.tplvalues.merge-overwrite` | Merge a list of values that contains template after rendering them. | `dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $` |
|
||||||
|
|
||||||
|
### Utils
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
||||||
|
| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` |
|
||||||
|
| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` |
|
||||||
|
| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` |
|
||||||
|
| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` |
|
||||||
|
| `common.utils.checksumTemplate` | Checksum a template at "path" containing a *single* resource (ConfigMap,Secret) for use in pod annotations, excluding the metadata (see #18376) | `dict "path" "/configmap.yaml" "context" $` |
|
||||||
|
|
||||||
|
### Validations
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) |
|
||||||
|
| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. |
|
||||||
|
|
||||||
|
### Warnings
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| -------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
|
| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.warnings.modifiedImages` | Warning about replaced images from the original. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||||
|
| `common.warnings.resources` | Warning about not setting the resource object in all deployments. | `dict "sections" (list "path1" "path2") context $` |
|
||||||
|
|
||||||
|
### FIPS
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
| -------------------- | ------------------- | ------------------------------------------------------------------------------- |
|
||||||
|
| `common.fips.enabled` | Enable FIPS mode | `.` Chart context |
|
||||||
|
| `common.fips.config` | Configure FIPS mode | `dict "tech" "openssl|java|golang" "fips" .Values.fips "global" .Values.global` |
|
||||||
|
|
||||||
|
## Special input schemas
|
||||||
|
|
||||||
|
### ImageRoot
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
registry:
|
||||||
|
type: string
|
||||||
|
description: Docker registry where the image is located
|
||||||
|
example: docker.io
|
||||||
|
|
||||||
|
repository:
|
||||||
|
type: string
|
||||||
|
description: Repository and image name
|
||||||
|
example: bitnami/nginx
|
||||||
|
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
description: image tag
|
||||||
|
example: 1.16.1-debian-10-r63
|
||||||
|
|
||||||
|
pullPolicy:
|
||||||
|
type: string
|
||||||
|
description: Specify a imagePullPolicy.'
|
||||||
|
|
||||||
|
pullSecrets:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: Optionally specify an array of imagePullSecrets (evaluated as templates).
|
||||||
|
|
||||||
|
debug:
|
||||||
|
type: boolean
|
||||||
|
description: Set to true if you would like to see extra information on logs
|
||||||
|
example: false
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# registry: docker.io
|
||||||
|
# repository: bitnami/nginx
|
||||||
|
# tag: 1.16.1-debian-10-r63
|
||||||
|
# pullPolicy: IfNotPresent
|
||||||
|
# debug: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Persistence
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Whether enable persistence.
|
||||||
|
example: true
|
||||||
|
|
||||||
|
storageClass:
|
||||||
|
type: string
|
||||||
|
description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
|
||||||
|
example: "-"
|
||||||
|
|
||||||
|
accessMode:
|
||||||
|
type: string
|
||||||
|
description: Access mode for the Persistent Volume Storage.
|
||||||
|
example: ReadWriteOnce
|
||||||
|
|
||||||
|
size:
|
||||||
|
type: string
|
||||||
|
description: Size the Persistent Volume Storage.
|
||||||
|
example: 8Gi
|
||||||
|
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
|
description: Path to be persisted.
|
||||||
|
example: /bitnami
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# enabled: true
|
||||||
|
# storageClass: "-"
|
||||||
|
# accessMode: ReadWriteOnce
|
||||||
|
# size: 8Gi
|
||||||
|
# path: /bitnami
|
||||||
|
```
|
||||||
|
|
||||||
|
### ExistingSecret
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Name of the existing secret.
|
||||||
|
example: mySecret
|
||||||
|
keyMapping:
|
||||||
|
description: Mapping between the expected key name and the name of the key in the existing secret.
|
||||||
|
type: object
|
||||||
|
|
||||||
|
## An instance would be:
|
||||||
|
# name: mySecret
|
||||||
|
# keyMapping:
|
||||||
|
# password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example of use
|
||||||
|
|
||||||
|
When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# templates/secret.yaml
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ include "common.names.fullname" . }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
password: {{ .Values.password | b64enc | quote }}
|
||||||
|
|
||||||
|
# templates/dpl.yaml
|
||||||
|
---
|
||||||
|
...
|
||||||
|
env:
|
||||||
|
- name: PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
|
||||||
|
key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
|
||||||
|
...
|
||||||
|
|
||||||
|
# values.yaml
|
||||||
|
---
|
||||||
|
name: mySecret
|
||||||
|
keyMapping:
|
||||||
|
password: myPasswordKey
|
||||||
|
```
|
||||||
|
|
||||||
|
### ValidateValue
|
||||||
|
|
||||||
|
#### NOTES.txt
|
||||||
|
|
||||||
|
```console
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
|
||||||
|
{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
```
|
||||||
|
|
||||||
|
If we force those values to be empty we will see some alerts
|
||||||
|
|
||||||
|
```console
|
||||||
|
helm install test mychart --set path.to.value00="",path.to.value01=""
|
||||||
|
'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 -d)
|
||||||
|
|
||||||
|
'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
|
||||||
|
|
||||||
|
export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 -d)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
### To 1.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.
|
||||||
|
|
||||||
|
#### What changes were introduced in this major version?
|
||||||
|
|
||||||
|
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||||
|
- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
|
||||||
|
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||||
|
|
||||||
|
#### Considerations when upgrading to this version
|
||||||
|
|
||||||
|
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||||
|
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||||
|
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||||
|
|
||||||
|
#### Useful links
|
||||||
|
|
||||||
|
- <https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-resolve-helm2-helm3-post-migration-issues-index.html>
|
||||||
|
- <https://helm.sh/docs/topics/v2_v3_migration/>
|
||||||
|
- <https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Copyright © 2025 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
@ -0,0 +1,169 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.soft" -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
weight: 1
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes.hard" -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: {{ .key }}
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
{{- range .values }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a nodeAffinity definition
|
||||||
|
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.nodes" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.nodes.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.nodes.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a topologyKey definition
|
||||||
|
{{ include "common.affinities.topologyKey" (dict "topologyKey" "BAR") -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.topologyKey" -}}
|
||||||
|
{{ .topologyKey | default "kubernetes.io/hostname" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a soft podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "customLabels" .Values.podLabels "extraMatchLabels" .Values.extraMatchLabels "topologyKey" "BAR" "extraPodAffinityTerms" .Values.extraPodAffinityTerms "extraNamespaces" (list "namespace1" "namespace2") "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.soft" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
{{- $customLabels := default (dict) .customLabels -}}
|
||||||
|
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
|
||||||
|
{{- $extraPodAffinityTerms := default (list) .extraPodAffinityTerms -}}
|
||||||
|
{{- $extraNamespaces := default (list) .extraNamespaces -}}
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" .context )) | nindent 10 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := $extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $extraNamespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace }}
|
||||||
|
{{- with $extraNamespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
weight: 1
|
||||||
|
{{- range $extraPodAffinityTerms }}
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" $.context )) | nindent 10 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := .extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .namespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ $.context.Release.Namespace }}
|
||||||
|
{{- with .namespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
weight: {{ .weight | default 1 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a hard podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "customLabels" .Values.podLabels "extraMatchLabels" .Values.extraMatchLabels "topologyKey" "BAR" "extraPodAffinityTerms" .Values.extraPodAffinityTerms "extraNamespaces" (list "namespace1" "namespace2") "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods.hard" -}}
|
||||||
|
{{- $component := default "" .component -}}
|
||||||
|
{{- $customLabels := default (dict) .customLabels -}}
|
||||||
|
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
|
||||||
|
{{- $extraPodAffinityTerms := default (list) .extraPodAffinityTerms -}}
|
||||||
|
{{- $extraNamespaces := default (list) .extraNamespaces -}}
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" .context )) | nindent 8 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := $extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $extraNamespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ .context.Release.Namespace }}
|
||||||
|
{{- with $extraNamespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
{{- range $extraPodAffinityTerms }}
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels: {{- (include "common.labels.matchLabels" ( dict "customLabels" $customLabels "context" $.context )) | nindent 8 }}
|
||||||
|
{{- if not (empty $component) }}
|
||||||
|
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := .extraMatchLabels }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .namespaces }}
|
||||||
|
namespaces:
|
||||||
|
- {{ $.context.Release.Namespace }}
|
||||||
|
{{- with .namespaces }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
topologyKey: {{ include "common.affinities.topologyKey" (dict "topologyKey" .topologyKey) }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return a podAffinity/podAntiAffinity definition
|
||||||
|
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.affinities.pods" -}}
|
||||||
|
{{- if eq .type "soft" }}
|
||||||
|
{{- include "common.affinities.pods.soft" . -}}
|
||||||
|
{{- else if eq .type "hard" }}
|
||||||
|
{{- include "common.affinities.pods.hard" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,178 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the target Kubernetes version
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.kubeVersion" -}}
|
||||||
|
{{- default (default .Capabilities.KubeVersion.Version .Values.kubeVersion) ((.Values.global).kubeVersion) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if the apiVersion is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.capabilities.apiVersions.has" (dict "version" "batch/v1" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.apiVersions.has" -}}
|
||||||
|
{{- $providedAPIVersions := default .context.Values.apiVersions ((.context.Values.global).apiVersions) -}}
|
||||||
|
{{- if and (empty $providedAPIVersions) (.context.Capabilities.APIVersions.Has .version) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else if has .version $providedAPIVersions -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for poddisruptionbudget.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.policy.apiVersion" -}}
|
||||||
|
{{- print "policy/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for networkpolicy.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.networkPolicy.apiVersion" -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for job.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.job.apiVersion" -}}
|
||||||
|
{{- print "batch/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for cronjob.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.cronjob.apiVersion" -}}
|
||||||
|
{{- print "batch/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for daemonset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.daemonset.apiVersion" -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for deployment.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.deployment.apiVersion" -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for statefulset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.statefulset.apiVersion" -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for ingress.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for RBAC resources.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.rbac.apiVersion" -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for CRDs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.crd.apiVersion" -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for APIService.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.apiService.apiVersion" -}}
|
||||||
|
{{- print "apiregistration.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for Horizontal Pod Autoscaler.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.hpa.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" .context -}}
|
||||||
|
{{- print "autoscaling/v2" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for Vertical Pod Autoscaler.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.vpa.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- print "autoscaling/v1beta2" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "autoscaling/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if PodSecurityPolicy is supported
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.psp.supported" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if or (empty $kubeVersion) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if AdmissionConfiguration is supported
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.admissionConfiguration.supported" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for AdmissionConfiguration.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.admissionConfiguration.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- print "apiserver.config.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apiserver.config.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for PodSecurityConfiguration.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.podSecurityConfiguration.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
|
||||||
|
{{- print "pod-security.admission.config.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "pod-security.admission.config.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if the used Helm version is 3.3+.
|
||||||
|
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
|
||||||
|
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
|
||||||
|
**To be removed when the catalog's minimun Helm version is 3.3**
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.supportsHelmVersion" -}}
|
||||||
|
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns a space-separated list of Subject Alternative Names (SANs) to create a TLS certificate
|
||||||
|
Usage:
|
||||||
|
{{ include "common.certs.sans" (dict "namespace" "default" "clusterDomain" "cluster.local" "serviceName" "my-service" "headlessServiceName" "my-service-headless" "loopback" true "extraSANs" (list "custom.domain.com")) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- namespace - String - Required - Namespace where the app which we are generating the certificate for is deployed.
|
||||||
|
- clusterDomain - String - Optional - Cluster domain. Default is "cluster.local".
|
||||||
|
- serviceName - String - Optional - App service name. If provided, the following SANs will be generated:
|
||||||
|
- serviceName.namespace.svc.clusterDomain
|
||||||
|
- serviceName.namespace.svc
|
||||||
|
- serviceName.namespace
|
||||||
|
- serviceName
|
||||||
|
- headlessServiceName - String - Optional - App headless service name. If provided, the following wildcard SANs will be generated:
|
||||||
|
- *.headlessServiceName.namespace.svc.clusterDomain
|
||||||
|
- *.headlessServiceName.namespace.svc
|
||||||
|
- *.headlessServiceName.namespace
|
||||||
|
- *.headlessServiceName
|
||||||
|
- extraSANs - List<String> - Optional - Additional custom SANs to be added.
|
||||||
|
- loopback - Boolean - Optional - If true, "localhost" will be added to the SANs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.certs.sans" -}}
|
||||||
|
{{- $sans := list }}
|
||||||
|
{{- if .serviceName -}}
|
||||||
|
{{- $sans = append $sans (printf "%s.%s.svc.%s" .serviceName .namespace (default "cluster.local" .clusterDomain)) -}}
|
||||||
|
{{- $sans = append $sans (printf "%s.%s.svc" .serviceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans (printf "%s.%s" .serviceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans .serviceName -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .headlessServiceName -}}
|
||||||
|
{{- /* Include wildcard SANs for headless service */ -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s.%s.svc.%s" .headlessServiceName .namespace (default "cluster.local" .clusterDomain)) -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s.%s.svc" .headlessServiceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s.%s" .headlessServiceName .namespace) -}}
|
||||||
|
{{- $sans = append $sans (printf "*.%s" .headlessServiceName) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- range .extraSANs }}
|
||||||
|
{{- $sans = append $sans . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if (default false .loopback) -}}
|
||||||
|
{{- $sans = append $sans "localhost" }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- join " " $sans | trim -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{/*
|
||||||
|
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 empty seLinuxOptions object if global.compatibility.omitEmptySeLinuxOptions is set to true */}}
|
||||||
|
{{- if and (((.context.Values.global).compatibility).omitEmptySeLinuxOptions) (not .secContext.seLinuxOptions) -}}
|
||||||
|
{{- $adaptedContext = omit $adaptedContext "seLinuxOptions" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{/* Remove fields that are disregarded when running the container in privileged mode */}}
|
||||||
|
{{- if $adaptedContext.privileged -}}
|
||||||
|
{{- $adaptedContext = omit $adaptedContext "capabilities" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- omit $adaptedContext "enabled" | toYaml -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Throw error when upgrading using empty passwords values that must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
|
||||||
|
|
||||||
|
Required password params:
|
||||||
|
- validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
|
||||||
|
- context - Context - Required. Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.errors.upgrade.passwords.empty" -}}
|
||||||
|
{{- $validationErrors := join "" .validationErrors -}}
|
||||||
|
{{- if and $validationErrors .context.Release.IsUpgrade -}}
|
||||||
|
{{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}}
|
||||||
|
{{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}}
|
||||||
|
{{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}}
|
||||||
|
{{- $errorString = print $errorString "\n%s" -}}
|
||||||
|
{{- printf $errorString $validationErrors | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Throw error when original container images are replaced.
|
||||||
|
The error can be bypassed by setting the "global.security.allowInsecureImages" to true. In this case,
|
||||||
|
a warning message will be shown instead.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.errors.insecureImages" (dict "images" (list .Values.path.to.the.imageRoot) "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.errors.insecureImages" -}}
|
||||||
|
{{- $relocatedImages := list -}}
|
||||||
|
{{- $replacedImages := list -}}
|
||||||
|
{{- $bitnamiLegacyImages := list -}}
|
||||||
|
{{- $retaggedImages := list -}}
|
||||||
|
{{- $globalRegistry := ((.context.Values.global).imageRegistry) -}}
|
||||||
|
{{- $originalImages := .context.Chart.Annotations.images -}}
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- $registryName := default .registry $globalRegistry -}}
|
||||||
|
{{- $fullImageNameNoTag := printf "%s/%s" $registryName .repository -}}
|
||||||
|
{{- $fullImageName := printf "%s:%s" $fullImageNameNoTag .tag -}}
|
||||||
|
{{- if not (contains $fullImageNameNoTag $originalImages) -}}
|
||||||
|
{{- if not (contains $registryName $originalImages) -}}
|
||||||
|
{{- $relocatedImages = append $relocatedImages $fullImageName -}}
|
||||||
|
{{- else if not (contains .repository $originalImages) -}}
|
||||||
|
{{- $replacedImages = append $replacedImages $fullImageName -}}
|
||||||
|
{{- if contains "docker.io/bitnamilegacy/" $fullImageNameNoTag -}}
|
||||||
|
{{- $bitnamiLegacyImages = append $bitnamiLegacyImages $fullImageName -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (contains (printf "%s:%s" .repository .tag) $originalImages) -}}
|
||||||
|
{{- $retaggedImages = append $retaggedImages $fullImageName -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if and (or (gt (len $relocatedImages) 0) (gt (len $replacedImages) 0)) (((.context.Values.global).security).allowInsecureImages) -}}
|
||||||
|
{{- print "\n\n⚠ SECURITY WARNING: Verifying original container images was skipped. Please note this Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Bitnami Secure Images containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables.\n" -}}
|
||||||
|
{{- else if (or (gt (len $relocatedImages) 0) (gt (len $replacedImages) 0)) -}}
|
||||||
|
{{- $errorString := "Original containers have been substituted for unrecognized ones. Deploying this chart with non-standard containers is likely to cause degraded security and performance, broken chart features, and missing environment variables." -}}
|
||||||
|
{{- $errorString = print $errorString "\n\nUnrecognized images:" -}}
|
||||||
|
{{- range (concat $relocatedImages $replacedImages) -}}
|
||||||
|
{{- $errorString = print $errorString "\n - " . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if and (eq (len $relocatedImages) 0) (eq (len $replacedImages) (len $bitnamiLegacyImages)) -}}
|
||||||
|
{{- $errorString = print "\n\n⚠ WARNING: " $errorString -}}
|
||||||
|
{{- print $errorString -}}
|
||||||
|
{{- else if or (contains "docker.io/bitnami/" $originalImages) (contains "docker.io/bitnamiprem/" $originalImages) (contains "docker.io/bitnamisecure/" $originalImages) -}}
|
||||||
|
{{- $errorString = print "\n\n⚠ ERROR: " $errorString -}}
|
||||||
|
{{- $errorString = print $errorString "\n\nIf you are sure you want to proceed with non-standard containers, you can skip container image verification by setting the global parameter 'global.security.allowInsecureImages' to true." -}}
|
||||||
|
{{- $errorString = print $errorString "\nFurther information can be obtained at https://github.com/bitnami/charts/issues/30850" -}}
|
||||||
|
{{- print $errorString | fail -}}
|
||||||
|
{{- else if gt (len $replacedImages) 0 -}}
|
||||||
|
{{- $errorString = print "\n\n⚠ WARNING: " $errorString -}}
|
||||||
|
{{- print $errorString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if gt (len $retaggedImages) 0 -}}
|
||||||
|
{{- $warnString := "\n\n⚠ WARNING: Original containers have been retagged. Please note this Helm chart was tested, and validated on multiple platforms using a specific set of Bitnami and Bitnami Secure Images containers. Substituting original image tags could cause unexpected behavior." -}}
|
||||||
|
{{- $warnString = print $warnString "\n\nRetagged images:" -}}
|
||||||
|
{{- range $retaggedImages -}}
|
||||||
|
{{- $warnString = print $warnString "\n - " . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- print $warnString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Enable FIPS features
|
||||||
|
{{ include "common.fips.enabled" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.enabled" -}}
|
||||||
|
{{- $fips := .Chart.Annotations.fips -}}
|
||||||
|
{{- if eq "true" $fips -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get FIPS environment variable value for the given tech
|
||||||
|
{{ include "common.fips.config" (dict "tech" "openssl|java|golang" "fips" .Values.fips "global" .Values.global) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.config" -}}
|
||||||
|
{{- $availableTechs := list "openssl" "java" "golang" -}}
|
||||||
|
{{- if not (has .tech $availableTechs) -}}
|
||||||
|
{{- printf "The common.fips.config method can only provide configuration for: %s" $availableTechs | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $tech := get (.fips) .tech -}}
|
||||||
|
{{- $value := $tech | default (.global).defaultFips -}}
|
||||||
|
{{- if empty $value -}}
|
||||||
|
{{- printf "Please configure a value for 'fips.%s' or 'global.defaultFips'" .tech | fail -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $method := printf "common.fips.%s" .tech -}}
|
||||||
|
{{- include $method (dict "value" $value) | trim | print -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Map OpenSSL values for FIPS configuration
|
||||||
|
{{ include "common.fips.openssl" (dict "value" "restricted") }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.openssl" -}}
|
||||||
|
{{- ternary "yes" "no" (eq .value "restricted") | print -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Map JAVA values for FIPS configuration
|
||||||
|
{{ include "common.fips.java" (dict "value" "restricted") }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.java" -}}
|
||||||
|
{{- $suffix := ternary "original" .value (eq .value "off") -}}
|
||||||
|
{{- $javaSecurityFile := printf "java.security.%s" $suffix -}}
|
||||||
|
{{/* The two equals signs mean the property file will completely override the master properties file */}}
|
||||||
|
{{- $javaSecurityOpt := printf "-Djava.security.properties==/opt/bitnami/java/conf/security/%s" $javaSecurityFile -}}
|
||||||
|
{{- $bcModulesFlag := "--module-path=/opt/bitnami/bc-fips/" -}}
|
||||||
|
{{- $restrictedFlags := printf "%s %s" $bcModulesFlag $javaSecurityOpt -}}
|
||||||
|
|
||||||
|
{{- ternary $restrictedFlags $javaSecurityOpt (eq .value "restricted") | print -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Map Golang values for FIPS configuration
|
||||||
|
{{ include "common.fips.golang" (dict "value" "restricted") }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.fips.golang" -}}
|
||||||
|
{{- if eq .value "restricted" -}}
|
||||||
|
{{- print "fips140=only" -}}
|
||||||
|
{{- else if eq .value "relaxed" -}}
|
||||||
|
{{- print "fips140=on" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "fips140=off" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Return the proper image name.
|
||||||
|
If image tag and digest are not defined, termination fallbacks to chart appVersion.
|
||||||
|
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" .Values.global "chart" .Chart ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.image" -}}
|
||||||
|
{{- $registryName := default .imageRoot.registry ((.global).imageRegistry) -}}
|
||||||
|
{{- $repositoryName := .imageRoot.repository -}}
|
||||||
|
{{- $separator := ":" -}}
|
||||||
|
{{- $termination := .imageRoot.tag | toString -}}
|
||||||
|
|
||||||
|
{{- if not .imageRoot.tag }}
|
||||||
|
{{- if .chart }}
|
||||||
|
{{- $termination = .chart.AppVersion | toString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .imageRoot.digest }}
|
||||||
|
{{- $separator = "@" -}}
|
||||||
|
{{- $termination = .imageRoot.digest | toString -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $registryName }}
|
||||||
|
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s%s%s" $repositoryName $separator $termination -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
|
||||||
|
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.pullSecrets" -}}
|
||||||
|
{{- $pullSecrets := list }}
|
||||||
|
|
||||||
|
{{- range ((.global).imagePullSecrets) -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets .name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- range .pullSecrets -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets .name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (not (empty $pullSecrets)) -}}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- range $pullSecrets | uniq }}
|
||||||
|
- name: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names evaluating values as templates
|
||||||
|
{{ include "common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.renderPullSecrets" -}}
|
||||||
|
{{- $pullSecrets := list }}
|
||||||
|
{{- $context := .context }}
|
||||||
|
|
||||||
|
{{- range (($context.Values.global).imagePullSecrets) -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" .name "context" $context)) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- range .pullSecrets -}}
|
||||||
|
{{- if kindIs "map" . -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" .name "context" $context)) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (not (empty $pullSecrets)) -}}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- range $pullSecrets | uniq }}
|
||||||
|
- name: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper image version (ingores image revision/prerelease info & fallbacks to chart appVersion)
|
||||||
|
{{ include "common.images.version" ( dict "imageRoot" .Values.path.to.the.image "chart" .Chart ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.images.version" -}}
|
||||||
|
{{- $imageTag := .imageRoot.tag | toString -}}
|
||||||
|
{{/* regexp from https://github.com/Masterminds/semver/blob/23f51de38a0866c5ef0bfc42b3f735c73107b700/version.go#L41-L44 */}}
|
||||||
|
{{- if regexMatch `^([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?$` $imageTag -}}
|
||||||
|
{{- $version := semver $imageTag -}}
|
||||||
|
{{- printf "%d.%d.%d" $version.Major $version.Minor $version.Patch -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print .chart.AppVersion -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate backend entry that is compatible with all Kubernetes API versions.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- serviceName - String. Name of an existing service backend
|
||||||
|
- servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.backend" -}}
|
||||||
|
service:
|
||||||
|
name: {{ .serviceName }}
|
||||||
|
port:
|
||||||
|
{{- if typeIs "string" .servicePort }}
|
||||||
|
name: {{ .servicePort }}
|
||||||
|
{{- else if or (typeIs "int" .servicePort) (typeIs "float64" .servicePort) }}
|
||||||
|
number: {{ .servicePort | int }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if cert-manager required annotations for TLS signed
|
||||||
|
certificates are set in the Ingress annotations
|
||||||
|
Ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.certManagerRequest" ( dict "annotations" .Values.path.to.the.ingress.annotations ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.certManagerRequest" -}}
|
||||||
|
{{ if or (hasKey .annotations "cert-manager.io/cluster-issuer") (hasKey .annotations "cert-manager.io/issuer") (hasKey .annotations "kubernetes.io/tls-acme") }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Kubernetes standard labels
|
||||||
|
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) -}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.standard" -}}
|
||||||
|
{{- if and (hasKey . "customLabels") (hasKey . "context") -}}
|
||||||
|
{{- $default := dict "app.kubernetes.io/name" (include "common.names.name" .context) "helm.sh/chart" (include "common.names.chart" .context) "app.kubernetes.io/instance" .context.Release.Name "app.kubernetes.io/managed-by" .context.Release.Service -}}
|
||||||
|
{{- with .context.Chart.AppVersion -}}
|
||||||
|
{{- $_ := set $default "app.kubernetes.io/version" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ template "common.tplvalues.merge" (dict "values" (list .customLabels $default) "context" .context) }}
|
||||||
|
{{- else -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- with .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ . | replace "+" "_" | quote }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Labels used on immutable fields such as deploy.spec.selector.matchLabels or svc.spec.selector
|
||||||
|
{{ include "common.labels.matchLabels" (dict "customLabels" .Values.podLabels "context" $) -}}
|
||||||
|
|
||||||
|
We don't want to loop over custom labels appending them to the selector
|
||||||
|
since it's very likely that it will break deployments, services, etc.
|
||||||
|
However, it's important to overwrite the standard labels if the user
|
||||||
|
overwrote them on metadata.labels fields.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.labels.matchLabels" -}}
|
||||||
|
{{- if and (hasKey . "customLabels") (hasKey . "context") -}}
|
||||||
|
{{ merge (pick (include "common.tplvalues.render" (dict "value" .customLabels "context" .context) | fromYaml) "app.kubernetes.io/name" "app.kubernetes.io/instance") (dict "app.kubernetes.io/name" (include "common.names.name" .context) "app.kubernetes.io/instance" .context.Release.Name ) | toYaml }}
|
||||||
|
{{- else -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | 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).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride -}}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
|
{{- $releaseName := regexReplaceAll "(-?[^a-z\\d\\-])+-?" (lower .Release.Name) "-" -}}
|
||||||
|
{{- if contains $name $releaseName -}}
|
||||||
|
{{- $releaseName | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" $releaseName $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified dependency 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.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.dependency.fullname" -}}
|
||||||
|
{{- if .chartValues.fullnameOverride -}}
|
||||||
|
{{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .chartName .chartValues.nameOverride -}}
|
||||||
|
{{- if contains $name .context.Release.Name -}}
|
||||||
|
{{- .context.Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.namespace" -}}
|
||||||
|
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a fully qualified app name adding the installation's namespace.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname.namespace" -}}
|
||||||
|
{{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
@ -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 -}}
|
||||||
@ -0,0 +1,192 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Generate secret name.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/main/bitnami/common#existingsecret
|
||||||
|
- defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment.
|
||||||
|
- context - Dict - Required. The context for the template evaluation.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.name" -}}
|
||||||
|
{{- $name := (include "common.names.fullname" .context) -}}
|
||||||
|
|
||||||
|
{{- if .defaultNameSuffix -}}
|
||||||
|
{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .) -}}
|
||||||
|
{{- with .name -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret key.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||||
|
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||||
|
+info: https://github.com/bitnami/charts/tree/main/bitnami/common#existingsecret
|
||||||
|
- key - String - Required. Name of the key in the secret.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.key" -}}
|
||||||
|
{{- $key := .key -}}
|
||||||
|
|
||||||
|
{{- if .existingSecret -}}
|
||||||
|
{{- if not (typeIs "string" .existingSecret) -}}
|
||||||
|
{{- if .existingSecret.keyMapping -}}
|
||||||
|
{{- $key = index .existingSecret.keyMapping $.key -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Generate secret password or retrieve one if already created.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "honorProvidedValues" false "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- key - String - Required - Name of the key in the secret.
|
||||||
|
- providedValues - List<String> - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||||
|
- length - int - Optional - Length of the generated random password.
|
||||||
|
- strong - Boolean - Optional - Whether to add symbols to the generated random password.
|
||||||
|
- chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
- failOnNew - Boolean - Optional - Default to true. If set to false, skip errors adding new keys to existing secrets.
|
||||||
|
- skipB64enc - Boolean - Optional - Default to false. If set to true, no the secret will not be base64 encrypted.
|
||||||
|
- skipQuote - Boolean - Optional - Default to false. If set to true, no quotes will be added around the secret.
|
||||||
|
- honorProvidedValues - Boolean - Optional - Default to false. If set to true, the values in providedValues have higher priority than an existing secret
|
||||||
|
The order in which this function returns a secret password:
|
||||||
|
1. Password provided via the values.yaml if honorProvidedValues = true
|
||||||
|
(If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
|
||||||
|
2. Already existing 'Secret' resource
|
||||||
|
(If a 'Secret' resource is found under the name provided to the 'secret' parameter to this function and that 'Secret' resource contains a key with the name passed as the 'key' parameter to this function then the value of this existing secret password will be returned)
|
||||||
|
3. Password provided via the values.yaml if honorProvidedValues = false
|
||||||
|
(If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
|
||||||
|
4. Randomly generated secret password
|
||||||
|
(A new random secret password with the length specified in the 'length' parameter will be generated and returned)
|
||||||
|
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.passwords.manage" -}}
|
||||||
|
|
||||||
|
{{- $password := "" }}
|
||||||
|
{{- $subchart := "" }}
|
||||||
|
{{- $chartName := default "" .chartName }}
|
||||||
|
{{- $passwordLength := default 10 .length }}
|
||||||
|
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
||||||
|
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
||||||
|
{{- $secretData := (lookup "v1" "Secret" (include "common.names.namespace" .context) .secret).data }}
|
||||||
|
{{- if $secretData }}
|
||||||
|
{{- if hasKey $secretData .key }}
|
||||||
|
{{- $password = index $secretData .key | b64dec }}
|
||||||
|
{{- else if not (eq .failOnNew false) }}
|
||||||
|
{{- printf "\nPASSWORDS ERROR: The secret \"%s\" does not contain the key \"%s\"\n" .secret .key | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and $providedPasswordValue .honorProvidedValues }}
|
||||||
|
{{- $password = tpl ($providedPasswordValue | toString) .context }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if not $password }}
|
||||||
|
{{- if $providedPasswordValue }}
|
||||||
|
{{- $password = tpl ($providedPasswordValue | toString) .context }}
|
||||||
|
{{- else }}
|
||||||
|
{{- if .context.Values.enabled }}
|
||||||
|
{{- $subchart = $chartName }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not (eq .failOnNew false) }}
|
||||||
|
{{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}}
|
||||||
|
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
|
||||||
|
{{- $passwordValidationErrors := list $requiredPasswordError -}}
|
||||||
|
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .strong }}
|
||||||
|
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
|
||||||
|
{{- $password = randAscii $passwordLength }}
|
||||||
|
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
||||||
|
{{- $password = printf "%s%s" $subStr $password | toString | shuffle }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $password = randAlphaNum $passwordLength }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not .skipB64enc }}
|
||||||
|
{{- $password = $password | b64enc }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .skipQuote -}}
|
||||||
|
{{- printf "%s" $password -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" $password | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Reuses the value from an existing secret, otherwise sets its value to a default value.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.lookup" (dict "secret" "secret-name" "key" "keyName" "defaultValue" .Values.myValue "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- key - String - Required - Name of the key in the secret.
|
||||||
|
- defaultValue - String - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.lookup" -}}
|
||||||
|
{{- $value := "" -}}
|
||||||
|
{{- $secretData := (lookup "v1" "Secret" (include "common.names.namespace" .context) .secret).data -}}
|
||||||
|
{{- if and $secretData (hasKey $secretData .key) -}}
|
||||||
|
{{- $value = index $secretData .key -}}
|
||||||
|
{{- else if .defaultValue -}}
|
||||||
|
{{- $value = .defaultValue | toString | b64enc -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $value -}}
|
||||||
|
{{- printf "%s" $value -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns whether a previous generated secret already exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }}
|
||||||
|
|
||||||
|
Params:
|
||||||
|
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||||
|
- context - Context - Required - Parent context.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.exists" -}}
|
||||||
|
{{- $secret := (lookup "v1" "Secret" (include "common.names.namespace" .context) .secret) }}
|
||||||
|
{{- if $secret }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Storage Class
|
||||||
|
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.storage.class" -}}
|
||||||
|
{{- $storageClass := (.global).storageClass | default .persistence.storageClass | default (.global).defaultStorageClass | default "" -}}
|
||||||
|
{{- if $storageClass -}}
|
||||||
|
{{- if (eq "-" $storageClass) -}}
|
||||||
|
{{- printf "storageClassName: \"\"" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "storageClassName: %s" $storageClass -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Renders a value that contains template perhaps with scope if the scope is present.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
|
||||||
|
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.render" -}}
|
||||||
|
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
|
||||||
|
{{- if contains "{{" (toJson .value) }}
|
||||||
|
{{- if .scope }}
|
||||||
|
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
|
||||||
|
{{- else }}
|
||||||
|
{{- tpl $value .context }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Merge a list of values that contains template after rendering them.
|
||||||
|
Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.merge" -}}
|
||||||
|
{{- $dst := dict -}}
|
||||||
|
{{- range .values -}}
|
||||||
|
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ $dst | toYaml }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Merge a list of values that contains template after rendering them.
|
||||||
|
Merge precedence is consistent with https://masterminds.github.io/sprig/dicts.html#mergeoverwrite-mustmergeoverwrite
|
||||||
|
Usage:
|
||||||
|
{{ include "common.tplvalues.merge-overwrite" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.tplvalues.merge-overwrite" -}}
|
||||||
|
{{- $dst := dict -}}
|
||||||
|
{{- range .values -}}
|
||||||
|
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | mergeOverwrite $dst -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ $dst | toYaml }}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Print instructions to get a secret value.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.secret.getvalue" -}}
|
||||||
|
{{- $varname := include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
export {{ $varname }}=$(kubectl get secret --namespace {{ include "common.names.namespace" .context | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 -d)
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Build env var name given a field
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.fieldToEnvVar" -}}
|
||||||
|
{{- $fieldNameSplit := splitList "-" .field -}}
|
||||||
|
{{- $upperCaseFieldNameSplit := list -}}
|
||||||
|
|
||||||
|
{{- range $fieldNameSplit -}}
|
||||||
|
{{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ join "_" $upperCaseFieldNameSplit }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Gets a value from .Values given
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getValueFromKey" -}}
|
||||||
|
{{- $splitKey := splitList "." .key -}}
|
||||||
|
{{- $value := "" -}}
|
||||||
|
{{- $latestObj := $.context.Values -}}
|
||||||
|
{{- range $splitKey -}}
|
||||||
|
{{- if not $latestObj -}}
|
||||||
|
{{- printf "please review the entire path of '%s' exists in values" $.key | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $value = ( index $latestObj . ) -}}
|
||||||
|
{{- $latestObj = $value -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%v" (default "" $value) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns first .Values key with a defined value or first of the list if all non-defined
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.getKeyFromList" -}}
|
||||||
|
{{- $key := first .keys -}}
|
||||||
|
{{- $reverseKeys := reverse .keys }}
|
||||||
|
{{- range $reverseKeys }}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }}
|
||||||
|
{{- if $value -}}
|
||||||
|
{{- $key = . }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "%s" $key -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Checksum a template at "path" containing a *single* resource (ConfigMap,Secret) for use in pod annotations, excluding the metadata (see #18376).
|
||||||
|
Usage:
|
||||||
|
{{ include "common.utils.checksumTemplate" (dict "path" "/configmap.yaml" "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.utils.checksumTemplate" -}}
|
||||||
|
{{- $obj := include (print .context.Template.BasePath .path) .context | fromYaml -}}
|
||||||
|
{{ omit $obj "apiVersion" "kind" "metadata" | toYaml | sha256sum }}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,109 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Warning about using rolling tag.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.rollingTag" -}}
|
||||||
|
|
||||||
|
{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||||
|
WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||||
|
+info https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-understand-rolling-tags-containers-index.html
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Warning about replaced images from the original.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.modifiedImages" (dict "images" (list .Values.path.to.the.imageRoot) "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.modifiedImages" -}}
|
||||||
|
{{- $affectedImages := list -}}
|
||||||
|
{{- $printMessage := false -}}
|
||||||
|
{{- $originalImages := .context.Chart.Annotations.images -}}
|
||||||
|
{{- range .images -}}
|
||||||
|
{{- $fullImageName := printf (printf "%s/%s:%s" .registry .repository .tag) -}}
|
||||||
|
{{- if not (contains $fullImageName $originalImages) }}
|
||||||
|
{{- $affectedImages = append $affectedImages (printf "%s/%s:%s" .registry .repository .tag) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $printMessage }}
|
||||||
|
|
||||||
|
⚠ SECURITY WARNING: Original containers have been substituted. This Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Tanzu Application Catalog containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables.
|
||||||
|
|
||||||
|
Substituted images detected:
|
||||||
|
{{- range $affectedImages }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Warning about not setting the resource object in all deployments.
|
||||||
|
Usage:
|
||||||
|
{{ include "common.warnings.resources" (dict "sections" (list "path1" "path2") context $) }}
|
||||||
|
Example:
|
||||||
|
{{- include "common.warnings.resources" (dict "sections" (list "csiProvider.provider" "server" "volumePermissions" "") "context" $) }}
|
||||||
|
The list in the example assumes that the following values exist:
|
||||||
|
- csiProvider.provider.resources
|
||||||
|
- server.resources
|
||||||
|
- volumePermissions.resources
|
||||||
|
- resources
|
||||||
|
*/}}
|
||||||
|
{{- define "common.warnings.resources" -}}
|
||||||
|
{{- $values := .context.Values -}}
|
||||||
|
{{- $printMessage := false -}}
|
||||||
|
{{ $affectedSections := list -}}
|
||||||
|
{{- range .sections -}}
|
||||||
|
{{- if eq . "" -}}
|
||||||
|
{{/* Case where the resources section is at the root (one main deployment in the chart) */}}
|
||||||
|
{{- if not (index $values "resources") -}}
|
||||||
|
{{- $affectedSections = append $affectedSections "resources" -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{/* Case where the are multiple resources sections (more than one main deployment in the chart) */}}
|
||||||
|
{{- $keys := split "." . -}}
|
||||||
|
{{/* We iterate through the different levels until arriving to the resource section. Example: a.b.c.resources */}}
|
||||||
|
{{- $section := $values -}}
|
||||||
|
{{- range $keys -}}
|
||||||
|
{{- $section = index $section . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (index $section "resources") -}}
|
||||||
|
{{/* If the section has enabled=false or replicaCount=0, do not include it */}}
|
||||||
|
{{- if and (hasKey $section "enabled") -}}
|
||||||
|
{{- if index $section "enabled" -}}
|
||||||
|
{{/* enabled=true */}}
|
||||||
|
{{- $affectedSections = append $affectedSections (printf "%s.resources" .) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if and (hasKey $section "replicaCount") -}}
|
||||||
|
{{/* We need a casting to int because number 0 is not treated as an int by default */}}
|
||||||
|
{{- if (gt (index $section "replicaCount" | int) 0) -}}
|
||||||
|
{{/* replicaCount > 0 */}}
|
||||||
|
{{- $affectedSections = append $affectedSections (printf "%s.resources" .) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{/* Default case, add it to the affected sections */}}
|
||||||
|
{{- $affectedSections = append $affectedSections (printf "%s.resources" .) -}}
|
||||||
|
{{- $printMessage = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $printMessage }}
|
||||||
|
|
||||||
|
WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
|
||||||
|
{{- range $affectedSections }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.dbUser.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled cassandra.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.cassandra.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key dbUser
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.cassandra.values.key.dbUser" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
cassandra.dbUser
|
||||||
|
{{- else -}}
|
||||||
|
dbUser
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate MariaDB required passwords are not empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||||
|
Params:
|
||||||
|
- secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret"
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.mariadb.passwords" -}}
|
||||||
|
{{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}}
|
||||||
|
{{- $enabled := include "common.mariadb.values.enabled" . -}}
|
||||||
|
{{- $architecture := include "common.mariadb.values.architecture" . -}}
|
||||||
|
{{- $authPrefix := include "common.mariadb.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" "mariadb-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" "mariadb-password" -}}
|
||||||
|
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if (eq $architecture "replication") -}}
|
||||||
|
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-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.mariadb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mariadb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mariadb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mariadb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mariadb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mariadb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.auth.existingSecret" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.auth.existingSecret | quote -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.auth.existingSecret | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled mongodb.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.mongodb.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key auth
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.key.auth" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
mongodb.auth
|
||||||
|
{{- else -}}
|
||||||
|
auth
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for architecture
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.mongodb.values.architecture" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- .context.Values.mongodb.architecture -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .context.Values.architecture -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
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 -}}
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to decide whether evaluate global values.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- key - String - Required. Field to be evaluated within global, e.g: "existingSecret"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.use.global" -}}
|
||||||
|
{{- if .context.Values.global -}}
|
||||||
|
{{- if .context.Values.global.postgresql -}}
|
||||||
|
{{- index .context.Values.global.postgresql .key | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for existingSecret.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.existingSecret" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.existingSecret" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- default (.context.Values.existingSecret | quote) $globalValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled postgresql.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key postgressPassword.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.postgressPassword" -}}
|
||||||
|
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}}
|
||||||
|
|
||||||
|
{{- if not $globalValue -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.postgresqlPassword
|
||||||
|
{{- else -}}
|
||||||
|
postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
global.postgresql.postgresqlPassword
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled.replication.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.enabled.replication" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.postgresql.replication.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" .context.Values.replication.enabled -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for the key replication.password.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.postgresql.values.key.replicationPassword" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
postgresql.replication.password
|
||||||
|
{{- else -}}
|
||||||
|
replication.password
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right value for enabled redis.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.enabled" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.enabled" -}}
|
||||||
|
{{- if .subchart -}}
|
||||||
|
{{- printf "%v" .context.Values.redis.enabled -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Auxiliary function to get the right prefix path for the values
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }}
|
||||||
|
Params:
|
||||||
|
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.keys.prefix" -}}
|
||||||
|
{{- if .subchart -}}redis.{{- else -}}{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Checks whether the redis chart's includes the standarizations (version >= 14)
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.redis.values.standarized.version" (dict "context" $) }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.redis.values.standarized.version" -}}
|
||||||
|
|
||||||
|
{{- $standarizedAuth := printf "%s%s" (include "common.redis.values.keys.prefix" .) "auth" -}}
|
||||||
|
{{- $standarizedAuthValues := include "common.utils.getValueFromKey" (dict "key" $standarizedAuth "context" .context) }}
|
||||||
|
|
||||||
|
{{- if $standarizedAuthValues -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Validate values must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}}
|
||||||
|
{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}}
|
||||||
|
{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.multiple.empty" -}}
|
||||||
|
{{- range .required -}}
|
||||||
|
{{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate a value must not be empty.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }}
|
||||||
|
|
||||||
|
Validate value params:
|
||||||
|
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||||
|
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||||
|
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||||
|
- subchart - String - Optional - Name of the subchart that the validated password is part of.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.validations.values.single.empty" -}}
|
||||||
|
{{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }}
|
||||||
|
{{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }}
|
||||||
|
|
||||||
|
{{- if not $value -}}
|
||||||
|
{{- $varname := "my-value" -}}
|
||||||
|
{{- $getCurrentValue := "" -}}
|
||||||
|
{{- if and .secret .field -}}
|
||||||
|
{{- $varname = include "common.utils.fieldToEnvVar" . -}}
|
||||||
|
{{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
# Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
# SPDX-License-Identifier: APACHE-2.0
|
||||||
|
|
||||||
|
## bitnami/common
|
||||||
|
## It is required by CI/CD tools and processes.
|
||||||
|
## @skip exampleValue
|
||||||
|
##
|
||||||
|
exampleValue: common-chart
|
||||||
123
charts/semaphore/charts/postgresql/templates/NOTES.txt
Normal file
123
charts/semaphore/charts/postgresql/templates/NOTES.txt
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
{{- $releaseNamespace := include "common.names.namespace" . }}
|
||||||
|
CHART NAME: {{ .Chart.Name }}
|
||||||
|
CHART VERSION: {{ .Chart.Version }}
|
||||||
|
APP VERSION: {{ .Chart.AppVersion }}
|
||||||
|
|
||||||
|
⚠ WARNING: Since August 28th, 2025, only a limited subset of images/charts are available for free.
|
||||||
|
Subscribe to Bitnami Secure Images to receive continued support and security updates.
|
||||||
|
More info at https://bitnami.com and https://github.com/bitnami/containers/issues/83267
|
||||||
|
|
||||||
|
** Please be patient while the chart is being deployed **
|
||||||
|
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
|
||||||
|
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
|
||||||
|
|
||||||
|
Get the list of pods by executing:
|
||||||
|
|
||||||
|
kubectl get pods --namespace {{ $releaseNamespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||||
|
|
||||||
|
Access the pod you want to debug by executing
|
||||||
|
|
||||||
|
kubectl exec --namespace {{ $releaseNamespace }} -ti <NAME OF THE POD> -- /opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash
|
||||||
|
|
||||||
|
In order to replicate the container startup scripts execute this command:
|
||||||
|
|
||||||
|
/opt/bitnami/scripts/postgresql/entrypoint.sh /opt/bitnami/scripts/postgresql/run.sh
|
||||||
|
|
||||||
|
{{- else }}
|
||||||
|
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
{{- $postgresPassword := include "common.secrets.lookup" (dict "secret" (include "postgresql.v1.chart.fullname" .) "key" .Values.auth.secretKeys.adminPasswordKey "defaultValue" (ternary .Values.auth.postgresPassword .Values.auth.password (eq $customUser "postgres")) "context" $) -}}
|
||||||
|
{{- $authEnabled := and (not (or .Values.global.postgresql.auth.existingSecret .Values.auth.existingSecret)) (or $postgresPassword .Values.auth.enablePostgresUser (and (not (empty $customUser)) (ne $customUser "postgres"))) }}
|
||||||
|
{{- if not $authEnabled }}
|
||||||
|
|
||||||
|
WARNING: PostgreSQL has been configured without authentication, this is not recommended for production environments.
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
PostgreSQL can be accessed via port {{ include "postgresql.v1.service.port" . }} on the following DNS names from within your cluster:
|
||||||
|
|
||||||
|
{{ include "postgresql.v1.primary.fullname" . }}.{{ $releaseNamespace }}.svc.cluster.local - Read/Write connection
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
|
||||||
|
{{ include "postgresql.v1.readReplica.fullname" . }}.{{ $releaseNamespace }}.svc.cluster.local - Read only connection
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and (not (empty $customUser)) (ne $customUser "postgres") }}
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
|
||||||
|
To get the password for "postgres" run:
|
||||||
|
|
||||||
|
export POSTGRES_ADMIN_PASSWORD=$(kubectl get secret --namespace {{ $releaseNamespace }} {{ include "postgresql.v1.secretName" . }} -o jsonpath="{.data.{{include "postgresql.v1.adminPasswordKey" .}}}" | base64 -d)
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
To get the password for "{{ $customUser }}" run:
|
||||||
|
|
||||||
|
export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ $releaseNamespace }} {{ include "postgresql.v1.secretName" . }} -o jsonpath="{.data.{{include "postgresql.v1.userPasswordKey" .}}}" | base64 -d)
|
||||||
|
{{- else }}
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
|
||||||
|
To get the password for "{{ default "postgres" $customUser }}" run:
|
||||||
|
|
||||||
|
export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ $releaseNamespace }} {{ include "postgresql.v1.secretName" . }} -o jsonpath="{.data.{{ ternary "password" (include "postgresql.v1.adminPasswordKey" .) (and (not (empty $customUser)) (ne $customUser "postgres")) }}}" | base64 -d)
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
To connect to your database run the following command:
|
||||||
|
{{- if $authEnabled }}
|
||||||
|
|
||||||
|
kubectl run {{ include "postgresql.v1.chart.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ $releaseNamespace }} --image {{ include "postgresql.v1.image" . }} --env="PGPASSWORD=$POSTGRES_PASSWORD" \
|
||||||
|
--command -- psql --host {{ include "postgresql.v1.primary.fullname" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
|
||||||
|
{{- else }}
|
||||||
|
|
||||||
|
kubectl run {{ include "postgresql.v1.chart.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ $releaseNamespace }} --image {{ include "postgresql.v1.image" . }} \
|
||||||
|
--command -- psql --host {{ include "postgresql.v1.primary.fullname" . }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
> NOTE: If you access the container using bash, make sure that you execute "/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash" in order to avoid the error "psql: local user with ID {{ .Values.primary.containerSecurityContext.runAsUser }}} does not exist"
|
||||||
|
|
||||||
|
To connect to your database from outside the cluster execute the following commands:
|
||||||
|
|
||||||
|
{{- if contains "NodePort" .Values.primary.service.type }}
|
||||||
|
|
||||||
|
export NODE_IP=$(kubectl get nodes --namespace {{ $releaseNamespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||||
|
export NODE_PORT=$(kubectl get --namespace {{ $releaseNamespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "postgresql.v1.primary.fullname" . }})
|
||||||
|
{{- if $authEnabled }}
|
||||||
|
PGPASSWORD="$POSTGRES_PASSWORD" psql --host $NODE_IP --port $NODE_PORT -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
psql --host $NODE_IP --port $NODE_PORT -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if contains "LoadBalancer" .Values.primary.service.type }}
|
||||||
|
|
||||||
|
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||||
|
Watch the status with: 'kubectl get svc --namespace {{ $releaseNamespace }} -w {{ include "postgresql.v1.primary.fullname" . }}'
|
||||||
|
|
||||||
|
export SERVICE_IP=$(kubectl get svc --namespace {{ $releaseNamespace }} {{ include "postgresql.v1.primary.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
|
||||||
|
{{- if $authEnabled }}
|
||||||
|
PGPASSWORD="$POSTGRES_PASSWORD" psql --host $SERVICE_IP --port {{ include "postgresql.v1.service.port" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
psql --host $SERVICE_IP --port {{ include "postgresql.v1.service.port" . }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if contains "ClusterIP" .Values.primary.service.type }}
|
||||||
|
|
||||||
|
kubectl port-forward --namespace {{ $releaseNamespace }} svc/{{ include "postgresql.v1.primary.fullname" . }} {{ include "postgresql.v1.service.port" . }}:{{ include "postgresql.v1.service.port" . }} &
|
||||||
|
{{- if $authEnabled }}
|
||||||
|
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
|
||||||
|
{{- else }}
|
||||||
|
psql --host 127.0.0.1 -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
WARNING: The configured password will be ignored on new installation in case when previous PostgreSQL release was deleted through the helm command. In that case, old PVC will have an old password, and setting it through helm won't take effect. Deleting persistent volumes (PVs) will solve the issue.
|
||||||
|
|
||||||
|
{{- include "postgresql.v1.validateValues" . -}}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.image -}}
|
||||||
|
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
|
||||||
|
{{- include "common.warnings.resources" (dict "sections" (list "metrics" "primary" "readReplicas" "volumePermissions") "context" $) }}
|
||||||
|
{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.metrics.image) "context" $) }}
|
||||||
|
{{- include "common.errors.insecureImages" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.metrics.image) "context" $) }}
|
||||||
458
charts/semaphore/charts/postgresql/templates/_helpers.tpl
Normal file
458
charts/semaphore/charts/postgresql/templates/_helpers.tpl
Normal file
@ -0,0 +1,458 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a global name for the chart to use and parse with other naming functions
|
||||||
|
Please use instead of "common.names.fullname" to preserve support for .Values.global.postgresql.fullnameOverride
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.chart.fullname" -}}
|
||||||
|
{{- default (include "common.names.fullname" .) .Values.global.postgresql.fullnameOverride -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name for PostgreSQL Primary objects
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.primary.fullname" -}}
|
||||||
|
{{- $fullname := include "postgresql.v1.chart.fullname" . -}}
|
||||||
|
{{- ternary (printf "%s-%s" $fullname .Values.primary.name | trunc 63 | trimSuffix "-") $fullname (eq .Values.architecture "replication") -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name for PostgreSQL read-only replicas objects
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.readReplica.fullname" -}}
|
||||||
|
{{- printf "%s-%s" (include "postgresql.v1.chart.fullname" .) .Values.readReplicas.name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the default FQDN for PostgreSQL primary headless service
|
||||||
|
We truncate at 63 chars because of the DNS naming spec.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.primary.svc.headless" -}}
|
||||||
|
{{- printf "%s-hl" (include "postgresql.v1.primary.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the default FQDN for PostgreSQL read-only replicas headless service
|
||||||
|
We truncate at 63 chars because of the DNS naming spec.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.readReplica.svc.headless" -}}
|
||||||
|
{{- printf "%s-hl" (include "postgresql.v1.readReplica.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper PostgreSQL image name
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper PostgreSQL metrics image name
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.metrics.image" -}}
|
||||||
|
{{ 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 "postgresql.v1.volumePermissions.image" -}}
|
||||||
|
{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the proper Docker Image Registry Secret Names
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.imagePullSecrets" -}}
|
||||||
|
{{ include "common.images.renderPullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image) "context" $) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the name for a custom user to create
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.username" -}}
|
||||||
|
{{- if .Values.global.postgresql.auth.username -}}
|
||||||
|
{{- .Values.global.postgresql.auth.username -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Values.auth.username -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the name for a custom database to create
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.database" -}}
|
||||||
|
{{- if .Values.global.postgresql.auth.database -}}
|
||||||
|
{{- printf "%s" (tpl .Values.global.postgresql.auth.database $) -}}
|
||||||
|
{{- else if .Values.auth.database -}}
|
||||||
|
{{- printf "%s" (tpl .Values.auth.database $) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the password secret.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.secretName" -}}
|
||||||
|
{{- if .Values.global.postgresql.auth.existingSecret -}}
|
||||||
|
{{- printf "%s" (tpl .Values.global.postgresql.auth.existingSecret $) -}}
|
||||||
|
{{- else if .Values.auth.existingSecret -}}
|
||||||
|
{{- printf "%s" (tpl .Values.auth.existingSecret $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" (include "postgresql.v1.chart.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the replication-password key.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.replicationPasswordKey" -}}
|
||||||
|
{{- if or .Values.global.postgresql.auth.existingSecret .Values.auth.existingSecret -}}
|
||||||
|
{{- if .Values.global.postgresql.auth.secretKeys.replicationPasswordKey -}}
|
||||||
|
{{- printf "%s" (tpl .Values.global.postgresql.auth.secretKeys.replicationPasswordKey $) -}}
|
||||||
|
{{- else if .Values.auth.secretKeys.replicationPasswordKey -}}
|
||||||
|
{{- printf "%s" (tpl .Values.auth.secretKeys.replicationPasswordKey $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- "replication-password" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- "replication-password" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the admin-password key.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.adminPasswordKey" -}}
|
||||||
|
{{- if or .Values.global.postgresql.auth.existingSecret .Values.auth.existingSecret -}}
|
||||||
|
{{- if .Values.global.postgresql.auth.secretKeys.adminPasswordKey -}}
|
||||||
|
{{- printf "%s" (tpl .Values.global.postgresql.auth.secretKeys.adminPasswordKey $) -}}
|
||||||
|
{{- else if .Values.auth.secretKeys.adminPasswordKey -}}
|
||||||
|
{{- printf "%s" (tpl .Values.auth.secretKeys.adminPasswordKey $) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- "postgres-password" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the user-password key.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.userPasswordKey" -}}
|
||||||
|
{{- if or .Values.global.postgresql.auth.existingSecret .Values.auth.existingSecret -}}
|
||||||
|
{{- if or (empty (include "postgresql.v1.username" .)) (eq (include "postgresql.v1.username" .) "postgres") -}}
|
||||||
|
{{- printf "%s" (include "postgresql.v1.adminPasswordKey" .) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- if .Values.global.postgresql.auth.secretKeys.userPasswordKey -}}
|
||||||
|
{{- printf "%s" (tpl .Values.global.postgresql.auth.secretKeys.userPasswordKey $) -}}
|
||||||
|
{{- else if .Values.auth.secretKeys.userPasswordKey -}}
|
||||||
|
{{- printf "%s" (tpl .Values.auth.secretKeys.userPasswordKey $) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- "password" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a secret object should be created
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.createSecret" -}}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . -}}
|
||||||
|
{{- $postgresPassword := include "common.secrets.lookup" (dict "secret" (include "postgresql.v1.chart.fullname" .) "key" .Values.auth.secretKeys.adminPasswordKey "defaultValue" (ternary (coalesce .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword .Values.global.postgresql.auth.password .Values.auth.password) (coalesce .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (or (empty $customUser) (eq $customUser "postgres"))) "context" $) -}}
|
||||||
|
{{- if and (not (or .Values.global.postgresql.auth.existingSecret .Values.auth.existingSecret)) (or $postgresPassword .Values.auth.enablePostgresUser (and (not (empty $customUser)) (ne $customUser "postgres")) (eq .Values.architecture "replication") (and .Values.ldap.enabled (or .Values.ldap.bind_password .Values.ldap.bindpw))) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a secret object should be created for PostgreSQL
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.createPreviousSecret" -}}
|
||||||
|
{{- if and .Values.passwordUpdateJob.previousPasswords.postgresPassword (not .Values.passwordUpdateJob.previousPasswords.existingSecret) }}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret with previous PostgreSQL credentials
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.update-job.previousSecretName" -}}
|
||||||
|
{{- if .Values.passwordUpdateJob.previousPasswords.existingSecret -}}
|
||||||
|
{{- /* The secret with the new password is managed externally */ -}}
|
||||||
|
{{- tpl .Values.passwordUpdateJob.previousPasswords.existingSecret $ -}}
|
||||||
|
{{- else if .Values.passwordUpdateJob.previousPasswords.postgresPassword -}}
|
||||||
|
{{- /* The secret with the new password is managed externally */ -}}
|
||||||
|
{{- printf "%s-previous-secret" (include "postgresql.v1.chart.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- /* The secret with the new password is managed by the helm chart. We use the current secret name as it has the old password */ -}}
|
||||||
|
{{- include "postgresql.v1.chart.fullname" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret with new PostgreSQL credentials
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.update-job.newSecretName" -}}
|
||||||
|
{{- if and (not .Values.passwordUpdateJob.previousPasswords.existingSecret) (not .Values.passwordUpdateJob.previousPasswords.postgresPassword) -}}
|
||||||
|
{{- /* The secret with the new password is managed by the helm chart. We create a new secret as the current one has the old password */ -}}
|
||||||
|
{{- printf "%s-new-secret" (include "postgresql.v1.chart.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- /* The secret with the new password is managed externally */ -}}
|
||||||
|
{{- include "postgresql.v1.secretName" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return PostgreSQL service port
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.service.port" -}}
|
||||||
|
{{- if .Values.global.postgresql.service.ports.postgresql -}}
|
||||||
|
{{- .Values.global.postgresql.service.ports.postgresql -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Values.primary.service.ports.postgresql -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return PostgreSQL service port
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.readReplica.service.port" -}}
|
||||||
|
{{- if .Values.global.postgresql.service.ports.postgresql -}}
|
||||||
|
{{- .Values.global.postgresql.service.ports.postgresql -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Values.readReplicas.service.ports.postgresql -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the PostgreSQL primary configuration ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.primary.configmapName" -}}
|
||||||
|
{{- if .Values.primary.existingConfigmap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.primary.existingConfigmap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-configuration" (include "postgresql.v1.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for PostgreSQL primary with the configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.primary.createConfigmap" -}}
|
||||||
|
{{- if and (or .Values.primary.configuration .Values.primary.pgHbaConfiguration) (not .Values.primary.existingConfigmap) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the PostgreSQL primary extended configuration ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.primary.extendedConfigmapName" -}}
|
||||||
|
{{- if .Values.primary.existingExtendedConfigmap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.primary.existingExtendedConfigmap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-extended-configuration" (include "postgresql.v1.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the PostgreSQL read replica extended configuration ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.readReplicas.extendedConfigmapName" -}}
|
||||||
|
{{- printf "%s-extended-configuration" (include "postgresql.v1.readReplica.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for PostgreSQL primary with the extended configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.primary.createExtendedConfigmap" -}}
|
||||||
|
{{- if and .Values.primary.extendedConfiguration (not .Values.primary.existingExtendedConfigmap) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap object should be created for PostgreSQL read replica with the extended configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.readReplicas.createExtendedConfigmap" -}}
|
||||||
|
{{- if .Values.readReplicas.extendedConfiguration -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
{{ default (include "postgresql.v1.chart.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a configmap should be mounted with PostgreSQL configuration
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.mountConfigurationCM" -}}
|
||||||
|
{{- if or .Values.primary.configuration .Values.primary.pgHbaConfiguration .Values.primary.existingConfigmap -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the pre-initialization scripts ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.preInitDb.scriptsCM" -}}
|
||||||
|
{{- if .Values.primary.preInitDb.scriptsConfigMap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.primary.preInitDb.scriptsConfigMap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-preinit-scripts" (include "postgresql.v1.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the initialization scripts ConfigMap name.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.initdb.scriptsCM" -}}
|
||||||
|
{{- if .Values.primary.initdb.scriptsConfigMap -}}
|
||||||
|
{{- printf "%s" (tpl .Values.primary.initdb.scriptsConfigMap $) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-init-scripts" (include "postgresql.v1.primary.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if TLS is enabled for LDAP connection
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.ldap.tls.enabled" -}}
|
||||||
|
{{- if and (kindIs "string" .Values.ldap.tls) (not (empty .Values.ldap.tls)) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- else if and (kindIs "map" .Values.ldap.tls) .Values.ldap.tls.enabled -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get the readiness probe command
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.readinessProbeCommand" -}}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . -}}
|
||||||
|
- |
|
||||||
|
{{- if (include "postgresql.v1.database" .) }}
|
||||||
|
exec pg_isready -U {{ default "postgres" $customUser | quote }} -d "dbname={{ include "postgresql.v1.database" . }} {{- if .Values.tls.enabled }} sslcert={{ include "postgresql.v1.tlsCert" . }} sslkey={{ include "postgresql.v1.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- else }}
|
||||||
|
exec pg_isready -U {{ default "postgres" $customUser | quote }} {{- if .Values.tls.enabled }} -d "sslcert={{ include "postgresql.v1.tlsCert" . }} sslkey={{ include "postgresql.v1.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- end }}
|
||||||
|
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Compile all warnings into a single message, and call fail.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.validateValues" -}}
|
||||||
|
{{- $messages := list -}}
|
||||||
|
{{- $messages := append $messages (include "postgresql.v1.validateValues.ldapConfigurationMethod" .) -}}
|
||||||
|
{{- $messages := append $messages (include "postgresql.v1.validateValues.psp" .) -}}
|
||||||
|
{{- $messages := without $messages "" -}}
|
||||||
|
{{- $message := join "\n" $messages -}}
|
||||||
|
|
||||||
|
{{- if $message -}}
|
||||||
|
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate values of Postgresql - If ldap.url is used then you don't need the other settings for ldap
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.validateValues.ldapConfigurationMethod" -}}
|
||||||
|
{{- if and .Values.ldap.enabled (and (not (empty .Values.ldap.url)) (not (empty .Values.ldap.server))) -}}
|
||||||
|
postgresql: ldap.url, ldap.server
|
||||||
|
You cannot set both `ldap.url` and `ldap.server` at the same time.
|
||||||
|
Please provide a unique way to configure LDAP.
|
||||||
|
More info at https://www.postgresql.org/docs/current/auth-ldap.html
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate values of Postgresql - If PSP is enabled RBAC should be enabled too
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.validateValues.psp" -}}
|
||||||
|
{{- if and .Values.psp.create (not .Values.rbac.create) -}}
|
||||||
|
postgresql: psp.create, rbac.create
|
||||||
|
RBAC should be enabled if PSP is enabled in order for PSP to work.
|
||||||
|
More info at https://kubernetes.io/docs/concepts/policy/pod-security-policy/#authorizing-policies
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the path to the cert file.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.tlsCert" -}}
|
||||||
|
{{- if .Values.tls.autoGenerated -}}
|
||||||
|
{{- printf "/opt/bitnami/postgresql/certs/tls.crt" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- required "Certificate filename is required when TLS in enabled" .Values.tls.certFilename | printf "/opt/bitnami/postgresql/certs/%s" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the path to the cert key file.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.tlsCertKey" -}}
|
||||||
|
{{- if .Values.tls.autoGenerated -}}
|
||||||
|
{{- printf "/opt/bitnami/postgresql/certs/tls.key" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- required "Certificate Key filename is required when TLS in enabled" .Values.tls.certKeyFilename | printf "/opt/bitnami/postgresql/certs/%s" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the path to the CA cert file.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.tlsCACert" -}}
|
||||||
|
{{- if .Values.tls.autoGenerated -}}
|
||||||
|
{{- printf "/opt/bitnami/postgresql/certs/ca.crt" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "/opt/bitnami/postgresql/certs/%s" .Values.tls.certCAFilename -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the path to the CRL file.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.tlsCRL" -}}
|
||||||
|
{{- if .Values.tls.crlFilename -}}
|
||||||
|
{{- printf "/opt/bitnami/postgresql/certs/%s" .Values.tls.crlFilename -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return true if a TLS credentials secret object should be created
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.createTlsSecret" -}}
|
||||||
|
{{- if and .Values.tls.autoGenerated (not .Values.tls.certificatesSecret) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the path to the CA cert file.
|
||||||
|
*/}}
|
||||||
|
{{- define "postgresql.v1.tlsSecretName" -}}
|
||||||
|
{{- if .Values.tls.autoGenerated -}}
|
||||||
|
{{- printf "%s-crt" (include "postgresql.v1.chart.fullname" .) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{ tpl (required "A secret containing TLS certificates is required when TLS is enabled" .Values.tls.certificatesSecret) . }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
151
charts/semaphore/charts/postgresql/templates/backup/cronjob.yaml
Normal file
151
charts/semaphore/charts/postgresql/templates/backup/cronjob.yaml
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.backup.enabled }}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.fullname" . }}-pgdumpall
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: pg_dumpall
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
{{- if $annotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
schedule: {{ quote .Values.backup.cronjob.schedule }}
|
||||||
|
{{- if .Values.backup.cronjob.timeZone }}
|
||||||
|
timeZone: {{ .Values.backup.cronjob.timeZone | quote }}
|
||||||
|
{{- end }}
|
||||||
|
concurrencyPolicy: {{ .Values.backup.cronjob.concurrencyPolicy }}
|
||||||
|
failedJobsHistoryLimit: {{ .Values.backup.cronjob.failedJobsHistoryLimit }}
|
||||||
|
successfulJobsHistoryLimit: {{ .Values.backup.cronjob.successfulJobsHistoryLimit }}
|
||||||
|
{{- if .Values.backup.cronjob.startingDeadlineSeconds }}
|
||||||
|
startingDeadlineSeconds: {{ .Values.backup.cronjob.startingDeadlineSeconds }}
|
||||||
|
{{- end }}
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
{{- if .Values.backup.cronjob.ttlSecondsAfterFinished }}
|
||||||
|
ttlSecondsAfterFinished: {{ .Values.backup.cronjob.ttlSecondsAfterFinished }}
|
||||||
|
{{- end }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 12 }}
|
||||||
|
app.kubernetes.io/component: pg_dumpall
|
||||||
|
{{- if $annotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "postgresql.v1.imagePullSecrets" . | nindent 10 }}
|
||||||
|
{{- if .Values.backup.cronjob.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.backup.cronjob.nodeSelector "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.backup.cronjob.tolerations "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: {{ include "postgresql.v1.primary.fullname" . }}-pgdumpall
|
||||||
|
image: {{ include "postgresql.v1.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
env:
|
||||||
|
- name: PGUSER
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
value: postgres
|
||||||
|
{{- else }}
|
||||||
|
value: {{ $customUser | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: PGPASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.adminPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: PGPASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
- name: PGHOST
|
||||||
|
value: {{ include "postgresql.v1.primary.fullname" . }}
|
||||||
|
- name: PGPORT
|
||||||
|
value: {{ include "postgresql.v1.service.port" . | quote }}
|
||||||
|
- name: PGDUMP_DIR
|
||||||
|
value: {{ .Values.backup.cronjob.storage.mountPath }}
|
||||||
|
{{- if include "common.fips.enabled" . }}
|
||||||
|
- name: OPENSSL_FIPS
|
||||||
|
value: {{ include "common.fips.config" (dict "tech" "openssl" "fips" .Values.backup.cronjob.fips "global" .Values.global) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: PGSSLROOTCERT
|
||||||
|
{{- if .Values.tls.autoGenerated }}
|
||||||
|
value: /tmp/certs/ca.crt
|
||||||
|
{{- else }}
|
||||||
|
value: {{ printf "/tmp/certs/%s" .Values.tls.certCAFilename }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.backup.cronjob.command "context" $) | nindent 14 }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: raw-certificates
|
||||||
|
mountPath: /tmp/certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.storage.enabled }}
|
||||||
|
- name: datadir
|
||||||
|
mountPath: {{ .Values.backup.cronjob.storage.mountPath }}
|
||||||
|
subPath: {{ .Values.backup.cronjob.storage.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: postgresql-password
|
||||||
|
mountPath: /opt/bitnami/postgresql/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.backup.cronjob.extraVolumeMounts "context" $) | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.containerSecurityContext "context" $) | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.resources }}
|
||||||
|
resources: {{- toYaml .Values.backup.cronjob.resources | nindent 14 }}
|
||||||
|
{{- else if ne .Values.backup.cronjob.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.backup.cronjob.resourcesPreset) | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
restartPolicy: {{ .Values.backup.cronjob.restartPolicy }}
|
||||||
|
{{- if .Values.backup.cronjob.podSecurityContext.enabled }}
|
||||||
|
securityContext:
|
||||||
|
fsGroup: {{ .Values.backup.cronjob.podSecurityContext.fsGroup }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: raw-certificates
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "postgresql.v1.tlsSecretName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.storage.enabled }}
|
||||||
|
{{- if .Values.backup.cronjob.storage.existingClaim }}
|
||||||
|
- name: datadir
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ printf "%s" (tpl .Values.backup.cronjob.storage.existingClaim .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: datadir
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ include "postgresql.v1.primary.fullname" . }}-pgdumpall
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
emptyDir: {}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: postgresql-password
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.backup.cronjob.extraVolumes "context" $ ) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user