added authentik, fixed vm kube registry
This commit is contained in:
parent
cc891ea1cb
commit
e1d2851f41
21
charts/authentik/.helmignore
Normal file
21
charts/authentik/.helmignore
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 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
|
||||||
12
charts/authentik/Chart.lock
Normal file
12
charts/authentik/Chart.lock
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: postgresql
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 16.7.4
|
||||||
|
- name: redis
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 21.1.6
|
||||||
|
- name: authentik-remote-cluster
|
||||||
|
repository: https://charts.goauthentik.io
|
||||||
|
version: 2.1.0
|
||||||
|
digest: sha256:f0d2391d2707ab0f3d37031c1daa9a679783898e549fb58fe3130bc4bf8c97c7
|
||||||
|
generated: "2025-07-22T13:38:13.551083879Z"
|
||||||
79
charts/authentik/Chart.yaml
Normal file
79
charts/authentik/Chart.yaml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
annotations:
|
||||||
|
artifacthub.io/changes: |
|
||||||
|
- kind: changed
|
||||||
|
description: upgrade to authentik 2025.6.4
|
||||||
|
artifacthub.io/images: |
|
||||||
|
- name: authentik
|
||||||
|
image: ghcr.io/goauthentik/server:2025.6.4
|
||||||
|
whitelisted: true
|
||||||
|
- name: authentik-outpost-proxy
|
||||||
|
image: ghcr.io/goauthentik/proxy:2025.6.4
|
||||||
|
whitelisted: true
|
||||||
|
- name: authentik-outpost-ldap
|
||||||
|
image: ghcr.io/goauthentik/ldap:2025.6.4
|
||||||
|
whitelisted: true
|
||||||
|
- name: authentik-outpost-radius
|
||||||
|
image: ghcr.io/goauthentik/radius:2025.6.4
|
||||||
|
whitelisted: true
|
||||||
|
- name: authentik-outpost-rac
|
||||||
|
image: ghcr.io/goauthentik/rac:2025.6.4
|
||||||
|
whitelisted: true
|
||||||
|
artifacthub.io/license: GPL
|
||||||
|
artifacthub.io/links: |
|
||||||
|
- name: GitHub
|
||||||
|
url: https://github.com/goauthentik/authentik
|
||||||
|
- name: Docs
|
||||||
|
url: https://goauthentik.io/docs/
|
||||||
|
artifacthub.io/maintainers: |
|
||||||
|
- name: authentik Team
|
||||||
|
email: hello@goauthentik.io
|
||||||
|
url: https://goauthentik.io
|
||||||
|
artifacthub.io/screenshots: |
|
||||||
|
- title: User interface
|
||||||
|
url: https://docs.goauthentik.io/img/screen_apps_light.jpg
|
||||||
|
- title: Admin interface
|
||||||
|
url: https://docs.goauthentik.io/img/screen_admin_light.jpg
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2025.6.4
|
||||||
|
dependencies:
|
||||||
|
- condition: postgresql.enabled
|
||||||
|
name: postgresql
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 16.7.4
|
||||||
|
- condition: redis.enabled
|
||||||
|
name: redis
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 21.1.6
|
||||||
|
- alias: serviceAccount
|
||||||
|
condition: serviceAccount.create
|
||||||
|
name: authentik-remote-cluster
|
||||||
|
repository: https://charts.goauthentik.io
|
||||||
|
version: 2.1.0
|
||||||
|
description: authentik is an open-source Identity Provider focused on flexibility
|
||||||
|
and versatility
|
||||||
|
home: https://goauthentik.io
|
||||||
|
icon: https://goauthentik.io/img/icon.png
|
||||||
|
keywords:
|
||||||
|
- authentication
|
||||||
|
- directory
|
||||||
|
- identity
|
||||||
|
- idp
|
||||||
|
- ldap
|
||||||
|
- oauth
|
||||||
|
- oidc
|
||||||
|
- proxy
|
||||||
|
- saml
|
||||||
|
- scim
|
||||||
|
- single-sign-on
|
||||||
|
- sp
|
||||||
|
- sso
|
||||||
|
maintainers:
|
||||||
|
- email: hello@goauthentik.io
|
||||||
|
name: authentik Team
|
||||||
|
url: https://goauthentik.io
|
||||||
|
name: authentik
|
||||||
|
sources:
|
||||||
|
- https://goauthentik.io/docs/
|
||||||
|
- https://github.com/goauthentik/authentik
|
||||||
|
type: application
|
||||||
|
version: 2025.6.4
|
||||||
407
charts/authentik/README.md
Normal file
407
charts/authentik/README.md
Normal file
@ -0,0 +1,407 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="https://goauthentik.io/img/icon_top_brand_colour.svg" height="150" alt="authentik logo">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[](https://goauthentik.io/discord)
|
||||||
|
[](https://github.com/goauthentik/helm/actions/workflows/lint-test.yaml)
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
authentik is an open-source Identity Provider focused on flexibility and versatility
|
||||||
|
|
||||||
|
**Homepage:** <https://goauthentik.io>
|
||||||
|
|
||||||
|
## Example values to get started:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
authentik:
|
||||||
|
secret_key: "PleaseGenerateA50CharKey"
|
||||||
|
# This sends anonymous usage-data, stack traces on errors and
|
||||||
|
# performance data to authentik.error-reporting.a7k.io, and is fully opt-in
|
||||||
|
error_reporting:
|
||||||
|
enabled: true
|
||||||
|
postgresql:
|
||||||
|
password: "ThisIsNotASecurePassword"
|
||||||
|
|
||||||
|
server:
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
hosts:
|
||||||
|
- authentik.domain.tld
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
enabled: true
|
||||||
|
auth:
|
||||||
|
password: "ThisIsNotASecurePassword"
|
||||||
|
|
||||||
|
redis:
|
||||||
|
enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Advanced values examples
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>External PostgreSQL and Redis</summary>
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
authentik:
|
||||||
|
postgresql:
|
||||||
|
host: postgres.domain.tld
|
||||||
|
user: file:///postgres-creds/username
|
||||||
|
password: file:///postgres-creds/password
|
||||||
|
redis:
|
||||||
|
host: redis.domain.tld
|
||||||
|
server:
|
||||||
|
volumes:
|
||||||
|
- name: postgres-creds
|
||||||
|
secret:
|
||||||
|
secretName: authentik-postgres-credentials
|
||||||
|
volumeMounts:
|
||||||
|
- name: postgres-creds
|
||||||
|
mountPath: /postgres-creds
|
||||||
|
readOnly: true
|
||||||
|
worker:
|
||||||
|
volumes:
|
||||||
|
- name: postgres-creds
|
||||||
|
secret:
|
||||||
|
secretName: authentik-postgres-credentials
|
||||||
|
volumeMounts:
|
||||||
|
- name: postgres-creds
|
||||||
|
mountPath: /postgres-creds
|
||||||
|
readOnly: true
|
||||||
|
```
|
||||||
|
|
||||||
|
The secret `authentik-postgres-credentials` must have `username` and `password` keys.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
| Name | Email | Url |
|
||||||
|
| ---- | ------ | --- |
|
||||||
|
| authentik Team | <hello@goauthentik.io> | <https://goauthentik.io> |
|
||||||
|
|
||||||
|
## Source Code
|
||||||
|
|
||||||
|
* <https://goauthentik.io/docs/>
|
||||||
|
* <https://github.com/goauthentik/authentik>
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
| Repository | Name | Version |
|
||||||
|
|------------|------|---------|
|
||||||
|
| https://charts.goauthentik.io | serviceAccount(authentik-remote-cluster) | 2.1.0 |
|
||||||
|
| oci://registry-1.docker.io/bitnamicharts | postgresql | 16.7.4 |
|
||||||
|
| oci://registry-1.docker.io/bitnamicharts | redis | 21.1.6 |
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Key | Type | Default | Description |
|
||||||
|
|-----|------|---------|-------------|
|
||||||
|
| additionalObjects | list | `[]` | additional resources to deploy. Those objects are templated. |
|
||||||
|
| authentik.email.from | string | `""` | Email from address, can either be in the format "foo@bar.baz" or "authentik <foo@bar.baz>" |
|
||||||
|
| authentik.email.host | string | `""` | SMTP Server emails are sent from, fully optional |
|
||||||
|
| authentik.email.password | string | `""` | SMTP credentials, when left empty, no authentication will be done |
|
||||||
|
| authentik.email.port | int | `587` | SMTP server port |
|
||||||
|
| authentik.email.timeout | int | `30` | Connection timeout |
|
||||||
|
| authentik.email.use_ssl | bool | `false` | Use SSL. Enable either use_tls or use_ssl, they can't be enabled at the same time. |
|
||||||
|
| authentik.email.use_tls | bool | `false` | Use StartTLS. Enable either use_tls or use_ssl, they can't be enabled at the same time. |
|
||||||
|
| authentik.email.username | string | `""` | SMTP credentials, when left empty, no authentication will be done |
|
||||||
|
| authentik.enabled | bool | `true` | whether to create the authentik configuration secret |
|
||||||
|
| authentik.error_reporting.enabled | bool | `false` | This sends anonymous usage-data, stack traces on errors and performance data to sentry.beryju.org, and is fully opt-in |
|
||||||
|
| authentik.error_reporting.environment | string | `"k8s"` | This is a string that is sent to sentry with your error reports |
|
||||||
|
| authentik.error_reporting.send_pii | bool | `false` | Send PII (Personally identifiable information) data to sentry |
|
||||||
|
| authentik.events.context_processors.asn | string | `"/geoip/GeoLite2-ASN.mmdb"` | Path for the GeoIP ASN database. If the file doesn't exist, GeoIP features are disabled. |
|
||||||
|
| authentik.events.context_processors.geoip | string | `"/geoip/GeoLite2-City.mmdb"` | Path for the GeoIP City database. If the file doesn't exist, GeoIP features are disabled. |
|
||||||
|
| authentik.log_level | string | `"info"` | Log level for server and worker |
|
||||||
|
| authentik.outposts.container_image_base | string | `"ghcr.io/goauthentik/%(type)s:%(version)s"` | Template used for managed outposts. The following placeholders can be used %(type)s - the type of the outpost %(version)s - version of your authentik install %(build_hash)s - only for beta versions, the build hash of the image |
|
||||||
|
| authentik.postgresql.host | string | `{{ .Release.Name }}-postgresql` | set the postgresql hostname to talk to if unset and .Values.postgresql.enabled == true, will generate the default |
|
||||||
|
| authentik.postgresql.name | string | `authentik` | postgresql Database name |
|
||||||
|
| authentik.postgresql.password | string | `""` | |
|
||||||
|
| authentik.postgresql.port | int | `5432` | |
|
||||||
|
| authentik.postgresql.user | string | `authentik` | postgresql Username |
|
||||||
|
| authentik.redis.host | string | `{{ .Release.Name }}-redis-master` | set the redis hostname to talk to |
|
||||||
|
| authentik.redis.password | string | `""` | |
|
||||||
|
| authentik.secret_key | string | `""` | Secret key used for cookie singing and unique user IDs, don't change this after the first install |
|
||||||
|
| authentik.web.path | string | `"/"` | Relative path the authentik instance will be available at. Value _must_ contain both a leading and trailing slash. |
|
||||||
|
| blueprints.configMaps | list | `[]` | List of config maps to mount blueprints from. Only keys in the configMap ending with `.yaml` will be discovered and applied. |
|
||||||
|
| blueprints.secrets | list | `[]` | List of secrets to mount blueprints from. Only keys in the secret ending with `.yaml` will be discovered and applied. |
|
||||||
|
| fullnameOverride | string | `""` | String to fully override `"authentik.fullname"`. Prefer using global.fullnameOverride if possible |
|
||||||
|
| geoip.accountId | string | `""` | sign up under https://www.maxmind.com/en/geolite2/signup |
|
||||||
|
| geoip.containerSecurityContext | object | See [values.yaml] | GeoIP container-level security context |
|
||||||
|
| geoip.editionIds | string | `"GeoLite2-City GeoLite2-ASN"` | |
|
||||||
|
| geoip.enabled | bool | `false` | enable GeoIP sidecars for the authentik server and worker pods |
|
||||||
|
| geoip.env | list | `[]` (See [values.yaml]) | Environment variables to pass to the GeoIP containers |
|
||||||
|
| geoip.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the GeoIP containers |
|
||||||
|
| geoip.existingSecret.accountId | string | `"account_id"` | key in the secret containing the account ID |
|
||||||
|
| geoip.existingSecret.licenseKey | string | `"license_key"` | key in the secret containing the license key |
|
||||||
|
| geoip.existingSecret.secretName | string | `""` | name of an existing secret to use instead of values above |
|
||||||
|
| geoip.image.digest | string | `""` | If defined, an image digest for GeoIP images |
|
||||||
|
| geoip.image.pullPolicy | string | `"IfNotPresent"` | If defined, an imagePullPolicy for GeoIP images |
|
||||||
|
| geoip.image.repository | string | `"ghcr.io/maxmind/geoipupdate"` | If defined, a repository for GeoIP images |
|
||||||
|
| geoip.image.tag | string | `"v7.1.0"` | If defined, a tag for GeoIP images |
|
||||||
|
| geoip.licenseKey | string | `""` | sign up under https://www.maxmind.com/en/geolite2/signup |
|
||||||
|
| geoip.resources | object | `{}` | Resource limits and requests for GeoIP containers |
|
||||||
|
| geoip.updateInterval | int | `8` | GeoIP update frequency, in hours |
|
||||||
|
| geoip.volumeMounts | list | `[]` | Additional volumeMounts to the GeoIP containers. Make sure the volumes exists for the server and the worker. |
|
||||||
|
| global.addPrometheusAnnotations | bool | `false` | Add Prometheus scrape annotations to all metrics services. This can be used as an alternative to the ServiceMonitors. |
|
||||||
|
| global.additionalLabels | object | `{}` | Common labels for all resources. |
|
||||||
|
| global.affinity.nodeAffinity.matchExpressions | list | `[]` | Default match expressions for node affinity |
|
||||||
|
| global.affinity.nodeAffinity.type | string | `"hard"` | Default node affinity rules. Either `none`, `soft` or `hard` |
|
||||||
|
| global.affinity.podAntiAffinity | string | `"soft"` | Default pod anti-affinity rules. Either: `none`, `soft` or `hard` |
|
||||||
|
| global.deploymentAnnotations | object | `{}` | Annotations for all deployed Deployments |
|
||||||
|
| global.deploymentStrategy | object | `{}` | Deployment strategy for all deployed Deployments |
|
||||||
|
| global.env | list | `[]` (See [values.yaml]) | Environment variables to pass to all deployed Deployments. Does not apply to GeoIP See configuration options at https://goauthentik.io/docs/installation/configuration/ |
|
||||||
|
| global.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to all deployed Deployments. Does not apply to GeoIP |
|
||||||
|
| global.fullnameOverride | string | `""` | String to fully override `"authentik.fullname"` |
|
||||||
|
| global.hostAliases | list | `[]` | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files |
|
||||||
|
| global.image.digest | string | `""` | If defined, an image digest applied to all authentik deployments |
|
||||||
|
| global.image.pullPolicy | string | `"IfNotPresent"` | If defined, an imagePullPolicy applied to all authentik deployments |
|
||||||
|
| global.image.repository | string | `"ghcr.io/goauthentik/server"` | If defined, a repository applied to all authentik deployments |
|
||||||
|
| global.image.tag | string | `""` | Overrides the global authentik whose default is the chart appVersion |
|
||||||
|
| global.imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry |
|
||||||
|
| global.nameOverride | string | `""` | Provide a name in place of `authentik` |
|
||||||
|
| global.namespaceOverride | string | `""` | A custom namespace to override the default namespace for the deployed resources. |
|
||||||
|
| global.nodeSelector | object | `{}` | Default node selector for all components |
|
||||||
|
| global.podAnnotations | object | `{}` | Annotations for all deployed pods |
|
||||||
|
| global.podLabels | object | `{}` | Labels for all deployed pods |
|
||||||
|
| global.priorityClassName | string | `""` | Default priority class for all components |
|
||||||
|
| global.revisionHistoryLimit | int | `3` | |
|
||||||
|
| global.secretAnnotations | object | `{}` | Annotations for all deployed secrets |
|
||||||
|
| global.securityContext | object | `{}` (See [values.yaml]) | Toggle and define pod-level security context. |
|
||||||
|
| global.tolerations | list | `[]` | Default tolerations for all components |
|
||||||
|
| global.topologySpreadConstraints | list | `[]` | Default [TopologySpreadConstraints] rules for all components # Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ |
|
||||||
|
| global.volumeMounts | list | `[]` (See [values.yaml]) | Additional volumeMounts to all deployed Deployments. Does not apply to GeoIP |
|
||||||
|
| global.volumes | list | `[]` (See [values.yaml]) | Additional volumes to all deployed Deployments. |
|
||||||
|
| kubeVersionOverride | string | `""` | Override the Kubernetes version, which is used to evaluate certain manifests |
|
||||||
|
| nameOverride | string | `""` | Provide a name in place of `authentik`. Prefer using global.nameOverride if possible |
|
||||||
|
| postgresql.auth.database | string | `"authentik"` | |
|
||||||
|
| postgresql.auth.username | string | `"authentik"` | |
|
||||||
|
| postgresql.backup.resourcesPreset | string | `"none"` | |
|
||||||
|
| postgresql.enabled | bool | `false` | enable the Bitnami PostgreSQL chart. Refer to https://github.com/bitnami/charts/blob/main/bitnami/postgresql/ for possible values. |
|
||||||
|
| postgresql.metrics.resourcesPreset | string | `"none"` | |
|
||||||
|
| postgresql.passwordUpdateJob.resourcesPreset | string | `"none"` | |
|
||||||
|
| postgresql.primary.extendedConfiguration | string | `"max_connections = 500\n"` | |
|
||||||
|
| postgresql.primary.resourcesPreset | string | `"none"` | |
|
||||||
|
| postgresql.readReplicas.resourcesPreset | string | `"none"` | |
|
||||||
|
| postgresql.volumePermissions.resourcesPreset | string | `"none"` | |
|
||||||
|
| prometheus.rules.annotations | object | `{}` | PrometheusRule annotations |
|
||||||
|
| prometheus.rules.enabled | bool | `false` | |
|
||||||
|
| prometheus.rules.labels | object | `{}` | PrometheusRule labels |
|
||||||
|
| prometheus.rules.namespace | string | `""` | PrometheusRule namespace |
|
||||||
|
| prometheus.rules.selector | object | `{}` | PrometheusRule selector |
|
||||||
|
| redis.architecture | string | `"standalone"` | |
|
||||||
|
| redis.auth.enabled | bool | `false` | |
|
||||||
|
| redis.enabled | bool | `false` | enable the Bitnami Redis chart. Refer to https://github.com/bitnami/charts/blob/main/bitnami/redis/ for possible values. |
|
||||||
|
| redis.master.resourcesPreset | string | `"none"` | |
|
||||||
|
| redis.metrics.resourcesPreset | string | `"none"` | |
|
||||||
|
| redis.replica.resourcesPreset | string | `"none"` | |
|
||||||
|
| redis.sentinel.resourcesPreset | string | `"none"` | |
|
||||||
|
| redis.sysctl.resourcesPreset | string | `"none"` | |
|
||||||
|
| redis.volumePermissions.resourcesPreset | string | `"none"` | |
|
||||||
|
| server.affinity | object | `{}` (defaults to the global.affinity preset) | Assign custom [affinity] rules to the deployment |
|
||||||
|
| server.autoscaling.behavior | object | `{}` | Configures the scaling behavior of the target in both Up and Down directions. |
|
||||||
|
| server.autoscaling.enabled | bool | `false` | Enable Horizontal Pod Autoscaler ([HPA]) for the authentik server |
|
||||||
|
| server.autoscaling.maxReplicas | int | `5` | Maximum number of replicas for the authentik server [HPA] |
|
||||||
|
| server.autoscaling.metrics | list | `[]` | Configures custom HPA metrics for the authentik server Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ |
|
||||||
|
| server.autoscaling.minReplicas | int | `1` | Minimum number of replicas for the authentik server [HPA] |
|
||||||
|
| server.autoscaling.targetCPUUtilizationPercentage | int | `50` | Average CPU utilization percentage for the authentik server [HPA] |
|
||||||
|
| server.autoscaling.targetMemoryUtilizationPercentage | string | `nil` | Average memory utilization percentage for the authentik server [HPA] |
|
||||||
|
| server.containerPorts.http | int | `9000` | http container port |
|
||||||
|
| server.containerPorts.https | int | `9443` | https container port |
|
||||||
|
| server.containerPorts.metrics | int | `9300` | metrics container port |
|
||||||
|
| server.containerSecurityContext | object | See [values.yaml] | authentik server container-level security context |
|
||||||
|
| server.deploymentAnnotations | object | `{}` | Annotations to be added to the authentik server Deployment |
|
||||||
|
| server.deploymentStrategy | object | `{}` (defaults to global.deploymentStrategy) | Deployment strategy to be added to the authentik server Deployment |
|
||||||
|
| server.dnsConfig | object | `{}` | [DNS configuration] |
|
||||||
|
| server.dnsPolicy | string | `""` | Alternative DNS policy for authentik server pods |
|
||||||
|
| server.enabled | bool | `true` | whether to enable server resources |
|
||||||
|
| server.env | list | `[]` (See [values.yaml]) | Environment variables to pass to the authentik server. Does not apply to GeoIP See configuration options at https://goauthentik.io/docs/installation/configuration/ |
|
||||||
|
| server.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the authentik server. Does not apply to GeoIP |
|
||||||
|
| server.extraContainers | list | `[]` | Additional containers to be added to the authentik server pod # Note: Supports use of custom Helm templates |
|
||||||
|
| server.hostNetwork | bool | `false` | Host Network for authentik server pods |
|
||||||
|
| server.image.digest | string | `""` (defaults to global.image.digest) | Digest to use to the authentik server |
|
||||||
|
| server.image.pullPolicy | string | `""` (defaults to global.image.pullPolicy) | Image pull policy to use to the authentik server |
|
||||||
|
| server.image.repository | string | `""` (defaults to global.image.repository) | Repository to use to the authentik server |
|
||||||
|
| server.image.tag | string | `""` (defaults to global.image.tag) | Tag to use to the authentik server |
|
||||||
|
| server.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry |
|
||||||
|
| server.ingress.annotations | object | `{}` | additional ingress annotations |
|
||||||
|
| server.ingress.enabled | bool | `false` | enable an ingress resource for the authentik server |
|
||||||
|
| server.ingress.extraPaths | list | `[]` | additional ingress paths |
|
||||||
|
| server.ingress.hosts | list | `[]` | List of ingress hosts |
|
||||||
|
| server.ingress.https | bool | `false` | uses `server.service.servicePortHttps` instead of `server.service.servicePortHttp` |
|
||||||
|
| server.ingress.ingressClassName | string | `""` | defines which ingress controller will implement the resource |
|
||||||
|
| server.ingress.labels | object | `{}` | additional ingress labels |
|
||||||
|
| server.ingress.pathType | string | `"Prefix"` | Ingress path type. One of `Exact`, `Prefix` or `ImplementationSpecific` |
|
||||||
|
| server.ingress.paths | list | `["{{ .Values.authentik.web.path }}"]` | List of ingress paths |
|
||||||
|
| server.ingress.tls | list | `[]` | ingress TLS configuration |
|
||||||
|
| server.initContainers | list | `[]` | Init containers to add to the authentik server pod # Note: Supports use of custom Helm templates |
|
||||||
|
| server.lifecycle | object | `{}` | Specify postStart and preStop lifecycle hooks for you authentik server container |
|
||||||
|
| server.livenessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
|
||||||
|
| server.livenessProbe.httpGet.path | string | `"{{ .Values.authentik.web.path }}-/health/live/"` | |
|
||||||
|
| server.livenessProbe.httpGet.port | string | `"http"` | |
|
||||||
|
| server.livenessProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before [probe] is initiated |
|
||||||
|
| server.livenessProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
|
||||||
|
| server.livenessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
|
||||||
|
| server.livenessProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
|
||||||
|
| server.metrics.enabled | bool | `false` | deploy metrics service |
|
||||||
|
| server.metrics.service.annotations | object | `{}` | metrics service annotations |
|
||||||
|
| server.metrics.service.clusterIP | string | `""` | metrics service clusterIP. `None` makes a "headless service" (no virtual IP) |
|
||||||
|
| server.metrics.service.labels | object | `{}` | metrics service labels |
|
||||||
|
| server.metrics.service.portName | string | `"metrics"` | metrics service port name |
|
||||||
|
| server.metrics.service.servicePort | int | `9300` | metrics service port |
|
||||||
|
| server.metrics.service.type | string | `"ClusterIP"` | metrics service type |
|
||||||
|
| server.metrics.serviceMonitor.annotations | object | `{}` | Prometheus ServiceMonitor annotations |
|
||||||
|
| server.metrics.serviceMonitor.enabled | bool | `false` | enable a prometheus ServiceMonitor |
|
||||||
|
| server.metrics.serviceMonitor.interval | string | `"30s"` | Prometheus ServiceMonitor interval |
|
||||||
|
| server.metrics.serviceMonitor.labels | object | `{}` | Prometheus ServiceMonitor labels |
|
||||||
|
| server.metrics.serviceMonitor.metricRelabelings | list | `[]` | Prometheus [MetricsRelabelConfigs] to apply to samples before ingestion |
|
||||||
|
| server.metrics.serviceMonitor.namespace | string | `""` | Prometheus ServiceMonitor namespace |
|
||||||
|
| server.metrics.serviceMonitor.relabelings | list | `[]` | Prometheus [RelabelConfigs] to apply to samples before scraping |
|
||||||
|
| server.metrics.serviceMonitor.scheme | string | `""` | Prometheus ServiceMonitor scheme |
|
||||||
|
| server.metrics.serviceMonitor.scrapeTimeout | string | `"3s"` | Prometheus ServiceMonitor scrape timeout |
|
||||||
|
| server.metrics.serviceMonitor.selector | object | `{}` | Prometheus ServiceMonitor selector |
|
||||||
|
| server.metrics.serviceMonitor.tlsConfig | object | `{}` | Prometheus ServiceMonitor tlsConfig |
|
||||||
|
| server.name | string | `"server"` | authentik server name |
|
||||||
|
| server.nodeSelector | object | `{}` (defaults to global.nodeSelector) | [Node selector] |
|
||||||
|
| server.pdb.annotations | object | `{}` | Annotations to be added to the authentik server pdb |
|
||||||
|
| server.pdb.enabled | bool | `false` | Deploy a [PodDistrubtionBudget] for the authentik server |
|
||||||
|
| server.pdb.labels | object | `{}` | Labels to be added to the authentik server pdb |
|
||||||
|
| server.pdb.maxUnavailable | string | `""` | Number of pods that are unavailable after eviction as number or percentage (eg.: 50%) # Has higher precedence over `server.pdb.minAvailable` |
|
||||||
|
| server.pdb.minAvailable | string | `""` (defaults to 0 if not specified) | Number of pods that are available after eviction as number or percentage (eg.: 50%) |
|
||||||
|
| server.podAnnotations | object | `{}` | Annotations to be added to the authentik server pods |
|
||||||
|
| server.podLabels | object | `{}` | Labels to be added to the authentik server pods |
|
||||||
|
| server.priorityClassName | string | `""` (defaults to global.priorityClassName) | Prority class for the authentik server pods |
|
||||||
|
| server.readinessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
|
||||||
|
| server.readinessProbe.httpGet.path | string | `"{{ .Values.authentik.web.path }}-/health/ready/"` | |
|
||||||
|
| server.readinessProbe.httpGet.port | string | `"http"` | |
|
||||||
|
| server.readinessProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before [probe] is initiated |
|
||||||
|
| server.readinessProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
|
||||||
|
| server.readinessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
|
||||||
|
| server.readinessProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
|
||||||
|
| server.replicas | int | `1` | The number of server pods to run |
|
||||||
|
| server.resources | object | `{}` | Resource limits and requests for the authentik server |
|
||||||
|
| server.route.main.additionalRules | list | `[]` | Additional custom rules that can be added to the route |
|
||||||
|
| server.route.main.annotations | object | `{}` | Route annotations |
|
||||||
|
| server.route.main.apiVersion | string | `"gateway.networking.k8s.io/v1"` | Set the route apiVersion |
|
||||||
|
| server.route.main.enabled | bool | `false` | enable an HTTPRoute resource for the authentik server. Be aware that this is an early beta of this feature. We don't guarantee this works and is subject to change. |
|
||||||
|
| server.route.main.filters | list | `[]` | Route filters |
|
||||||
|
| server.route.main.hostnames | list | `[]` | Route hostnames |
|
||||||
|
| server.route.main.https | bool | `false` | uses `server.service.servicePortHttps` instead of `server.service.servicePortHttp` |
|
||||||
|
| server.route.main.httpsRedirect | bool | `false` | Create http route for redirect (https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/#http-to-https-redirects). Take care that you only enable this on the http listener of the gateway to avoid an infinite redirect. Matches, filters and additionalRules will be ignored if this is set to true |
|
||||||
|
| server.route.main.kind | string | `"HTTPRoute"` | Set the route kind |
|
||||||
|
| server.route.main.labels | object | `{}` | Route labels |
|
||||||
|
| server.route.main.matches | list | `[{"path":{"type":"PathPrefix","value":"{{ .Values.authentik.web.path }}"}}]` | Route matches |
|
||||||
|
| server.route.main.parentRefs | list | `[]` | Reference to parent gateways |
|
||||||
|
| server.securityContext | object | `{}` (See [values.yaml]) | authentik server pod-level security context |
|
||||||
|
| server.service.annotations | object | `{}` | authentik server service annotations |
|
||||||
|
| server.service.externalIPs | list | `[]` | authentik server service external IPs |
|
||||||
|
| server.service.externalTrafficPolicy | string | `""` | Denotes if this service desires to route external traffic to node-local or cluster-wide endpoints |
|
||||||
|
| server.service.labels | object | `{}` | authentik server service labels |
|
||||||
|
| server.service.loadBalancerIP | string | `""` | LoadBalancer will get created with the IP specified in this field |
|
||||||
|
| server.service.loadBalancerSourceRanges | list | `[]` | Source IP ranges to allow access to service from |
|
||||||
|
| server.service.nodePortHttp | int | `30080` | authentik server service http port for NodePort service type (only if `server.service.type` is set to `NodePort`) |
|
||||||
|
| server.service.nodePortHttps | int | `30443` | authentik server service https port for NodePort service type (only if `server.service.type` is set to `NodePort`) |
|
||||||
|
| server.service.servicePortHttp | int | `80` | authentik server service http port |
|
||||||
|
| server.service.servicePortHttpName | string | `"http"` | authentik server service http port name |
|
||||||
|
| server.service.servicePortHttps | int | `443` | authentik server service https port |
|
||||||
|
| server.service.servicePortHttpsName | string | `"https"` | authentik server service https port name |
|
||||||
|
| server.service.sessionAffinity | string | `""` | Used to maintain session affinity. Supports `ClientIP` and `None` |
|
||||||
|
| server.service.sessionAffinityConfig | object | `{}` | Session affinity configuration |
|
||||||
|
| server.service.type | string | `"ClusterIP"` | authentik server service type |
|
||||||
|
| server.serviceAccountName | string | `nil` | serviceAccount to use for authentik server pods |
|
||||||
|
| server.startupProbe.failureThreshold | int | `60` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
|
||||||
|
| server.startupProbe.httpGet.path | string | `"{{ .Values.authentik.web.path }}-/health/live/"` | |
|
||||||
|
| server.startupProbe.httpGet.port | string | `"http"` | |
|
||||||
|
| server.startupProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before [probe] is initiated |
|
||||||
|
| server.startupProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
|
||||||
|
| server.startupProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
|
||||||
|
| server.startupProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
|
||||||
|
| server.terminationGracePeriodSeconds | int | `30` | terminationGracePeriodSeconds for container lifecycle hook |
|
||||||
|
| server.tolerations | list | `[]` (defaults to global.tolerations) | [Tolerations] for use with node taints |
|
||||||
|
| server.topologySpreadConstraints | list | `[]` (defaults to global.topologySpreadConstraints) | Assign custom [TopologySpreadConstraints] rules to the authentik server # Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ # If labelSelector is left out, it will default to the labelSelector configuration of the deployment |
|
||||||
|
| server.volumeMounts | list | `[]` | Additional volumeMounts to the authentik server main container |
|
||||||
|
| server.volumes | list | `[]` | Additional volumes to the authentik server pod |
|
||||||
|
| serviceAccount.annotations | object | `{}` | additional service account annotations |
|
||||||
|
| serviceAccount.create | bool | `true` | Create service account. Needed for managed outposts |
|
||||||
|
| serviceAccount.fullnameOverride | string | `"authentik"` | |
|
||||||
|
| serviceAccount.serviceAccountSecret.enabled | bool | `false` | |
|
||||||
|
| worker.affinity | object | `{}` (defaults to the global.affinity preset) | Assign custom [affinity] rules to the deployment |
|
||||||
|
| worker.autoscaling.behavior | object | `{}` | Configures the scaling behavior of the target in both Up and Down directions. |
|
||||||
|
| worker.autoscaling.enabled | bool | `false` | Enable Horizontal Pod Autoscaler ([HPA]) for the authentik worker |
|
||||||
|
| worker.autoscaling.maxReplicas | int | `5` | Maximum number of replicas for the authentik worker [HPA] |
|
||||||
|
| worker.autoscaling.metrics | list | `[]` | Configures custom HPA metrics for the authentik worker Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ |
|
||||||
|
| worker.autoscaling.minReplicas | int | `1` | Minimum number of replicas for the authentik worker [HPA] |
|
||||||
|
| worker.autoscaling.targetCPUUtilizationPercentage | int | `50` | Average CPU utilization percentage for the authentik worker [HPA] |
|
||||||
|
| worker.autoscaling.targetMemoryUtilizationPercentage | string | `nil` | Average memory utilization percentage for the authentik worker [HPA] |
|
||||||
|
| worker.containerSecurityContext | object | See [values.yaml] | authentik worker container-level security context |
|
||||||
|
| worker.deploymentAnnotations | object | `{}` | Annotations to be added to the authentik worker Deployment |
|
||||||
|
| worker.deploymentStrategy | object | `{}` (defaults to global.deploymentStrategy) | Deployment strategy to be added to the authentik worker Deployment |
|
||||||
|
| worker.dnsConfig | object | `{}` | [DNS configuration] |
|
||||||
|
| worker.dnsPolicy | string | `""` | Alternative DNS policy for authentik worker pods |
|
||||||
|
| worker.enabled | bool | `true` | whether to enable worker resources |
|
||||||
|
| worker.env | list | `[]` (See [values.yaml]) | Environment variables to pass to the authentik worker. Does not apply to GeoIP See configuration options at https://goauthentik.io/docs/installation/configuration/ |
|
||||||
|
| worker.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the authentik worker. Does not apply to GeoIP |
|
||||||
|
| worker.extraContainers | list | `[]` | Additional containers to be added to the authentik worker pod # Note: Supports use of custom Helm templates |
|
||||||
|
| worker.hostNetwork | bool | `false` | Host Network for authentik worker pods |
|
||||||
|
| worker.image.digest | string | `""` (defaults to global.image.digest) | Digest to use to the authentik worker |
|
||||||
|
| worker.image.pullPolicy | string | `""` (defaults to global.image.pullPolicy) | Image pull policy to use to the authentik worker |
|
||||||
|
| worker.image.repository | string | `""` (defaults to global.image.repository) | Repository to use to the authentik worker |
|
||||||
|
| worker.image.tag | string | `""` (defaults to global.image.tag) | Tag to use to the authentik worker |
|
||||||
|
| worker.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry |
|
||||||
|
| worker.initContainers | list | `[]` | Init containers to add to the authentik worker pod # Note: Supports use of custom Helm templates |
|
||||||
|
| worker.lifecycle | object | `{}` | Specify postStart and preStop lifecycle hooks for you authentik worker container |
|
||||||
|
| worker.livenessProbe.exec.command[0] | string | `"ak"` | |
|
||||||
|
| worker.livenessProbe.exec.command[1] | string | `"healthcheck"` | |
|
||||||
|
| worker.livenessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
|
||||||
|
| worker.livenessProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before [probe] is initiated |
|
||||||
|
| worker.livenessProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
|
||||||
|
| worker.livenessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
|
||||||
|
| worker.livenessProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
|
||||||
|
| worker.name | string | `"worker"` | authentik worker name |
|
||||||
|
| worker.nodeSelector | object | `{}` (defaults to global.nodeSelector) | [Node selector] |
|
||||||
|
| worker.pdb.annotations | object | `{}` | Annotations to be added to the authentik worker pdb |
|
||||||
|
| worker.pdb.enabled | bool | `false` | Deploy a [PodDistrubtionBudget] for the authentik worker |
|
||||||
|
| worker.pdb.labels | object | `{}` | Labels to be added to the authentik worker pdb |
|
||||||
|
| worker.pdb.maxUnavailable | string | `""` | Number of pods that are unavailable after eviction as number or percentage (eg.: 50%) # Has higher precedence over `worker.pdb.minAvailable` |
|
||||||
|
| worker.pdb.minAvailable | string | `""` (defaults to 0 if not specified) | Number of pods that are available after eviction as number or percentage (eg.: 50%) |
|
||||||
|
| worker.podAnnotations | object | `{}` | Annotations to be added to the authentik worker pods |
|
||||||
|
| worker.podLabels | object | `{}` | Labels to be added to the authentik worker pods |
|
||||||
|
| worker.priorityClassName | string | `""` (defaults to global.priorityClassName) | Prority class for the authentik worker pods |
|
||||||
|
| worker.readinessProbe.exec.command[0] | string | `"ak"` | |
|
||||||
|
| worker.readinessProbe.exec.command[1] | string | `"healthcheck"` | |
|
||||||
|
| worker.readinessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
|
||||||
|
| worker.readinessProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before [probe] is initiated |
|
||||||
|
| worker.readinessProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
|
||||||
|
| worker.readinessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
|
||||||
|
| worker.readinessProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
|
||||||
|
| worker.replicas | int | `1` | The number of worker pods to run |
|
||||||
|
| worker.resources | object | `{}` | Resource limits and requests for the authentik worker |
|
||||||
|
| worker.securityContext | object | `{}` (See [values.yaml]) | authentik worker pod-level security context |
|
||||||
|
| worker.serviceAccountName | string | `nil` | serviceAccount to use for authentik worker pods. If set, overrides the value used when serviceAccount.create is true |
|
||||||
|
| worker.startupProbe.exec.command[0] | string | `"ak"` | |
|
||||||
|
| worker.startupProbe.exec.command[1] | string | `"healthcheck"` | |
|
||||||
|
| worker.startupProbe.failureThreshold | int | `60` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
|
||||||
|
| worker.startupProbe.initialDelaySeconds | int | `30` | Number of seconds after the container has started before [probe] is initiated |
|
||||||
|
| worker.startupProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
|
||||||
|
| worker.startupProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
|
||||||
|
| worker.startupProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
|
||||||
|
| worker.terminationGracePeriodSeconds | int | `30` | terminationGracePeriodSeconds for container lifecycle hook |
|
||||||
|
| worker.tolerations | list | `[]` (defaults to global.tolerations) | [Tolerations] for use with node taints |
|
||||||
|
| worker.topologySpreadConstraints | list | `[]` (defaults to global.topologySpreadConstraints) | Assign custom [TopologySpreadConstraints] rules to the authentik worker # Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ # If labelSelector is left out, it will default to the labelSelector configuration of the deployment |
|
||||||
|
| worker.volumeMounts | list | `[]` | Additional volumeMounts to the authentik worker main container |
|
||||||
|
| worker.volumes | list | `[]` | Additional volumes to the authentik worker pod |
|
||||||
|
|
||||||
|
---
|
||||||
|
[affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
|
||||||
|
[DNS configuration]: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
|
||||||
|
[HPA]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
|
||||||
|
[MetricRelabelConfigs]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
|
||||||
|
[Node selector]: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
|
[PodDisruptionBudget]: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets
|
||||||
|
[probe]: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||||
|
[RelabelConfigs]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
|
||||||
|
[Tolerations]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
[TopologySpreadConstraints]: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
|
||||||
|
[values.yaml]: values.yaml
|
||||||
100
charts/authentik/README.md.gotmpl
Normal file
100
charts/authentik/README.md.gotmpl
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="https://goauthentik.io/img/icon_top_brand_colour.svg" height="150" alt="authentik logo">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[](https://goauthentik.io/discord)
|
||||||
|
[](https://github.com/goauthentik/helm/actions/workflows/lint-test.yaml)
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
{{ template "chart.deprecationWarning" . }}
|
||||||
|
|
||||||
|
{{ template "chart.description" . }}
|
||||||
|
|
||||||
|
{{ template "chart.homepageLine" . }}
|
||||||
|
|
||||||
|
## Example values to get started:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
authentik:
|
||||||
|
secret_key: "PleaseGenerateA50CharKey"
|
||||||
|
# This sends anonymous usage-data, stack traces on errors and
|
||||||
|
# performance data to authentik.error-reporting.a7k.io, and is fully opt-in
|
||||||
|
error_reporting:
|
||||||
|
enabled: true
|
||||||
|
postgresql:
|
||||||
|
password: "ThisIsNotASecurePassword"
|
||||||
|
|
||||||
|
server:
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
hosts:
|
||||||
|
- authentik.domain.tld
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
enabled: true
|
||||||
|
auth:
|
||||||
|
password: "ThisIsNotASecurePassword"
|
||||||
|
|
||||||
|
redis:
|
||||||
|
enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Advanced values examples
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>External PostgreSQL and Redis</summary>
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
authentik:
|
||||||
|
postgresql:
|
||||||
|
host: postgres.domain.tld
|
||||||
|
user: file:///postgres-creds/username
|
||||||
|
password: file:///postgres-creds/password
|
||||||
|
redis:
|
||||||
|
host: redis.domain.tld
|
||||||
|
server:
|
||||||
|
volumes:
|
||||||
|
- name: postgres-creds
|
||||||
|
secret:
|
||||||
|
secretName: authentik-postgres-credentials
|
||||||
|
volumeMounts:
|
||||||
|
- name: postgres-creds
|
||||||
|
mountPath: /postgres-creds
|
||||||
|
readOnly: true
|
||||||
|
worker:
|
||||||
|
volumes:
|
||||||
|
- name: postgres-creds
|
||||||
|
secret:
|
||||||
|
secretName: authentik-postgres-credentials
|
||||||
|
volumeMounts:
|
||||||
|
- name: postgres-creds
|
||||||
|
mountPath: /postgres-creds
|
||||||
|
readOnly: true
|
||||||
|
```
|
||||||
|
|
||||||
|
The secret `authentik-postgres-credentials` must have `username` and `password` keys.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
{{ template "chart.maintainersSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.sourcesSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.requirementsSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.valuesSection" . }}
|
||||||
|
|
||||||
|
---
|
||||||
|
[affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
|
||||||
|
[DNS configuration]: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
|
||||||
|
[HPA]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
|
||||||
|
[MetricRelabelConfigs]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
|
||||||
|
[Node selector]: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
|
[PodDisruptionBudget]: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets
|
||||||
|
[probe]: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||||
|
[RelabelConfigs]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
|
||||||
|
[Tolerations]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
[TopologySpreadConstraints]: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
|
||||||
|
[values.yaml]: values.yaml
|
||||||
23
charts/authentik/charts/authentik-remote-cluster/.helmignore
Normal file
23
charts/authentik/charts/authentik-remote-cluster/.helmignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# 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
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
40
charts/authentik/charts/authentik-remote-cluster/Chart.yaml
Normal file
40
charts/authentik/charts/authentik-remote-cluster/Chart.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
annotations:
|
||||||
|
artifacthub.io/license: MIT
|
||||||
|
artifacthub.io/links: |
|
||||||
|
- name: Github
|
||||||
|
url: https://github.com/goauthentik/authentik
|
||||||
|
- name: Docs
|
||||||
|
url: https://goauthentik.io/docs/
|
||||||
|
artifacthub.io/maintainers: |
|
||||||
|
- name: authentik Team
|
||||||
|
email: hello@goauthentik.io
|
||||||
|
url: https://goauthentik.io
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2025.4.0
|
||||||
|
description: RBAC required for a remote cluster to be connected to authentik.
|
||||||
|
home: https://goauthentik.io
|
||||||
|
icon: https://goauthentik.io/img/icon.png
|
||||||
|
keywords:
|
||||||
|
- authentication
|
||||||
|
- directory
|
||||||
|
- identity
|
||||||
|
- idp
|
||||||
|
- ldap
|
||||||
|
- oauth
|
||||||
|
- oidc
|
||||||
|
- proxy
|
||||||
|
- saml
|
||||||
|
- scim
|
||||||
|
- single-sign-on
|
||||||
|
- sp
|
||||||
|
- sso
|
||||||
|
maintainers:
|
||||||
|
- email: hello@goauthentik.io
|
||||||
|
name: authentik Team
|
||||||
|
url: https://goauthentik.io
|
||||||
|
name: authentik-remote-cluster
|
||||||
|
sources:
|
||||||
|
- https://goauthentik.io/docs/
|
||||||
|
- https://github.com/goauthentik/authentik
|
||||||
|
type: application
|
||||||
|
version: 2.1.0
|
||||||
39
charts/authentik/charts/authentik-remote-cluster/README.md
Normal file
39
charts/authentik/charts/authentik-remote-cluster/README.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="https://goauthentik.io/img/icon_top_brand_colour.svg" height="150" alt="authentik logo">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[](https://goauthentik.io/discord)
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
RBAC required for a remote cluster to be connected to authentik.
|
||||||
|
|
||||||
|
**Homepage:** <https://goauthentik.io>
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
| Name | Email | Url |
|
||||||
|
| ---- | ------ | --- |
|
||||||
|
| authentik Team | <hello@goauthentik.io> | <https://goauthentik.io> |
|
||||||
|
|
||||||
|
## Source Code
|
||||||
|
|
||||||
|
* <https://goauthentik.io/docs/>
|
||||||
|
* <https://github.com/goauthentik/authentik>
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Key | Type | Default | Description |
|
||||||
|
|-----|------|---------|-------------|
|
||||||
|
| annotations | object | `{}` | Annotations to apply to all resources |
|
||||||
|
| clusterRole.enabled | bool | `true` | Create a clusterole in addition to a namespaced role. |
|
||||||
|
| fullnameOverride | string | `""` | String to fully override `"authentik.fullname"`. Prefer using global.fullnameOverride if possible |
|
||||||
|
| global.additionalLabels | object | `{}` | Common labels for all resources. |
|
||||||
|
| global.fullnameOverride | string | `""` | String to fully override `"authentik.fullname"` |
|
||||||
|
| global.nameOverride | string | `""` | Provide a name in place of `authentik` |
|
||||||
|
| global.namespaceOverride | string | `""` | A custom namespace to override the default namespace for the deployed resources. |
|
||||||
|
| kubeVersionOverride | string | `""` | Override the Kubernetes version, which is used to evaluate certain manifests |
|
||||||
|
| nameOverride | string | `""` | Provide a name in place of `authentik`. Prefer using global.nameOverride if possible |
|
||||||
|
| serviceAccountSecret.enabled | bool | `true` | Create a secret with the service account credentials |
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="https://goauthentik.io/img/icon_top_brand_colour.svg" height="150" alt="authentik logo">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[](https://goauthentik.io/discord)
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
{{ template "chart.deprecationWarning" . }}
|
||||||
|
|
||||||
|
{{ template "chart.description" . }}
|
||||||
|
|
||||||
|
{{ template "chart.homepageLine" . }}
|
||||||
|
|
||||||
|
{{ template "chart.maintainersSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.sourcesSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.requirementsSection" . }}
|
||||||
|
|
||||||
|
{{ template "chart.valuesSection" . }}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
Run the commands below to get a kubeconfig file for authentik:
|
||||||
|
|
||||||
|
KUBE_API=$(kubectl config view --minify --output jsonpath="{.clusters[*].cluster.server}")
|
||||||
|
NAMESPACE={{ .Release.Namespace }}
|
||||||
|
SECRET_NAME=$(kubectl get serviceaccount {{ include "authentik-remote-cluster.fullname" . }} -o jsonpath='{.secrets[0].name}' 2>/dev/null || echo -n "{{ include "authentik-remote-cluster.fullname" . }}")
|
||||||
|
KUBE_CA=$(kubectl -n $NAMESPACE get secret/$SECRET_NAME -o jsonpath='{.data.ca\.crt}')
|
||||||
|
KUBE_TOKEN=$(kubectl -n $NAMESPACE get secret/$SECRET_NAME -o jsonpath='{.data.token}' | base64 --decode)
|
||||||
|
|
||||||
|
echo "apiVersion: v1
|
||||||
|
kind: Config
|
||||||
|
clusters:
|
||||||
|
- name: default-cluster
|
||||||
|
cluster:
|
||||||
|
certificate-authority-data: ${KUBE_CA}
|
||||||
|
server: ${KUBE_API}
|
||||||
|
contexts:
|
||||||
|
- name: default-context
|
||||||
|
context:
|
||||||
|
cluster: default-cluster
|
||||||
|
namespace: $NAMESPACE
|
||||||
|
user: authentik-user
|
||||||
|
current-context: default-context
|
||||||
|
users:
|
||||||
|
- name: authentik-user
|
||||||
|
user:
|
||||||
|
token: ${KUBE_TOKEN}"
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart
|
||||||
|
*/}}
|
||||||
|
{{- define "authentik-remote-cluster.name" -}}
|
||||||
|
{{- $globalNameOverride := "" -}}
|
||||||
|
{{- if hasKey .Values "global" -}}
|
||||||
|
{{- $globalNameOverride = (default $globalNameOverride .Values.global.nameOverride) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- default .Chart.Name (default .Values.nameOverride $globalNameOverride) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Determine the namespace to use, allowing for a namespace override.
|
||||||
|
*/}}
|
||||||
|
{{- define "authauthentik-remote-cluster.namespace" -}}
|
||||||
|
{{- if .Values.namespaceOverride }}
|
||||||
|
{{- .Values.namespaceOverride }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Release.Namespace }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "authentik-remote-cluster.fullname" -}}
|
||||||
|
{{- $name := include "authentik-remote-cluster.name" . -}}
|
||||||
|
{{- $globalFullNameOverride := "" -}}
|
||||||
|
{{- if hasKey .Values "global" -}}
|
||||||
|
{{- $globalFullNameOverride = (default $globalFullNameOverride .Values.global.fullnameOverride) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if or .Values.fullnameOverride $globalFullNameOverride -}}
|
||||||
|
{{- $name = default .Values.fullnameOverride $globalFullNameOverride -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- if contains $name .Release.Name -}}
|
||||||
|
{{- $name = .Release.Name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name = printf "%s-%s" .Release.Name $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- trunc 63 $name | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "authentik-remote-cluster.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "authentik-remote-cluster.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "authentik-remote-cluster.chart" .context | quote }}
|
||||||
|
app.kubernetes.io/name: {{ include "authentik-remote-cluster.name" .context | quote }}
|
||||||
|
app.kubernetes.io/instance: {{ .context.Release.Name | quote }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .context.Release.Service | quote }}
|
||||||
|
app.kubernetes.io/part-of: "authentik"
|
||||||
|
app.kubernetes.io/version: {{ .context.Chart.Version | quote }}
|
||||||
|
{{- with .context.Values.global.additionalLabels }}
|
||||||
|
{{ toYaml . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "authentik-remote-cluster.api-verbs-rw" -}}
|
||||||
|
- get
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
{{- end -}}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
{{- if .Values.clusterRole.enabled -}}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-%s" (include "authentik-remote-cluster.fullname" .) (include "authauthentik-remote-cluster.namespace" .) | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- apiextensions.k8s.io
|
||||||
|
resources:
|
||||||
|
- customresourcedefinitions
|
||||||
|
verbs:
|
||||||
|
- list
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
{{- if .Values.clusterRole.enabled -}}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-%s" (include "authentik-remote-cluster.fullname" .) (include "authauthentik-remote-cluster.namespace" .) | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: {{ printf "%s-%s" (include "authentik-remote-cluster.fullname" .) (include "authauthentik-remote-cluster.namespace" .) | quote }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- secrets
|
||||||
|
- services
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
{{- include "authentik-remote-cluster.api-verbs-rw" . | nindent 6 }}
|
||||||
|
- apiGroups:
|
||||||
|
- extensions
|
||||||
|
- apps
|
||||||
|
resources:
|
||||||
|
- deployments
|
||||||
|
verbs:
|
||||||
|
{{- include "authentik-remote-cluster.api-verbs-rw" . | nindent 6 }}
|
||||||
|
- apiGroups:
|
||||||
|
- extensions
|
||||||
|
- networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- ingresses
|
||||||
|
verbs:
|
||||||
|
{{- include "authentik-remote-cluster.api-verbs-rw" . | nindent 6 }}
|
||||||
|
- apiGroups:
|
||||||
|
- traefik.containo.us
|
||||||
|
- traefik.io
|
||||||
|
resources:
|
||||||
|
- middlewares
|
||||||
|
verbs:
|
||||||
|
{{- include "authentik-remote-cluster.api-verbs-rw" . | nindent 6 }}
|
||||||
|
- apiGroups:
|
||||||
|
- gateway.networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- httproutes
|
||||||
|
verbs:
|
||||||
|
{{- include "authentik-remote-cluster.api-verbs-rw" . | nindent 6 }}
|
||||||
|
- apiGroups:
|
||||||
|
- monitoring.coreos.com
|
||||||
|
resources:
|
||||||
|
- servicemonitors
|
||||||
|
verbs:
|
||||||
|
{{- include "authentik-remote-cluster.api-verbs-rw" . | nindent 6 }}
|
||||||
|
- apiGroups:
|
||||||
|
- apiextensions.k8s.io
|
||||||
|
resources:
|
||||||
|
- customresourcedefinitions
|
||||||
|
verbs:
|
||||||
|
- list
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
{{- if .Values.serviceAccountSecret.enabled -}}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/service-account.name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: kubernetes.io/service-account-token
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ template "authentik-remote-cluster.fullname" . }}
|
||||||
|
namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
30
charts/authentik/charts/authentik-remote-cluster/values.yaml
Normal file
30
charts/authentik/charts/authentik-remote-cluster/values.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
# -- Provide a name in place of `authentik`. Prefer using global.nameOverride if possible
|
||||||
|
nameOverride: ""
|
||||||
|
# -- String to fully override `"authentik.fullname"`. Prefer using global.fullnameOverride if possible
|
||||||
|
fullnameOverride: ""
|
||||||
|
# -- Override the Kubernetes version, which is used to evaluate certain manifests
|
||||||
|
kubeVersionOverride: ""
|
||||||
|
|
||||||
|
## Globally shared configuration for authentik components.
|
||||||
|
global:
|
||||||
|
# -- Provide a name in place of `authentik`
|
||||||
|
nameOverride: ""
|
||||||
|
# -- String to fully override `"authentik.fullname"`
|
||||||
|
fullnameOverride: ""
|
||||||
|
# -- A custom namespace to override the default namespace for the deployed resources.
|
||||||
|
namespaceOverride: ""
|
||||||
|
# -- Common labels for all resources.
|
||||||
|
additionalLabels: {}
|
||||||
|
# app: authentik
|
||||||
|
|
||||||
|
# -- Annotations to apply to all resources
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
serviceAccountSecret:
|
||||||
|
# -- Create a secret with the service account credentials
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
clusterRole:
|
||||||
|
# -- Create a clusterole in addition to a namespaced role.
|
||||||
|
enabled: true
|
||||||
25
charts/authentik/charts/postgresql/.helmignore
Normal file
25
charts/authentik/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
|
||||||
6
charts/authentik/charts/postgresql/Chart.lock
Normal file
6
charts/authentik/charts/postgresql/Chart.lock
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 2.30.0
|
||||||
|
digest: sha256:46afdf79eae69065904d430f03f7e5b79a148afed20aa45ee83ba88adc036169
|
||||||
|
generated: "2025-02-20T02:43:09.054508088Z"
|
||||||
38
charts/authentik/charts/postgresql/Chart.yaml
Normal file
38
charts/authentik/charts/postgresql/Chart.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
annotations:
|
||||||
|
category: Database
|
||||||
|
images: |
|
||||||
|
- name: os-shell
|
||||||
|
image: docker.io/bitnami/os-shell:12-debian-12-r43
|
||||||
|
- name: postgres-exporter
|
||||||
|
image: docker.io/bitnami/postgres-exporter:0.17.1-debian-12-r7
|
||||||
|
- name: postgresql
|
||||||
|
image: docker.io/bitnami/postgresql:17.5.0-debian-12-r3
|
||||||
|
licenses: Apache-2.0
|
||||||
|
tanzuCategory: service
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 17.5.0
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
tags:
|
||||||
|
- bitnami-common
|
||||||
|
version: 2.x.x
|
||||||
|
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: 16.7.4
|
||||||
1141
charts/authentik/charts/postgresql/README.md
Normal file
1141
charts/authentik/charts/postgresql/README.md
Normal file
File diff suppressed because it is too large
Load Diff
26
charts/authentik/charts/postgresql/charts/common/.helmignore
Normal file
26
charts/authentik/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
|
||||||
23
charts/authentik/charts/postgresql/charts/common/Chart.yaml
Normal file
23
charts/authentik/charts/postgresql/charts/common/Chart.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
annotations:
|
||||||
|
category: Infrastructure
|
||||||
|
licenses: Apache-2.0
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2.30.0
|
||||||
|
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.30.0
|
||||||
235
charts/authentik/charts/postgresql/charts/common/README.md
Normal file
235
charts/authentik/charts/postgresql/charts/common/README.md
Normal file
@ -0,0 +1,235 @@
|
|||||||
|
# Bitnami Common Library Chart
|
||||||
|
|
||||||
|
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between Bitnami charts.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
version: 2.x.x
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
```
|
||||||
|
|
||||||
|
```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.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment and management of Helm Charts in clusters.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Kubernetes 1.23+
|
||||||
|
- Helm 3.8.0+
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
## 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,155 @@
|
|||||||
|
{{/*
|
||||||
|
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 }}
|
||||||
|
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 8 }}
|
||||||
|
{{- 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 }}
|
||||||
|
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,253 @@
|
|||||||
|
{{/*
|
||||||
|
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" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.21-0" $kubeVersion) -}}
|
||||||
|
{{- print "policy/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "policy/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for networkpolicy.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.networkPolicy.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.7-0" $kubeVersion) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for job.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.job.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.21-0" $kubeVersion) -}}
|
||||||
|
{{- print "batch/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "batch/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for cronjob.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.cronjob.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.21-0" $kubeVersion) -}}
|
||||||
|
{{- print "batch/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "batch/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for daemonset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.daemonset.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.14-0" $kubeVersion) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for deployment.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.deployment.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.14-0" $kubeVersion) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for statefulset.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.statefulset.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.14-0" $kubeVersion) -}}
|
||||||
|
{{- print "apps/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apps/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for ingress.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if (.Values.ingress).apiVersion -}}
|
||||||
|
{{- .Values.ingress.apiVersion -}}
|
||||||
|
{{- else if and (not (empty $kubeVersion)) (semverCompare "<1.14-0" $kubeVersion) -}}
|
||||||
|
{{- print "extensions/v1beta1" -}}
|
||||||
|
{{- else if and (not (empty $kubeVersion)) (semverCompare "<1.19-0" $kubeVersion) -}}
|
||||||
|
{{- print "networking.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for RBAC resources.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.rbac.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.17-0" $kubeVersion) -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "rbac.authorization.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for CRDs.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.crd.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.19-0" $kubeVersion) -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apiextensions.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for APIService.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.apiService.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.10-0" $kubeVersion) -}}
|
||||||
|
{{- print "apiregistration.k8s.io/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "apiregistration.k8s.io/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for Horizontal Pod Autoscaler.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.hpa.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" .context -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.23-0" $kubeVersion) -}}
|
||||||
|
{{- if .beta2 -}}
|
||||||
|
{{- print "autoscaling/v2beta2" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "autoscaling/v2beta1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "autoscaling/v2" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for Vertical Pod Autoscaler.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.vpa.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" .context -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.11-0" $kubeVersion) -}}
|
||||||
|
{{- print "autoscaling/v1beta1" -}}
|
||||||
|
{{- else 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" . -}}
|
||||||
|
{{- if or (empty $kubeVersion) (not (semverCompare "<1.23-0" $kubeVersion)) -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for AdmissionConfiguration.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.capabilities.admissionConfiguration.apiVersion" -}}
|
||||||
|
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
|
||||||
|
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.23-0" $kubeVersion) -}}
|
||||||
|
{{- print "apiserver.config.k8s.io/v1alpha1" -}}
|
||||||
|
{{- else 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.23-0" $kubeVersion) -}}
|
||||||
|
{{- print "pod-security.admission.config.k8s.io/v1alpha1" -}}
|
||||||
|
{{- else 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,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,85 @@
|
|||||||
|
{{/*
|
||||||
|
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 -}}
|
||||||
|
{{- $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 -}}
|
||||||
|
{{- 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 Tanzu Application Catalog 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 or (contains "docker.io/bitnami/" $originalImages) (contains "docker.io/bitnamiprem/" $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 Tanzu Application Catalog 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,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,73 @@
|
|||||||
|
{{/*
|
||||||
|
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" -}}
|
||||||
|
{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .context) -}}
|
||||||
|
{{- if or (eq $apiVersion "extensions/v1beta1") (eq $apiVersion "networking.k8s.io/v1beta1") -}}
|
||||||
|
serviceName: {{ .serviceName }}
|
||||||
|
servicePort: {{ .servicePort }}
|
||||||
|
{{- else -}}
|
||||||
|
service:
|
||||||
|
name: {{ .serviceName }}
|
||||||
|
port:
|
||||||
|
{{- if typeIs "string" .servicePort }}
|
||||||
|
name: {{ .servicePort }}
|
||||||
|
{{- else if or (typeIs "int" .servicePort) (typeIs "float64" .servicePort) }}
|
||||||
|
number: {{ .servicePort | int }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Print "true" if the API pathType field is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.supportsPathType" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.supportsPathType" -}}
|
||||||
|
{{- if (semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .)) -}}
|
||||||
|
{{- print "false" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "true" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Returns true if the ingressClassname field is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.supportsIngressClassname" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.supportsIngressClassname" -}}
|
||||||
|
{{- if semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||||
|
{{- print "false" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "true" -}}
|
||||||
|
{{- 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: {{ . | 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,71 @@
|
|||||||
|
{{/*
|
||||||
|
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 -}}
|
||||||
|
{{- if contains $name .Release.Name -}}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" .Release.Name $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 = $providedPasswordValue | toString }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if not $password }}
|
||||||
|
{{- if $providedPasswordValue }}
|
||||||
|
{{- $password = $providedPasswordValue | toString }}
|
||||||
|
{{- 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
|
||||||
121
charts/authentik/charts/postgresql/templates/NOTES.txt
Normal file
121
charts/authentik/charts/postgresql/templates/NOTES.txt
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
{{- $releaseNamespace := include "common.names.namespace" . }}
|
||||||
|
CHART NAME: {{ .Chart.Name }}
|
||||||
|
CHART VERSION: {{ .Chart.Version }}
|
||||||
|
APP VERSION: {{ .Chart.AppVersion }}
|
||||||
|
|
||||||
|
Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information.
|
||||||
|
|
||||||
|
** 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" $) }}
|
||||||
460
charts/authentik/charts/postgresql/templates/_helpers.tpl
Normal file
460
charts/authentik/charts/postgresql/templates/_helpers.tpl
Normal file
@ -0,0 +1,460 @@
|
|||||||
|
{{/*
|
||||||
|
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 }}
|
||||||
|
{{- if contains "bitnami/" .Values.image.repository }}
|
||||||
|
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
|
||||||
|
{{- end }}
|
||||||
|
{{- 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 -}}
|
||||||
147
charts/authentik/charts/postgresql/templates/backup/cronjob.yaml
Normal file
147
charts/authentik/charts/postgresql/templates/backup/cronjob.yaml
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
{{- /*
|
||||||
|
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 .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 }}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.backup.enabled .Values.backup.cronjob.networkPolicy.enabled }}
|
||||||
|
kind: NetworkPolicy
|
||||||
|
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.fullname" . }}-pgdumpall
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: pg_dumpall
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: pg_dumpall
|
||||||
|
policyTypes:
|
||||||
|
- Egress
|
||||||
|
egress:
|
||||||
|
- ports:
|
||||||
|
- port: 5432
|
||||||
|
protocol: TCP
|
||||||
|
- port: 53
|
||||||
|
protocol: TCP
|
||||||
|
- port: 53
|
||||||
|
protocol: UDP
|
||||||
|
{{- end }}
|
||||||
34
charts/authentik/charts/postgresql/templates/backup/pvc.yaml
Normal file
34
charts/authentik/charts/postgresql/templates/backup/pvc.yaml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.backup.enabled .Values.backup.cronjob.storage.enabled (not .Values.backup.cronjob.storage.existingClaim) -}}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
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
|
||||||
|
{{- if or .Values.backup.cronjob.annotations .Values.commonAnnotations .Values.backup.cronjob.storage.resourcePolicy }}
|
||||||
|
annotations:
|
||||||
|
{{- if or .Values.backup.cronjob.annotations .Values.commonAnnotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backup.cronjob.storage.resourcePolicy }}
|
||||||
|
helm.sh/resource-policy: {{ .Values.backup.cronjob.storage.resourcePolicy | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.backup.cronjob.storage.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.backup.cronjob.storage.size | quote }}
|
||||||
|
{{ include "common.storage.class" (dict "persistence" .Values.backup.cronjob.storage "global" .Values.global) }}
|
||||||
|
{{- 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 }}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if (include "postgresql.v1.primary.createConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-configuration" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
{{- if .Values.primary.configuration }}
|
||||||
|
postgresql.conf: |
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.configuration "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.pgHbaConfiguration }}
|
||||||
|
pg_hba.conf: |
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.pgHbaConfiguration "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if (include "postgresql.v1.primary.createExtendedConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-extended-configuration" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
override.conf: |-
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.extendedConfiguration "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.primary.initdb.scripts (not .Values.primary.initdb.scriptsConfigMap) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-init-scripts" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data: {{- include "common.tplvalues.render" (dict "value" .Values.primary.initdb.scripts "context" .) | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.customMetrics }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-metrics" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
custom-metrics.yaml: {{ toYaml .Values.metrics.customMetrics | quote }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-metrics" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: metrics
|
||||||
|
{{- if or .Values.commonAnnotations .Values.metrics.service.annotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.service.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
sessionAffinity: {{ .Values.metrics.service.sessionAffinity }}
|
||||||
|
{{- if .Values.metrics.service.clusterIP }}
|
||||||
|
clusterIP: {{ .Values.metrics.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: http-metrics
|
||||||
|
port: {{ .Values.metrics.service.ports.metrics }}
|
||||||
|
targetPort: http-metrics
|
||||||
|
{{- $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
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.primary.networkPolicy.enabled }}
|
||||||
|
kind: NetworkPolicy
|
||||||
|
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
|
- Egress
|
||||||
|
{{- if .Values.primary.networkPolicy.allowExternalEgress }}
|
||||||
|
egress:
|
||||||
|
- {}
|
||||||
|
{{- else }}
|
||||||
|
egress:
|
||||||
|
# Allow dns resolution
|
||||||
|
- ports:
|
||||||
|
- port: 53
|
||||||
|
protocol: UDP
|
||||||
|
- port: 53
|
||||||
|
protocol: TCP
|
||||||
|
# Allow outbound connections to read-replicas
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.containerPorts.postgresql }}
|
||||||
|
to:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if .Values.primary.networkPolicy.extraEgress }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ingress:
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- port: {{ .Values.metrics.containerPorts.metrics }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.primary.networkPolicy.allowExternal }}
|
||||||
|
from:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{ template "postgresql.v1.primary.fullname" . }}-client: "true"
|
||||||
|
{{- if .Values.primary.networkPolicy.ingressNSMatchLabels }}
|
||||||
|
- namespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- range $key, $value := .Values.primary.networkPolicy.ingressNSMatchLabels }}
|
||||||
|
{{ $key | quote }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.networkPolicy.ingressNSPodMatchLabels }}
|
||||||
|
podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- range $key, $value := .Values.primary.networkPolicy.ingressNSPodMatchLabels }}
|
||||||
|
{{ $key | quote }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.networkPolicy.extraIngress }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -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 "postgresql.v1.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
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,17 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.primary.preInitDb.scripts (not .Values.primary.preInitDb.scriptsConfigMap) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-preinit-scripts" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data: {{- include "common.tplvalues.render" (dict "value" .Values.primary.preInitDb.scripts "context" .) | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{- /*
|
||||||
|
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 "postgresql.v1.primary.fullname" . }}
|
||||||
|
namespace: {{ coalesce .Values.metrics.serviceMonitor.namespace (include "common.names.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/component: metrics
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.metrics.serviceMonitor.jobLabel }}
|
||||||
|
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
{{- $svcLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.selector .Values.commonLabels ) "context" . ) }}
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $svcLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: metrics
|
||||||
|
endpoints:
|
||||||
|
- port: http-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.relabelings }}
|
||||||
|
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
{{- end }}
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,705 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if or .Values.commonAnnotations .Values.primary.annotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
serviceName: {{ include "postgresql.v1.primary.svc.headless" . }}
|
||||||
|
{{- if .Values.primary.updateStrategy }}
|
||||||
|
updateStrategy: {{- toYaml .Values.primary.updateStrategy | nindent 4 }}
|
||||||
|
{{- 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
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if or .Values.passwordUpdateJob.enabled (include "postgresql.v1.primary.createConfigmap" .) (include "postgresql.v1.primary.createExtendedConfigmap" .) .Values.primary.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if (include "postgresql.v1.primary.createConfigmap" .) }}
|
||||||
|
checksum/configuration: {{ pick (include (print $.Template.BasePath "/primary/configmap.yaml") . | fromYaml) "data" | toYaml | sha256sum }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if (include "postgresql.v1.primary.createExtendedConfigmap" .) }}
|
||||||
|
checksum/extended-configuration: {{ pick (include (print $.Template.BasePath "/primary/extended-configmap.yaml") . | fromYaml) "data" | toYaml | 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 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.primary.extraPodSpec }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.primary.extraPodSpec "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ include "postgresql.v1.serviceAccountName" . }}
|
||||||
|
{{- include "postgresql.v1.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 .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.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.primary.topologySpreadConstraints "context" .) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.primary.priorityClassName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.schedulerName }}
|
||||||
|
schedulerName: {{ .Values.primary.schedulerName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.terminationGracePeriodSeconds }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.primary.terminationGracePeriodSeconds }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.primary.podSecurityContext "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
hostNetwork: {{ .Values.primary.hostNetwork }}
|
||||||
|
hostIPC: {{ .Values.primary.hostIPC }}
|
||||||
|
{{- if or (and .Values.tls.enabled (not .Values.volumePermissions.enabled)) (and .Values.volumePermissions.enabled (or .Values.primary.persistence.enabled .Values.shmVolume.enabled)) .Values.primary.initContainers }}
|
||||||
|
initContainers:
|
||||||
|
{{- if and .Values.tls.enabled (not .Values.volumePermissions.enabled) }}
|
||||||
|
- name: copy-certs
|
||||||
|
image: {{ include "postgresql.v1.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
{{- 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 }}
|
||||||
|
# We don't require a privileged container in this case
|
||||||
|
{{- if .Values.primary.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.primary.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
cp /tmp/certs/* /opt/bitnami/postgresql/certs/
|
||||||
|
chmod 600 {{ include "postgresql.v1.tlsCertKey" . }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: raw-certificates
|
||||||
|
mountPath: /tmp/certs
|
||||||
|
- name: postgresql-certificates
|
||||||
|
mountPath: /opt/bitnami/postgresql/certs
|
||||||
|
{{- else if and .Values.volumePermissions.enabled (or .Values.primary.persistence.enabled .Values.shmVolume.enabled) }}
|
||||||
|
- name: init-chmod-data
|
||||||
|
image: {{ include "postgresql.v1.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
{{- 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 }}
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
{{- if .Values.primary.persistence.enabled }}
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
chown `id -u`:`id -G | cut -d " " -f2` {{ .Values.primary.persistence.mountPath }}
|
||||||
|
{{- else }}
|
||||||
|
chown {{ .Values.primary.containerSecurityContext.runAsUser }}:{{ .Values.primary.podSecurityContext.fsGroup }} {{ .Values.primary.persistence.mountPath }}
|
||||||
|
{{- end }}
|
||||||
|
mkdir -p {{ .Values.primary.persistence.mountPath }}/data {{- if (include "postgresql.v1.mountConfigurationCM" .) }} {{ .Values.primary.persistence.mountPath }}/conf {{- end }}
|
||||||
|
chmod 700 {{ .Values.primary.persistence.mountPath }}/data {{- if (include "postgresql.v1.mountConfigurationCM" .) }} {{ .Values.primary.persistence.mountPath }}/conf {{- end }}
|
||||||
|
find {{ .Values.primary.persistence.mountPath }} -mindepth 1 -maxdepth 1 {{- if not (include "postgresql.v1.mountConfigurationCM" .) }} -not -name "conf" {{- end }} -not -name ".snapshot" -not -name "lost+found" | \
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
xargs -r chown -R `id -u`:`id -G | cut -d " " -f2`
|
||||||
|
{{- else }}
|
||||||
|
xargs -r chown -R {{ .Values.primary.containerSecurityContext.runAsUser }}:{{ .Values.primary.podSecurityContext.fsGroup }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
chmod -R 777 /dev/shm
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
cp /tmp/certs/* /opt/bitnami/postgresql/certs/
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
chown -R `id -u`:`id -G | cut -d " " -f2` /opt/bitnami/postgresql/certs/
|
||||||
|
{{- else }}
|
||||||
|
chown -R {{ .Values.primary.containerSecurityContext.runAsUser }}:{{ .Values.primary.podSecurityContext.fsGroup }} /opt/bitnami/postgresql/certs/
|
||||||
|
{{- end }}
|
||||||
|
chmod 600 {{ include "postgresql.v1.tlsCertKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
|
||||||
|
{{- else }}
|
||||||
|
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: {{ .Values.primary.persistence.volumeName }}
|
||||||
|
mountPath: {{ .Values.primary.persistence.mountPath }}
|
||||||
|
{{- if .Values.primary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.primary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
- name: dshm
|
||||||
|
mountPath: /dev/shm
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: raw-certificates
|
||||||
|
mountPath: /tmp/certs
|
||||||
|
- name: postgresql-certificates
|
||||||
|
mountPath: /opt/bitnami/postgresql/certs
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.initContainers "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: postgresql
|
||||||
|
image: {{ include "postgresql.v1.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 }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||||
|
- name: POSTGRESQL_PORT_NUMBER
|
||||||
|
value: {{ .Values.containerPorts.postgresql | quote }}
|
||||||
|
- name: POSTGRESQL_VOLUME_DIR
|
||||||
|
value: {{ .Values.primary.persistence.mountPath | quote }}
|
||||||
|
{{- if .Values.primary.persistence.mountPath }}
|
||||||
|
- name: PGDATA
|
||||||
|
value: {{ .Values.postgresqlDataDir | quote }}
|
||||||
|
{{- end }}
|
||||||
|
# Authentication
|
||||||
|
{{- if or (eq $customUser "postgres") (empty $customUser) }}
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.adminPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
- name: ALLOW_EMPTY_PASSWORD
|
||||||
|
value: "true"
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
value: {{ $customUser | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.userPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.userPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_POSTGRES_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.adminPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if (include "postgresql.v1.database" .) }}
|
||||||
|
- name: POSTGRES_DATABASE
|
||||||
|
value: {{ (include "postgresql.v1.database" .) | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or (eq .Values.architecture "replication") .Values.primary.standby.enabled }}
|
||||||
|
# Replication
|
||||||
|
- name: POSTGRES_REPLICATION_MODE
|
||||||
|
value: {{ ternary "slave" "master" .Values.primary.standby.enabled | quote }}
|
||||||
|
- name: POSTGRES_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUsername | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_REPLICATION_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.replicationPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.replicationPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if ne .Values.replication.synchronousCommit "off" }}
|
||||||
|
- name: POSTGRES_SYNCHRONOUS_COMMIT_MODE
|
||||||
|
value: {{ .Values.replication.synchronousCommit | quote }}
|
||||||
|
- name: POSTGRES_NUM_SYNCHRONOUS_REPLICAS
|
||||||
|
value: {{ .Values.replication.numSynchronousReplicas | quote }}
|
||||||
|
{{- end }}
|
||||||
|
- name: POSTGRES_CLUSTER_APP_NAME
|
||||||
|
value: {{ .Values.replication.applicationName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initdb.args }}
|
||||||
|
# Initdb
|
||||||
|
- name: POSTGRES_INITDB_ARGS
|
||||||
|
value: {{ .Values.primary.initdb.args | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initdb.postgresqlWalDir }}
|
||||||
|
- name: POSTGRES_INITDB_WALDIR
|
||||||
|
value: {{ .Values.primary.initdb.postgresqlWalDir | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initdb.user }}
|
||||||
|
- name: POSTGRES_INITSCRIPTS_USERNAME
|
||||||
|
value: {{ .Values.primary.initdb.user }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initdb.password }}
|
||||||
|
- name: POSTGRES_INITSCRIPTS_PASSWORD
|
||||||
|
value: {{ .Values.primary.initdb.password | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.standby.enabled }}
|
||||||
|
# Standby
|
||||||
|
- name: POSTGRES_MASTER_HOST
|
||||||
|
value: {{ .Values.primary.standby.primaryHost }}
|
||||||
|
- name: POSTGRES_MASTER_PORT_NUMBER
|
||||||
|
value: {{ .Values.primary.standby.primaryPort | quote }}
|
||||||
|
{{- end }}
|
||||||
|
# LDAP
|
||||||
|
- name: POSTGRESQL_ENABLE_LDAP
|
||||||
|
value: {{ ternary "yes" "no" .Values.ldap.enabled | quote }}
|
||||||
|
{{- if .Values.ldap.enabled }}
|
||||||
|
{{- if or .Values.ldap.url .Values.ldap.uri }}
|
||||||
|
- name: POSTGRESQL_LDAP_URL
|
||||||
|
value: {{ coalesce .Values.ldap.url .Values.ldap.uri }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRESQL_LDAP_SERVER
|
||||||
|
value: {{ .Values.ldap.server }}
|
||||||
|
- name: POSTGRESQL_LDAP_PORT
|
||||||
|
value: {{ .Values.ldap.port | quote }}
|
||||||
|
- name: POSTGRESQL_LDAP_SCHEME
|
||||||
|
value: {{ .Values.ldap.scheme }}
|
||||||
|
{{- if (include "postgresql.v1.ldap.tls.enabled" .) }}
|
||||||
|
- name: POSTGRESQL_LDAP_TLS
|
||||||
|
value: "1"
|
||||||
|
{{- end }}
|
||||||
|
- name: POSTGRESQL_LDAP_PREFIX
|
||||||
|
value: {{ .Values.ldap.prefix | quote }}
|
||||||
|
- name: POSTGRESQL_LDAP_SUFFIX
|
||||||
|
value: {{ .Values.ldap.suffix | quote }}
|
||||||
|
- name: POSTGRESQL_LDAP_BASE_DN
|
||||||
|
value: {{ coalesce .Values.ldap.baseDN .Values.ldap.basedn }}
|
||||||
|
- name: POSTGRESQL_LDAP_BIND_DN
|
||||||
|
value: {{ coalesce .Values.ldap.bindDN .Values.ldap.binddn}}
|
||||||
|
{{- if or (not (empty .Values.ldap.bind_password)) (not (empty .Values.ldap.bindpw)) }}
|
||||||
|
- name: POSTGRESQL_LDAP_BIND_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: ldap-password
|
||||||
|
{{- end }}
|
||||||
|
- name: POSTGRESQL_LDAP_SEARCH_ATTR
|
||||||
|
value: {{ coalesce .Values.ldap.search_attr .Values.ldap.searchAttribute }}
|
||||||
|
- name: POSTGRESQL_LDAP_SEARCH_FILTER
|
||||||
|
value: {{ coalesce .Values.ldap.search_filter .Values.ldap.searchFilter }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
# TLS
|
||||||
|
- name: POSTGRESQL_ENABLE_TLS
|
||||||
|
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: POSTGRESQL_TLS_PREFER_SERVER_CIPHERS
|
||||||
|
value: {{ ternary "yes" "no" .Values.tls.preferServerCiphers | quote }}
|
||||||
|
- name: POSTGRESQL_TLS_CERT_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCert" . }}
|
||||||
|
- name: POSTGRESQL_TLS_KEY_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCertKey" . }}
|
||||||
|
{{- if .Values.tls.certCAFilename }}
|
||||||
|
- name: POSTGRESQL_TLS_CA_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCACert" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.crlFilename }}
|
||||||
|
- name: POSTGRESQL_TLS_CRL_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCRL" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
# Audit
|
||||||
|
- name: POSTGRESQL_LOG_HOSTNAME
|
||||||
|
value: {{ .Values.audit.logHostname | quote }}
|
||||||
|
- name: POSTGRESQL_LOG_CONNECTIONS
|
||||||
|
value: {{ .Values.audit.logConnections | quote }}
|
||||||
|
- name: POSTGRESQL_LOG_DISCONNECTIONS
|
||||||
|
value: {{ .Values.audit.logDisconnections | quote }}
|
||||||
|
{{- if .Values.audit.logLinePrefix }}
|
||||||
|
- name: POSTGRESQL_LOG_LINE_PREFIX
|
||||||
|
value: {{ .Values.audit.logLinePrefix | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.audit.logTimezone }}
|
||||||
|
- name: POSTGRESQL_LOG_TIMEZONE
|
||||||
|
value: {{ .Values.audit.logTimezone | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.audit.pgAuditLog }}
|
||||||
|
- name: POSTGRESQL_PGAUDIT_LOG
|
||||||
|
value: {{ .Values.audit.pgAuditLog | quote }}
|
||||||
|
{{- end }}
|
||||||
|
- name: POSTGRESQL_PGAUDIT_LOG_CATALOG
|
||||||
|
value: {{ .Values.audit.pgAuditLogCatalog | quote }}
|
||||||
|
# Others
|
||||||
|
- name: POSTGRESQL_CLIENT_MIN_MESSAGES
|
||||||
|
value: {{ .Values.audit.clientMinMessages | quote }}
|
||||||
|
- name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES
|
||||||
|
value: {{ .Values.postgresqlSharedPreloadLibraries | quote }}
|
||||||
|
{{- 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: tcp-postgresql
|
||||||
|
containerPort: {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- 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: {{- include "common.tplvalues.render" (dict "value" (omit .Values.primary.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
{{- if (include "postgresql.v1.database" .) }}
|
||||||
|
- exec pg_isready -U {{ default "postgres" $customUser | quote }} -d "dbname={{ include "postgresql.v1.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} 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 and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.v1.tlsCert" . }} sslkey={{ include "postgresql.v1.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- end }}
|
||||||
|
{{- 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: {{- include "common.tplvalues.render" (dict "value" (omit .Values.primary.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
{{- if (include "postgresql.v1.database" .) }}
|
||||||
|
- exec pg_isready -U {{ default "postgres" $customUser | quote }} -d "dbname={{ include "postgresql.v1.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} 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 and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.v1.tlsCert" . }} sslkey={{ include "postgresql.v1.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- end }}
|
||||||
|
{{- 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: {{- include "common.tplvalues.render" (dict "value" (omit .Values.primary.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- -e
|
||||||
|
{{- include "postgresql.v1.readinessProbeCommand" . | nindent 16 }}
|
||||||
|
{{- 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 }}
|
||||||
|
{{- if .Values.primary.lifecycleHooks }}
|
||||||
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.primary.lifecycleHooks "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/postgresql/conf
|
||||||
|
subPath: app-conf-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/postgresql/tmp
|
||||||
|
subPath: app-tmp-dir
|
||||||
|
{{- if or .Values.primary.preInitDb.scriptsConfigMap .Values.primary.preInitDb.scripts }}
|
||||||
|
- name: custom-preinit-scripts
|
||||||
|
mountPath: /docker-entrypoint-preinitdb.d/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.preInitDb.scriptsSecret }}
|
||||||
|
- name: custom-preinit-scripts-secret
|
||||||
|
mountPath: /docker-entrypoint-preinitdb.d/secret
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.initdb.scriptsConfigMap .Values.primary.initdb.scripts }}
|
||||||
|
- name: custom-init-scripts
|
||||||
|
mountPath: /docker-entrypoint-initdb.d/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initdb.scriptsSecret }}
|
||||||
|
- name: custom-init-scripts-secret
|
||||||
|
mountPath: /docker-entrypoint-initdb.d/secret
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.extendedConfiguration .Values.primary.existingExtendedConfigmap }}
|
||||||
|
- name: postgresql-extended-config
|
||||||
|
mountPath: {{ .Values.primary.persistence.mountPath }}/conf/conf.d/
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (or .Values.auth.enablePostgresUser $customUser) }}
|
||||||
|
- name: postgresql-password
|
||||||
|
mountPath: /opt/bitnami/postgresql/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: postgresql-certificates
|
||||||
|
mountPath: /opt/bitnami/postgresql/certs
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
- name: dshm
|
||||||
|
mountPath: /dev/shm
|
||||||
|
{{- end }}
|
||||||
|
- name: {{ .Values.primary.persistence.volumeName }}
|
||||||
|
mountPath: {{ .Values.primary.persistence.mountPath }}
|
||||||
|
{{- if .Values.primary.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.primary.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.configuration .Values.primary.pgHbaConfiguration .Values.primary.existingConfigmap }}
|
||||||
|
- name: postgresql-config
|
||||||
|
mountPath: {{ .Values.primary.persistence.mountPath }}/conf
|
||||||
|
{{- end }}
|
||||||
|
{{- 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 "postgresql.v1.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 }}
|
||||||
|
{{- 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 if or .Values.metrics.customMetrics .Values.metrics.collectors }}
|
||||||
|
args:
|
||||||
|
{{- if .Values.metrics.customMetrics }}
|
||||||
|
- --extend.query-path
|
||||||
|
- /conf/custom-metrics.yaml
|
||||||
|
{{- end }}
|
||||||
|
{{- range $name, $enabled := .Values.metrics.collectors }}
|
||||||
|
- --{{ if not $enabled }}no-{{ end }}collector.{{ $name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: DATA_SOURCE_URI
|
||||||
|
value: {{ printf "127.0.0.1:%d/postgres?sslmode=disable" (int (include "postgresql.v1.service.port" .)) }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: DATA_SOURCE_PASS_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include (ternary "postgresql.v1.adminPasswordKey" "postgresql.v1.userPasswordKey" (empty $customUser)) .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: DATA_SOURCE_PASS
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include (ternary "postgresql.v1.adminPasswordKey" "postgresql.v1.userPasswordKey" (empty $customUser)) . }}
|
||||||
|
{{- end }}
|
||||||
|
- name: DATA_SOURCE_USER
|
||||||
|
value: {{ default "postgres" $customUser | quote }}
|
||||||
|
{{- if .Values.metrics.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: http-metrics
|
||||||
|
containerPort: {{ .Values.metrics.containerPorts.metrics }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.metrics.customStartupProbe }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customStartupProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.metrics.startupProbe.enabled }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
tcpSocket:
|
||||||
|
port: http-metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.metrics.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http-metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.metrics.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http-metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (or .Values.auth.enablePostgresUser $customUser) }}
|
||||||
|
- name: postgresql-password
|
||||||
|
mountPath: /opt/bitnami/postgresql/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.customMetrics }}
|
||||||
|
- name: custom-metrics
|
||||||
|
mountPath: /conf
|
||||||
|
readOnly: true
|
||||||
|
{{- 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 }}
|
||||||
|
{{- 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.pgHbaConfiguration .Values.primary.existingConfigmap }}
|
||||||
|
- name: postgresql-config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "postgresql.v1.primary.configmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.extendedConfiguration .Values.primary.existingExtendedConfigmap }}
|
||||||
|
- name: postgresql-extended-config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "postgresql.v1.primary.extendedConfigmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (or .Values.auth.enablePostgresUser $customUser) }}
|
||||||
|
- name: postgresql-password
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.preInitDb.scriptsConfigMap .Values.primary.preInitDb.scripts }}
|
||||||
|
- name: custom-preinit-scripts
|
||||||
|
configMap:
|
||||||
|
name: {{ include "postgresql.v1.preInitDb.scriptsCM" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.preInitDb.scriptsSecret }}
|
||||||
|
- name: custom-preinit-scripts-secret
|
||||||
|
secret:
|
||||||
|
secretName: {{ tpl .Values.primary.preInitDb.scriptsSecret $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.primary.initdb.scriptsConfigMap .Values.primary.initdb.scripts }}
|
||||||
|
- name: custom-init-scripts
|
||||||
|
configMap:
|
||||||
|
name: {{ include "postgresql.v1.initdb.scriptsCM" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.initdb.scriptsSecret }}
|
||||||
|
- name: custom-init-scripts-secret
|
||||||
|
secret:
|
||||||
|
secretName: {{ tpl .Values.primary.initdb.scriptsSecret $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: raw-certificates
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "postgresql.v1.tlsSecretName" . }}
|
||||||
|
- name: postgresql-certificates
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.extraVolumes "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.customMetrics }}
|
||||||
|
- name: custom-metrics
|
||||||
|
configMap:
|
||||||
|
name: {{ printf "%s-metrics" (include "postgresql.v1.primary.fullname" .) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
{{- if .Values.shmVolume.sizeLimit }}
|
||||||
|
sizeLimit: {{ .Values.shmVolume.sizeLimit }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.persistence.enabled .Values.primary.persistence.existingClaim }}
|
||||||
|
- name: {{ .Values.primary.persistence.volumeName }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ tpl .Values.primary.persistence.existingClaim $ }}
|
||||||
|
{{- else if not .Values.primary.persistence.enabled }}
|
||||||
|
- name: {{ .Values.primary.persistence.volumeName }}
|
||||||
|
emptyDir: {}
|
||||||
|
{{- else }}
|
||||||
|
{{- if .Values.primary.persistentVolumeClaimRetentionPolicy.enabled }}
|
||||||
|
persistentVolumeClaimRetentionPolicy:
|
||||||
|
whenDeleted: {{ .Values.primary.persistentVolumeClaimRetentionPolicy.whenDeleted }}
|
||||||
|
whenScaled: {{ .Values.primary.persistentVolumeClaimRetentionPolicy.whenScaled }}
|
||||||
|
{{- end }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.primary.persistence.volumeName }}
|
||||||
|
{{- if .Values.primary.persistence.annotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.annotations "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.persistence.labels }}
|
||||||
|
labels: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.labels "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.primary.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.persistence.dataSource }}
|
||||||
|
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.dataSource "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.primary.persistence.size | quote }}
|
||||||
|
{{- if .Values.primary.persistence.selector }}
|
||||||
|
selector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.selector "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- include "common.storage.class" (dict "persistence" .Values.primary.persistence "global" .Values.global) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.svc.headless" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
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 }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
clusterIP: None
|
||||||
|
# We want all pods in the StatefulSet to have their addresses published for
|
||||||
|
# the sake of the other Postgresql pods even before they're ready, since they
|
||||||
|
# have to be able to talk to each other in order to become ready.
|
||||||
|
publishNotReadyAddresses: true
|
||||||
|
ports:
|
||||||
|
- name: tcp-postgresql
|
||||||
|
port: {{ template "postgresql.v1.service.port" . }}
|
||||||
|
targetPort: tcp-postgresql
|
||||||
|
{{- $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,58 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.primary.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := .Values.commonLabels }}
|
||||||
|
{{- if .Values.primary.service.labels }}
|
||||||
|
{{- $labels = include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.service.labels $labels ) "context" . ) }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if or .Values.commonAnnotations .Values.primary.service.annotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.service.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.primary.service.type }}
|
||||||
|
{{- if 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") (not (empty .Values.primary.service.loadBalancerSourceRanges)) }}
|
||||||
|
loadBalancerSourceRanges: {{ .Values.primary.service.loadBalancerSourceRanges | toJson}}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.primary.service.type "LoadBalancer") (not (empty .Values.primary.service.loadBalancerClass)) }}
|
||||||
|
loadBalancerClass: {{ .Values.primary.service.loadBalancerClass }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.primary.service.type "LoadBalancer") (not (empty .Values.primary.service.loadBalancerIP)) }}
|
||||||
|
loadBalancerIP: {{ .Values.primary.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.primary.service.clusterIP (eq .Values.primary.service.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.primary.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.service.sessionAffinity }}
|
||||||
|
sessionAffinity: {{ .Values.primary.service.sessionAffinity }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.primary.service.sessionAffinityConfig }}
|
||||||
|
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.primary.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: tcp-postgresql
|
||||||
|
port: {{ template "postgresql.v1.service.port" . }}
|
||||||
|
targetPort: tcp-postgresql
|
||||||
|
{{- if and (or (eq .Values.primary.service.type "NodePort") (eq .Values.primary.service.type "LoadBalancer")) (not (empty .Values.primary.service.nodePorts.postgresql)) }}
|
||||||
|
nodePort: {{ .Values.primary.service.nodePorts.postgresql }}
|
||||||
|
{{- else if eq .Values.primary.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- 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,22 @@
|
|||||||
|
{{- /*
|
||||||
|
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 "postgresql.v1.chart.fullname" . }}
|
||||||
|
namespace: {{ coalesce .Values.metrics.prometheusRule.namespace (include "common.names.namespace" .) | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.prometheusRule.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: metrics
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
groups:
|
||||||
|
- name: {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
42
charts/authentik/charts/postgresql/templates/psp.yaml
Normal file
42
charts/authentik/charts/postgresql/templates/psp.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and (include "common.capabilities.psp.supported" .) .Values.psp.create }}
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodSecurityPolicy
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
privileged: false
|
||||||
|
volumes:
|
||||||
|
- 'configMap'
|
||||||
|
- 'secret'
|
||||||
|
- 'persistentVolumeClaim'
|
||||||
|
- 'emptyDir'
|
||||||
|
- 'projected'
|
||||||
|
hostNetwork: false
|
||||||
|
hostIPC: false
|
||||||
|
hostPID: false
|
||||||
|
runAsUser:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
seLinux:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
supplementalGroups:
|
||||||
|
rule: 'MustRunAs'
|
||||||
|
ranges:
|
||||||
|
- min: 1
|
||||||
|
max: 65535
|
||||||
|
fsGroup:
|
||||||
|
rule: 'MustRunAs'
|
||||||
|
ranges:
|
||||||
|
- min: 1
|
||||||
|
max: 65535
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if (include "postgresql.v1.readReplicas.createExtendedConfigmap" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-extended-configuration" (include "postgresql.v1.readReplica.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
override.conf: |-
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.extendedConfiguration "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.customMetrics (eq .Values.architecture "replication") }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-metrics" (include "postgresql.v1.readReplica.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
custom-metrics.yaml: {{ toYaml .Values.metrics.customMetrics | quote }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled (eq .Values.architecture "replication") }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-metrics" (include "postgresql.v1.readReplica.fullname" .) }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: metrics-read
|
||||||
|
{{- if or .Values.commonAnnotations .Values.metrics.service.annotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.service.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
sessionAffinity: {{ .Values.metrics.service.sessionAffinity }}
|
||||||
|
{{- if .Values.metrics.service.clusterIP }}
|
||||||
|
clusterIP: {{ .Values.metrics.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: http-metrics
|
||||||
|
port: {{ .Values.metrics.service.ports.metrics }}
|
||||||
|
targetPort: http-metrics
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- if .Values.readReplicas.networkPolicy.enabled }}
|
||||||
|
kind: NetworkPolicy
|
||||||
|
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
|
- Egress
|
||||||
|
{{- if .Values.readReplicas.networkPolicy.allowExternalEgress }}
|
||||||
|
egress:
|
||||||
|
- {}
|
||||||
|
{{- else }}
|
||||||
|
egress:
|
||||||
|
# Allow dns resolution
|
||||||
|
- ports:
|
||||||
|
- port: 53
|
||||||
|
protocol: UDP
|
||||||
|
- port: 53
|
||||||
|
protocol: TCP
|
||||||
|
# Allow outbound connections to primary
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.containerPorts.postgresql }}
|
||||||
|
to:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
|
||||||
|
app.kubernetes.io/component: primary
|
||||||
|
{{- if .Values.readReplicas.networkPolicy.extraEgress }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ingress:
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- port: {{ .Values.metrics.containerPorts.metrics }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.readReplicas.networkPolicy.allowExternal }}
|
||||||
|
from:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{ template "postgresql.v1.readReplica.fullname" . }}-client: "true"
|
||||||
|
{{- if .Values.readReplicas.networkPolicy.ingressNSMatchLabels }}
|
||||||
|
- namespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- range $key, $value := .Values.readReplicas.networkPolicy.ingressNSMatchLabels }}
|
||||||
|
{{ $key | quote }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.networkPolicy.ingressNSPodMatchLabels }}
|
||||||
|
podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- range $key, $value := .Values.readReplicas.networkPolicy.ingressNSPodMatchLabels }}
|
||||||
|
{{ $key | quote }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.networkPolicy.extraIngress }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
29
charts/authentik/charts/postgresql/templates/read/pdb.yaml
Normal file
29
charts/authentik/charts/postgresql/templates/read/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.readReplicas.pdb.create }}
|
||||||
|
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.readReplicas.pdb.minAvailable }}
|
||||||
|
minAvailable: {{ .Values.readReplicas.pdb.minAvailable }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.readReplicas.pdb.maxUnavailable ( not .Values.readReplicas.pdb.minAvailable ) }}
|
||||||
|
maxUnavailable: {{ .Values.readReplicas.pdb.maxUnavailable | default 1 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled (eq .Values.architecture "replication") }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.fullname" . }}
|
||||||
|
namespace: {{ coalesce .Values.metrics.serviceMonitor.namespace (include "common.names.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/component: metrics-read
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.metrics.serviceMonitor.jobLabel }}
|
||||||
|
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
{{- $svcLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.selector .Values.commonLabels ) "context" . ) }}
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $svcLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: metrics-read
|
||||||
|
endpoints:
|
||||||
|
- port: http-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.relabelings }}
|
||||||
|
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
|
||||||
|
{{- end }}
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,588 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.labels .Values.commonLabels ) "context" . ) }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if or .Values.commonAnnotations .Values.readReplicas.annotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.readReplicas.replicaCount }}
|
||||||
|
serviceName: {{ include "postgresql.v1.readReplica.svc.headless" . }}
|
||||||
|
{{- if .Values.readReplicas.updateStrategy }}
|
||||||
|
updateStrategy: {{- toYaml .Values.readReplicas.updateStrategy | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector:
|
||||||
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if or .Values.passwordUpdateJob.enabled (include "postgresql.v1.readReplicas.createExtendedConfigmap" .) .Values.readReplicas.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if (include "postgresql.v1.readReplicas.createExtendedConfigmap" .) }}
|
||||||
|
checksum/extended-configuration: {{ pick (include (print $.Template.BasePath "/primary/extended-configmap.yaml") . | fromYaml) "data" | toYaml | sha256sum }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.passwordUpdateJob.enabled }}
|
||||||
|
charts.bitnami.com/password-last-update: {{ now | date "20060102150405" | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.podAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.podAnnotations "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.readReplicas.extraPodSpec }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraPodSpec "context" $) | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ include "postgresql.v1.serviceAccountName" . }}
|
||||||
|
{{- include "postgresql.v1.imagePullSecrets" . | nindent 6 }}
|
||||||
|
automountServiceAccountToken: {{ .Values.readReplicas.automountServiceAccountToken }}
|
||||||
|
{{- if .Values.readReplicas.hostAliases }}
|
||||||
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.hostAliases "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.affinity }}
|
||||||
|
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.affinity "context" $) | nindent 8 }}
|
||||||
|
{{- else }}
|
||||||
|
affinity:
|
||||||
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.readReplicas.podAffinityPreset "component" "read" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||||
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.readReplicas.podAntiAffinityPreset "component" "read" "customLabels" $podLabels "context" $) | nindent 10 }}
|
||||||
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.readReplicas.nodeAffinityPreset.type "key" .Values.readReplicas.nodeAffinityPreset.key "values" .Values.readReplicas.nodeAffinityPreset.values) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.nodeSelector }}
|
||||||
|
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.nodeSelector "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.tolerations }}
|
||||||
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.tolerations "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.priorityClassName }}
|
||||||
|
priorityClassName: {{ .Values.readReplicas.priorityClassName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.schedulerName }}
|
||||||
|
schedulerName: {{ .Values.readReplicas.schedulerName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.terminationGracePeriodSeconds }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.readReplicas.terminationGracePeriodSeconds }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.podSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.readReplicas.podSecurityContext "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
hostNetwork: {{ .Values.readReplicas.hostNetwork }}
|
||||||
|
hostIPC: {{ .Values.readReplicas.hostIPC }}
|
||||||
|
{{- if or (and .Values.tls.enabled (not .Values.volumePermissions.enabled)) (and .Values.volumePermissions.enabled (or .Values.readReplicas.persistence.enabled .Values.shmVolume.enabled)) .Values.readReplicas.initContainers }}
|
||||||
|
initContainers:
|
||||||
|
{{- if and .Values.tls.enabled (not .Values.volumePermissions.enabled) }}
|
||||||
|
- name: copy-certs
|
||||||
|
image: {{ include "postgresql.v1.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.readReplicas.resources }}
|
||||||
|
resources: {{- toYaml .Values.readReplicas.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.readReplicas.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.readReplicas.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
# We don't require a privileged container in this case
|
||||||
|
{{- if .Values.readReplicas.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.readReplicas.containerSecurityContext "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
cp /tmp/certs/* /opt/bitnami/postgresql/certs/
|
||||||
|
chmod 600 {{ include "postgresql.v1.tlsCertKey" . }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: raw-certificates
|
||||||
|
mountPath: /tmp/certs
|
||||||
|
- name: postgresql-certificates
|
||||||
|
mountPath: /opt/bitnami/postgresql/certs
|
||||||
|
{{- else if and .Values.volumePermissions.enabled (or .Values.readReplicas.persistence.enabled .Values.shmVolume.enabled) }}
|
||||||
|
- name: init-chmod-data
|
||||||
|
image: {{ include "postgresql.v1.volumePermissions.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.readReplicas.resources }}
|
||||||
|
resources: {{- toYaml .Values.readReplicas.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.readReplicas.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.readReplicas.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
{{- if .Values.readReplicas.persistence.enabled }}
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
chown `id -u`:`id -G | cut -d " " -f2` {{ .Values.readReplicas.persistence.mountPath }}
|
||||||
|
{{- else }}
|
||||||
|
chown {{ .Values.readReplicas.containerSecurityContext.runAsUser }}:{{ .Values.readReplicas.podSecurityContext.fsGroup }} {{ .Values.readReplicas.persistence.mountPath }}
|
||||||
|
{{- end }}
|
||||||
|
mkdir -p {{ .Values.readReplicas.persistence.mountPath }}/data {{- if (include "postgresql.v1.mountConfigurationCM" .) }} {{ .Values.readReplicas.persistence.mountPath }}/conf {{- end }}
|
||||||
|
chmod 700 {{ .Values.readReplicas.persistence.mountPath }}/data {{- if (include "postgresql.v1.mountConfigurationCM" .) }} {{ .Values.readReplicas.persistence.mountPath }}/conf {{- end }}
|
||||||
|
find {{ .Values.readReplicas.persistence.mountPath }} -mindepth 1 -maxdepth 1 {{- if not (include "postgresql.v1.mountConfigurationCM" .) }} -not -name "conf" {{- end }} -not -name ".snapshot" -not -name "lost+found" | \
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
xargs -r chown -R `id -u`:`id -G | cut -d " " -f2`
|
||||||
|
{{- else }}
|
||||||
|
xargs -r chown -R {{ .Values.readReplicas.containerSecurityContext.runAsUser }}:{{ .Values.readReplicas.podSecurityContext.fsGroup }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
chmod -R 777 /dev/shm
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
cp /tmp/certs/* /opt/bitnami/postgresql/certs/
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
chown -R `id -u`:`id -G | cut -d " " -f2` /opt/bitnami/postgresql/certs/
|
||||||
|
{{- else }}
|
||||||
|
chown -R {{ .Values.readReplicas.containerSecurityContext.runAsUser }}:{{ .Values.readReplicas.podSecurityContext.fsGroup }} /opt/bitnami/postgresql/certs/
|
||||||
|
{{- end }}
|
||||||
|
chmod 600 {{ include "postgresql.v1.tlsCertKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||||
|
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
|
||||||
|
{{- else }}
|
||||||
|
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: data
|
||||||
|
mountPath: {{ .Values.readReplicas.persistence.mountPath }}
|
||||||
|
{{- if .Values.readReplicas.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.readReplicas.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
- name: dshm
|
||||||
|
mountPath: /dev/shm
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: raw-certificates
|
||||||
|
mountPath: /tmp/certs
|
||||||
|
- name: postgresql-certificates
|
||||||
|
mountPath: /opt/bitnami/postgresql/certs
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.initContainers }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.initContainers "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: postgresql
|
||||||
|
image: {{ include "postgresql.v1.image" . }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
|
{{- if .Values.readReplicas.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.readReplicas.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.readReplicas.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.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.readReplicas.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.args "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||||
|
- name: POSTGRESQL_PORT_NUMBER
|
||||||
|
value: {{ .Values.containerPorts.postgresql | quote }}
|
||||||
|
- name: POSTGRESQL_VOLUME_DIR
|
||||||
|
value: {{ .Values.readReplicas.persistence.mountPath | quote }}
|
||||||
|
{{- if .Values.readReplicas.persistence.mountPath }}
|
||||||
|
- name: PGDATA
|
||||||
|
value: {{ .Values.postgresqlDataDir | quote }}
|
||||||
|
{{- end }}
|
||||||
|
# Authentication
|
||||||
|
{{- if or (eq $customUser "postgres") (empty $customUser) }}
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.adminPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
- name: ALLOW_EMPTY_PASSWORD
|
||||||
|
value: "true"
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
value: {{ $customUser | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.userPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.userPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_POSTGRES_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.adminPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
# Replication
|
||||||
|
- name: POSTGRES_REPLICATION_MODE
|
||||||
|
value: "slave"
|
||||||
|
- name: POSTGRES_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUsername | quote }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRES_REPLICATION_PASSWORD_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include "postgresql.v1.replicationPasswordKey" .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: POSTGRES_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.replicationPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
- name: POSTGRES_CLUSTER_APP_NAME
|
||||||
|
value: {{ .Values.replication.applicationName }}
|
||||||
|
- name: POSTGRES_MASTER_HOST
|
||||||
|
value: {{ include "postgresql.v1.primary.fullname" . }}
|
||||||
|
- name: POSTGRES_MASTER_PORT_NUMBER
|
||||||
|
value: {{ include "postgresql.v1.service.port" . | quote }}
|
||||||
|
# TLS
|
||||||
|
- name: POSTGRESQL_ENABLE_TLS
|
||||||
|
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: POSTGRESQL_TLS_PREFER_SERVER_CIPHERS
|
||||||
|
value: {{ ternary "yes" "no" .Values.tls.preferServerCiphers | quote }}
|
||||||
|
- name: POSTGRESQL_TLS_CERT_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCert" . }}
|
||||||
|
- name: POSTGRESQL_TLS_KEY_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCertKey" . }}
|
||||||
|
{{- if .Values.tls.certCAFilename }}
|
||||||
|
- name: POSTGRESQL_TLS_CA_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCACert" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.crlFilename }}
|
||||||
|
- name: POSTGRESQL_TLS_CRL_FILE
|
||||||
|
value: {{ include "postgresql.v1.tlsCRL" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
# Audit
|
||||||
|
- name: POSTGRESQL_LOG_HOSTNAME
|
||||||
|
value: {{ .Values.audit.logHostname | quote }}
|
||||||
|
- name: POSTGRESQL_LOG_CONNECTIONS
|
||||||
|
value: {{ .Values.audit.logConnections | quote }}
|
||||||
|
- name: POSTGRESQL_LOG_DISCONNECTIONS
|
||||||
|
value: {{ .Values.audit.logDisconnections | quote }}
|
||||||
|
{{- if .Values.audit.logLinePrefix }}
|
||||||
|
- name: POSTGRESQL_LOG_LINE_PREFIX
|
||||||
|
value: {{ .Values.audit.logLinePrefix | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.audit.logTimezone }}
|
||||||
|
- name: POSTGRESQL_LOG_TIMEZONE
|
||||||
|
value: {{ .Values.audit.logTimezone | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.audit.pgAuditLog }}
|
||||||
|
- name: POSTGRESQL_PGAUDIT_LOG
|
||||||
|
value: {{ .Values.audit.pgAuditLog | quote }}
|
||||||
|
{{- end }}
|
||||||
|
- name: POSTGRESQL_PGAUDIT_LOG_CATALOG
|
||||||
|
value: {{ .Values.audit.pgAuditLogCatalog | quote }}
|
||||||
|
# Others
|
||||||
|
- name: POSTGRESQL_CLIENT_MIN_MESSAGES
|
||||||
|
value: {{ .Values.audit.clientMinMessages | quote }}
|
||||||
|
- name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES
|
||||||
|
value: {{ .Values.postgresqlSharedPreloadLibraries | quote }}
|
||||||
|
{{- if .Values.readReplicas.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.readReplicas.extraEnvVarsCM .Values.readReplicas.extraEnvVarsSecret }}
|
||||||
|
envFrom:
|
||||||
|
{{- if .Values.readReplicas.extraEnvVarsCM }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.readReplicas.extraEnvVarsCM }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.readReplicas.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: tcp-postgresql
|
||||||
|
containerPort: {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.readReplicas.customStartupProbe }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.customStartupProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.readReplicas.startupProbe.enabled }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
{{- if (include "postgresql.v1.database" .) }}
|
||||||
|
- exec pg_isready -U {{ default "postgres" $customUser| quote }} -d "dbname={{ include "postgresql.v1.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} 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 and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.v1.tlsCert" . }} sslkey={{ include "postgresql.v1.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.readReplicas.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
{{- if (include "postgresql.v1.database" .) }}
|
||||||
|
- exec pg_isready -U {{ default "postgres" $customUser | quote }} -d "dbname={{ include "postgresql.v1.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} 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 and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.v1.tlsCert" . }} sslkey={{ include "postgresql.v1.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.readReplicas.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- -e
|
||||||
|
{{- include "postgresql.v1.readinessProbeCommand" . | nindent 16 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.resources }}
|
||||||
|
resources: {{- toYaml .Values.readReplicas.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.readReplicas.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.readReplicas.resourcesPreset) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.lifecycleHooks }}
|
||||||
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.lifecycleHooks "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/postgresql/conf
|
||||||
|
subPath: app-conf-dir
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /opt/bitnami/postgresql/tmp
|
||||||
|
subPath: app-tmp-dir
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (or .Values.auth.enablePostgresUser $customUser) }}
|
||||||
|
- name: postgresql-password
|
||||||
|
mountPath: /opt/bitnami/postgresql/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.extendedConfiguration }}
|
||||||
|
- name: postgresql-extended-config
|
||||||
|
mountPath: {{ .Values.readReplicas.persistence.mountPath }}/conf/conf.d/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: postgresql-certificates
|
||||||
|
mountPath: /opt/bitnami/postgresql/certs
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
- name: dshm
|
||||||
|
mountPath: /dev/shm
|
||||||
|
{{- end }}
|
||||||
|
- name: data
|
||||||
|
mountPath: {{ .Values.readReplicas.persistence.mountPath }}
|
||||||
|
{{- if .Values.readReplicas.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.readReplicas.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- name: metrics
|
||||||
|
image: {{ include "postgresql.v1.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 }}
|
||||||
|
{{- 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 if or .Values.metrics.customMetrics .Values.metrics.collectors }}
|
||||||
|
args:
|
||||||
|
{{- if .Values.metrics.customMetrics }}
|
||||||
|
- --extend.query-path
|
||||||
|
- /conf/custom-metrics.yaml
|
||||||
|
{{- end }}
|
||||||
|
{{- range $name, $enabled := .Values.metrics.collectors }}
|
||||||
|
- --{{ if not $enabled }}no-{{ end }}collector.{{ $name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: DATA_SOURCE_URI
|
||||||
|
value: {{ printf "127.0.0.1:%d/postgres?sslmode=disable" (int (include "postgresql.v1.service.port" .)) }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
- name: DATA_SOURCE_PASS_FILE
|
||||||
|
value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (include (ternary "postgresql.v1.adminPasswordKey" "postgresql.v1.userPasswordKey" (empty $customUser)) .) }}
|
||||||
|
{{- else }}
|
||||||
|
- name: DATA_SOURCE_PASS
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
key: {{ include (ternary "postgresql.v1.adminPasswordKey" "postgresql.v1.userPasswordKey" (empty $customUser)) . }}
|
||||||
|
{{- end }}
|
||||||
|
- name: DATA_SOURCE_USER
|
||||||
|
value: {{ default "postgres" $customUser | quote }}
|
||||||
|
{{- if .Values.metrics.extraEnvVars }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraEnvVars "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: http-metrics
|
||||||
|
containerPort: {{ .Values.metrics.containerPorts.metrics }}
|
||||||
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
|
{{- if .Values.metrics.customStartupProbe }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customStartupProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.metrics.startupProbe.enabled }}
|
||||||
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
tcpSocket:
|
||||||
|
port: http-metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.customLivenessProbe }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.metrics.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http-metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.customReadinessProbe }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
|
||||||
|
{{- else if .Values.metrics.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http-metrics
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: empty-dir
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp-dir
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (or .Values.auth.enablePostgresUser $customUser) }}
|
||||||
|
- name: postgresql-password
|
||||||
|
mountPath: /opt/bitnami/postgresql/secrets/
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.customMetrics }}
|
||||||
|
- name: custom-metrics
|
||||||
|
mountPath: /conf
|
||||||
|
readOnly: true
|
||||||
|
{{- 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 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.sidecars }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.sidecars "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
{{- if .Values.readReplicas.extendedConfiguration }}
|
||||||
|
- name: postgresql-extended-config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "postgresql.v1.readReplicas.extendedConfigmapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.auth.usePasswordFiles (or .Values.auth.enablePostgresUser $customUser) }}
|
||||||
|
- name: postgresql-password
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "postgresql.v1.secretName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tls.enabled }}
|
||||||
|
- name: raw-certificates
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "postgresql.v1.tlsSecretName" . }}
|
||||||
|
- name: postgresql-certificates
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.customMetrics }}
|
||||||
|
- name: custom-metrics
|
||||||
|
configMap:
|
||||||
|
name: {{ printf "%s-metrics" (include "postgresql.v1.readReplica.fullname" .) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.shmVolume.enabled }}
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
{{- if .Values.shmVolume.sizeLimit }}
|
||||||
|
sizeLimit: {{ .Values.shmVolume.sizeLimit }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
- name: empty-dir
|
||||||
|
emptyDir: {}
|
||||||
|
{{- if .Values.readReplicas.extraVolumes }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.extraVolumes "context" $ ) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.readReplicas.persistence.enabled .Values.readReplicas.persistence.existingClaim }}
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ tpl .Values.readReplicas.persistence.existingClaim $ }}
|
||||||
|
{{- else if not .Values.readReplicas.persistence.enabled }}
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
{{- else }}
|
||||||
|
{{- if .Values.readReplicas.persistentVolumeClaimRetentionPolicy.enabled }}
|
||||||
|
persistentVolumeClaimRetentionPolicy:
|
||||||
|
whenDeleted: {{ .Values.readReplicas.persistentVolumeClaimRetentionPolicy.whenDeleted }}
|
||||||
|
whenScaled: {{ .Values.readReplicas.persistentVolumeClaimRetentionPolicy.whenScaled }}
|
||||||
|
{{- end }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: data
|
||||||
|
{{- if .Values.readReplicas.persistence.annotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.annotations "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.persistence.labels }}
|
||||||
|
labels: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.labels "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.readReplicas.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.persistence.dataSource }}
|
||||||
|
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.dataSource "context" $) | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.readReplicas.persistence.size | quote }}
|
||||||
|
{{- if .Values.readReplicas.persistence.selector }}
|
||||||
|
selector: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.selector "context" $) | nindent 10 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- include "common.storage.class" (dict "persistence" .Values.readReplicas.persistence "global" .Values.global) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.svc.headless" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
annotations:
|
||||||
|
{{- if or .Values.readReplicas.service.headless.annotations .Values.commonAnnotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.service.headless.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
clusterIP: None
|
||||||
|
# We want all pods in the StatefulSet to have their addresses published for
|
||||||
|
# the sake of the other Postgresql pods even before they're ready, since they
|
||||||
|
# have to be able to talk to each other in order to become ready.
|
||||||
|
publishNotReadyAddresses: true
|
||||||
|
ports:
|
||||||
|
- name: tcp-postgresql
|
||||||
|
port: {{ include "postgresql.v1.readReplica.service.port" . }}
|
||||||
|
targetPort: tcp-postgresql
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- end }}
|
||||||
60
charts/authentik/charts/postgresql/templates/read/svc.yaml
Normal file
60
charts/authentik/charts/postgresql/templates/read/svc.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.readReplica.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- $labels := .Values.commonLabels }}
|
||||||
|
{{- if .Values.readReplicas.service.labels }}
|
||||||
|
{{- $labels = include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.service.labels $labels ) "context" . ) }}
|
||||||
|
{{- end }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- if or .Values.commonAnnotations .Values.readReplicas.service.annotations }}
|
||||||
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.service.annotations .Values.commonAnnotations ) "context" . ) }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.readReplicas.service.type }}
|
||||||
|
{{- if or (eq .Values.readReplicas.service.type "LoadBalancer") (eq .Values.readReplicas.service.type "NodePort") }}
|
||||||
|
externalTrafficPolicy: {{ .Values.readReplicas.service.externalTrafficPolicy | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.readReplicas.service.type "LoadBalancer") (not (empty .Values.readReplicas.service.loadBalancerSourceRanges)) }}
|
||||||
|
loadBalancerSourceRanges: {{ .Values.readReplicas.service.loadBalancerSourceRanges }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.readReplicas.service.type "LoadBalancer") (not (empty .Values.readReplicas.service.loadBalancerClass)) }}
|
||||||
|
loadBalancerClass: {{ .Values.readReplicas.service.loadBalancerClass }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq .Values.readReplicas.service.type "LoadBalancer") (not (empty .Values.readReplicas.service.loadBalancerIP)) }}
|
||||||
|
loadBalancerIP: {{ .Values.readReplicas.service.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.readReplicas.service.clusterIP (eq .Values.readReplicas.service.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.readReplicas.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.service.sessionAffinity }}
|
||||||
|
sessionAffinity: {{ .Values.readReplicas.service.sessionAffinity }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.service.sessionAffinityConfig }}
|
||||||
|
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: tcp-postgresql
|
||||||
|
port: {{ include "postgresql.v1.readReplica.service.port" . }}
|
||||||
|
targetPort: tcp-postgresql
|
||||||
|
{{- if and (or (eq .Values.readReplicas.service.type "NodePort") (eq .Values.readReplicas.service.type "LoadBalancer")) (not (empty .Values.readReplicas.service.nodePorts.postgresql)) }}
|
||||||
|
nodePort: {{ .Values.readReplicas.service.nodePorts.postgresql }}
|
||||||
|
{{- else if eq .Values.readReplicas.service.type "ClusterIP" }}
|
||||||
|
nodePort: null
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.readReplicas.service.extraPorts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.service.extraPorts "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
||||||
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
||||||
|
app.kubernetes.io/component: read
|
||||||
|
{{- end }}
|
||||||
32
charts/authentik/charts/postgresql/templates/role.yaml
Normal file
32
charts/authentik/charts/postgresql/templates/role.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.rbac.create }}
|
||||||
|
kind: Role
|
||||||
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
# yamllint disable rule:indentation
|
||||||
|
rules:
|
||||||
|
{{- if and (include "common.capabilities.psp.supported" .) .Values.psp.create }}
|
||||||
|
- apiGroups:
|
||||||
|
- 'policy'
|
||||||
|
resources:
|
||||||
|
- 'podsecuritypolicies'
|
||||||
|
verbs:
|
||||||
|
- 'use'
|
||||||
|
resourceNames:
|
||||||
|
- {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.rbac.rules }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
# yamllint enable rule:indentation
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.rbac.create }}
|
||||||
|
kind: RoleBinding
|
||||||
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ include "postgresql.v1.serviceAccountName" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
{{- end }}
|
||||||
120
charts/authentik/charts/postgresql/templates/secrets.yaml
Normal file
120
charts/authentik/charts/postgresql/templates/secrets.yaml
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- $host := include "postgresql.v1.primary.fullname" . }}
|
||||||
|
{{- $port := include "postgresql.v1.service.port" . }}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
{{- $postgresPassword := (ternary (coalesce .Values.global.postgresql.auth.password .Values.auth.password .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (coalesce .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (or (empty $customUser) (eq $customUser "postgres"))) }}
|
||||||
|
{{- if (not $postgresPassword) }}
|
||||||
|
{{- $postgresPassword = include "common.secrets.lookup" (dict "secret" (include "postgresql.v1.secretName" .) "key" (coalesce .Values.global.postgresql.auth.secretKeys.adminPasswordKey .Values.auth.secretKeys.adminPasswordKey) "defaultValue" (ternary (coalesce .Values.global.postgresql.auth.password .Values.auth.password .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (coalesce .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (or (empty $customUser) (eq $customUser "postgres"))) "context" $) | trimAll "\"" | b64dec }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not $postgresPassword) .Values.auth.enablePostgresUser }}
|
||||||
|
{{- $postgresPassword = randAlphaNum 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $replicationPassword := "" }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
{{- $replicationPassword = include "common.secrets.passwords.manage" (dict "secret" (include "postgresql.v1.secretName" .) "key" (coalesce .Values.global.postgresql.auth.secretKeys.replicationPasswordKey .Values.auth.secretKeys.replicationPasswordKey) "providedValues" (list "auth.replicationPassword") "honorProvidedValues" true "context" $) | trimAll "\"" | b64dec }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $ldapPassword := "" }}
|
||||||
|
{{- if and .Values.ldap.enabled (or .Values.ldap.bind_password .Values.ldap.bindpw) }}
|
||||||
|
{{- $ldapPassword = coalesce .Values.ldap.bind_password .Values.ldap.bindpw }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $password := "" }}
|
||||||
|
{{- if and (not (empty $customUser)) (ne $customUser "postgres") }}
|
||||||
|
{{- $password = include "common.secrets.passwords.manage" (dict "secret" (include "postgresql.v1.secretName" .) "key" (coalesce .Values.global.postgresql.auth.secretKeys.userPasswordKey .Values.auth.secretKeys.userPasswordKey) "providedValues" (list "global.postgresql.auth.password" "auth.password") "honorProvidedValues" true "context" $) | trimAll "\"" | b64dec }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $database := include "postgresql.v1.database" . }}
|
||||||
|
{{- if (include "postgresql.v1.createSecret" .) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if or .Values.secretAnnotations .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.secretAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
{{- if $postgresPassword }}
|
||||||
|
postgres-password: {{ $postgresPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $password }}
|
||||||
|
password: {{ $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $replicationPassword }}
|
||||||
|
replication-password: {{ $replicationPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
# We don't auto-generate LDAP password when it's not provided as we do for other passwords
|
||||||
|
{{- if and .Values.ldap.enabled (or .Values.ldap.bind_password .Values.ldap.bindpw) }}
|
||||||
|
ldap-password: {{ $ldapPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.serviceBindings.enabled }}
|
||||||
|
{{- if $postgresPassword }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}-svcbind-postgres
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if or .Values.secretAnnotations .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.secretAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
type: servicebinding.io/postgresql
|
||||||
|
data:
|
||||||
|
provider: {{ print "bitnami" | b64enc | quote }}
|
||||||
|
type: {{ print "postgresql" | b64enc | quote }}
|
||||||
|
host: {{ $host | b64enc | quote }}
|
||||||
|
port: {{ $port | b64enc | quote }}
|
||||||
|
username: {{ print "postgres" | b64enc | quote }}
|
||||||
|
database: {{ print "postgres" | b64enc | quote }}
|
||||||
|
password: {{ $postgresPassword | b64enc | quote }}
|
||||||
|
uri: {{ printf "postgresql://postgres:%s@%s:%s/postgres" $postgresPassword $host $port | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $password }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.chart.fullname" . }}-svcbind-custom-user
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- if or .Values.secretAnnotations .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.secretAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
type: servicebinding.io/postgresql
|
||||||
|
data:
|
||||||
|
provider: {{ print "bitnami" | b64enc | quote }}
|
||||||
|
type: {{ print "postgresql" | b64enc | quote }}
|
||||||
|
host: {{ $host | b64enc | quote }}
|
||||||
|
port: {{ $port | b64enc | quote }}
|
||||||
|
username: {{ $customUser | b64enc | quote }}
|
||||||
|
password: {{ $password | b64enc | quote }}
|
||||||
|
{{- if $database }}
|
||||||
|
database: {{ $database | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
uri: {{ printf "postgresql://%s:%s@%s:%s/%s" $customUser $password $host $port $database | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ include "postgresql.v1.serviceAccountName" . }}
|
||||||
|
namespace: {{ include "common.names.namespace" . | quote }}
|
||||||
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- 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,30 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if (include "postgresql.v1.createTlsSecret" . ) }}
|
||||||
|
{{- $secretName := printf "%s-crt" (include "postgresql.v1.chart.fullname" .) }}
|
||||||
|
{{- $ca := genCA "postgresql-ca" 365 }}
|
||||||
|
{{- $fullname := include "postgresql.v1.chart.fullname" . }}
|
||||||
|
{{- $releaseNamespace := include "common.names.namespace" . }}
|
||||||
|
{{- $clusterDomain := .Values.clusterDomain }}
|
||||||
|
{{- $primaryHeadlessServiceName := include "postgresql.v1.primary.svc.headless" . }}
|
||||||
|
{{- $readHeadlessServiceName := include "postgresql.v1.readReplica.svc.headless" . }}
|
||||||
|
{{- $altNames := list (printf "*.%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $primaryHeadlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $primaryHeadlessServiceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $readHeadlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $readHeadlessServiceName $releaseNamespace $clusterDomain) $fullname }}
|
||||||
|
{{- $cert := genSignedCert $fullname nil $altNames 365 $ca }}
|
||||||
|
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 }}
|
||||||
|
{{- 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" $cert.Cert "context" $) }}
|
||||||
|
tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }}
|
||||||
|
ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,235 @@
|
|||||||
|
{{- /*
|
||||||
|
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 "postgresql.v1.chart.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: postgresql
|
||||||
|
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.passwordUpdateJob.annotations .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: postgresql
|
||||||
|
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 "postgresql.v1.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 "postgresql.v1.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:
|
||||||
|
- |
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
{{- $customDatabase := include "postgresql.v1.database" . | default "postgres" }}
|
||||||
|
{{- if .Values.auth.usePasswordFiles }}
|
||||||
|
# We need to load all the secret env vars to the system
|
||||||
|
for file in $(find /bitnami/postgresql/secrets -type f); do
|
||||||
|
env_var_name="$(basename $file)"
|
||||||
|
echo "Exporting $env_var_name"
|
||||||
|
export $env_var_name="$(< $file)"
|
||||||
|
done
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
. /opt/bitnami/scripts/postgresql-env.sh
|
||||||
|
. /opt/bitnami/scripts/libpostgresql.sh
|
||||||
|
. /opt/bitnami/scripts/liblog.sh
|
||||||
|
|
||||||
|
primary_host={{ include "postgresql.v1.primary.fullname" . }}-0.{{ include "postgresql.v1.primary.svc.headless" . }}
|
||||||
|
info "Starting password update job"
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
if [[ -f /job-status/postgres-password-changed ]]; then
|
||||||
|
info "Postgres password already updated. Skipping"
|
||||||
|
else
|
||||||
|
info "Updating postgres password"
|
||||||
|
echo "ALTER USER postgres WITH PASSWORD '$POSTGRESQL_NEW_POSTGRES_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "" postgres $POSTGRESQL_PREVIOUS_POSTGRES_PASSWORD
|
||||||
|
touch /job-status/postgres-password-changed
|
||||||
|
info "Postgres password successfully updated"
|
||||||
|
fi
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not (empty $customUser)) (ne $customUser "postgres") }}
|
||||||
|
if [[ -f /job-status/password-changed ]]; then
|
||||||
|
info "User password already updated. Skipping"
|
||||||
|
else
|
||||||
|
info "Updating user password"
|
||||||
|
echo "ALTER USER {{ $customUser }} WITH PASSWORD '$POSTGRESQL_NEW_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "{{ $customDatabase }}" $POSTGRESQL_USER $POSTGRESQL_PREVIOUS_PASSWORD
|
||||||
|
touch /job-status/password-changed
|
||||||
|
info "User password successfully updated"
|
||||||
|
fi
|
||||||
|
{{- end }}
|
||||||
|
{{- if or (eq .Values.architecture "replication") .Values.primary.standby.enabled }}
|
||||||
|
if [[ -f /job-status/replication-password-changed ]]; then
|
||||||
|
info "Replication password already updated. Skipping"
|
||||||
|
else
|
||||||
|
info "Updating replication password"
|
||||||
|
echo "ALTER USER $POSTGRESQL_REPLICATION_USER WITH PASSWORD '$POSTGRESQL_NEW_REPLICATION_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "{{ $customDatabase }}" $POSTGRESQL_REPLICATION_USER $POSTGRESQL_PREVIOUS_REPLICATION_PASSWORD
|
||||||
|
touch /job-status/replication-password-changed
|
||||||
|
info "Replication password successfully updated"
|
||||||
|
fi
|
||||||
|
{{- 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: POSTGRESQL_PREVIOUS_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "postgresql.v1.update-job.previousSecretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
- name: POSTGRESQL_NEW_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "postgresql.v1.update-job.newSecretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.adminPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not (empty .Values.auth.username) }}
|
||||||
|
- name: POSTGRESQL_USER
|
||||||
|
value: {{ .Values.auth.username | quote }}
|
||||||
|
{{- if not .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRESQL_PREVIOUS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "postgresql.v1.update-job.previousSecretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.userPasswordKey" . }}
|
||||||
|
- name: POSTGRESQL_NEW_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "postgresql.v1.update-job.newSecretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.userPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- name: POSTGRESQL_REPLICATION_USER
|
||||||
|
value: {{ .Values.auth.replicationUsername | quote }}
|
||||||
|
{{- if not .Values.auth.usePasswordFiles }}
|
||||||
|
- name: POSTGRESQL_PREVIOUS_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "postgresql.v1.update-job.previousSecretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.replicationPasswordKey" . }}
|
||||||
|
- name: POSTGRESQL_NEW_REPLICATION_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ template "postgresql.v1.update-job.newSecretName" . }}
|
||||||
|
key: {{ include "postgresql.v1.replicationPasswordKey" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- 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.auth.usePasswordFiles }}
|
||||||
|
- name: postgresql-previous-credentials
|
||||||
|
mountPath: /bitnami/postgresql/secrets/previous
|
||||||
|
- name: postgresql-new-credentials
|
||||||
|
mountPath: /bitnami/postgresql/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 .Values.auth.usePasswordFiles }}
|
||||||
|
- name: postgresql-previous-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "postgresql.update-job.previousSecretName" . }}
|
||||||
|
items:
|
||||||
|
- key: postgresql-root-password
|
||||||
|
path: POSTGRESQL_PREVIOUS_POSTGRES_PASSWORD
|
||||||
|
- key: postgresql-password
|
||||||
|
path: POSTGRESQL_PREVIOUS_PASSWORD
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- key: postgresql-replication-password
|
||||||
|
path: POSTGRESQL_PREVIOUS_REPLICATION_PASSWORD
|
||||||
|
{{- end }}
|
||||||
|
- name: postgresql-new-credentials
|
||||||
|
secret:
|
||||||
|
secretName: {{ template "postgresql.update-job.newSecretName" . }}
|
||||||
|
items:
|
||||||
|
- key: postgresql-root-password
|
||||||
|
path: POSTGRESQL_NEW_POSTGRES_PASSWORD
|
||||||
|
- key: postgresql-password
|
||||||
|
path: POSTGRESQL_NEW_PASSWORD
|
||||||
|
{{- if eq .Values.architecture "replication" }}
|
||||||
|
- key: postgresql-replication-password
|
||||||
|
path: POSTGRESQL_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,32 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.passwordUpdateJob.enabled (include "postgresql.v1.createSecret" .) (not ( include "postgresql.v1.createPreviousSecret" . )) (not .Values.passwordUpdateJob.previousPasswords.existingSecret) }}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
{{- $postgresPassword := (ternary (coalesce .Values.global.postgresql.auth.password .Values.auth.password .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (coalesce .Values.global.postgresql.auth.postgresPassword .Values.auth.postgresPassword) (or (empty $customUser) (eq $customUser "postgres"))) }}
|
||||||
|
{{- $password := coalesce .Values.global.postgresql.auth.password .Values.auth.password }}
|
||||||
|
{{- $replicationPassword := .Values.auth.replicationPassword }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-new-secret" (include "postgresql.v1.chart.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: postgresql
|
||||||
|
{{- $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:
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
postgres-password: {{ required "The new postgres password is required!" $postgresPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not (empty $customUser)) (ne $customUser "postgres") }}
|
||||||
|
password: {{ required "The new user password is required!" $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or (eq .Values.architecture "replication") .Values.primary.standby.enabled }}
|
||||||
|
replication-password: {{ required "The new replication password is required!" $replicationPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
{{- /*
|
||||||
|
Copyright Broadcom, Inc. All Rights Reserved.
|
||||||
|
SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if and .Values.passwordUpdateJob.enabled (include "postgresql.v1.createPreviousSecret" .) }}
|
||||||
|
{{- $customUser := include "postgresql.v1.username" . }}
|
||||||
|
{{- $postgresPassword := .Values.passwordUpdateJob.previousPasswords.postgresPassword }}
|
||||||
|
{{- $password := .Values.passwordUpdateJob.previousPasswords.password }}
|
||||||
|
{{- $replicationPassword := .Values.passwordUpdateJob.previousPasswords.replicationPassword }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ printf "%s-previous-secret" (include "postgresql.v1.chart.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: postgresql
|
||||||
|
{{- $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:
|
||||||
|
{{- if .Values.auth.enablePostgresUser }}
|
||||||
|
postgres-password: {{ required "The previous postgres password is required!" $postgresPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not (empty $customUser)) (ne $customUser "postgres") }}
|
||||||
|
password: {{ required "The previous user password is required!" $password | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or (eq .Values.architecture "replication") .Values.primary.standby.enabled }}
|
||||||
|
replication-password: {{ required "The previous replication password is required!" $replicationPassword | b64enc | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
156
charts/authentik/charts/postgresql/values.schema.json
Normal file
156
charts/authentik/charts/postgresql/values.schema.json
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/schema#",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"architecture": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "PostgreSQL architecture",
|
||||||
|
"form": true,
|
||||||
|
"description": "Allowed values: `standalone` or `replication`"
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Authentication configuration",
|
||||||
|
"form": true,
|
||||||
|
"properties": {
|
||||||
|
"enablePostgresUser": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Enable \"postgres\" admin user",
|
||||||
|
"description": "Assign a password to the \"postgres\" admin user. Otherwise, remote access will be blocked for this user",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"postgresPassword": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Password for the \"postgres\" admin user",
|
||||||
|
"description": "Defaults to a random 10-character alphanumeric string if not set",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"database": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "PostgreSQL custom database",
|
||||||
|
"description": "Name of the custom database to be created during the 1st initialization of PostgreSQL",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "PostgreSQL custom user",
|
||||||
|
"description": "Name of the custom user to be created during the 1st initialization of PostgreSQL. This user only has permissions on the PostgreSQL custom database",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Password for the custom user to create",
|
||||||
|
"description": "Defaults to a random 10-character alphanumeric string if not set",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"replicationUsername": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "PostgreSQL replication user",
|
||||||
|
"description": "Name of user used to manage replication.",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": "standalone",
|
||||||
|
"path": "architecture"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"replicationPassword": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Password for PostgreSQL replication user",
|
||||||
|
"description": "Defaults to a random 10-character alphanumeric string if not set",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": "standalone",
|
||||||
|
"path": "architecture"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"persistence": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"size": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Persistent Volume Size",
|
||||||
|
"form": true,
|
||||||
|
"render": "slider",
|
||||||
|
"sliderMin": 1,
|
||||||
|
"sliderMax": 100,
|
||||||
|
"sliderUnit": "Gi"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Required Resources",
|
||||||
|
"description": "Configure resource requests",
|
||||||
|
"form": true,
|
||||||
|
"properties": {
|
||||||
|
"requests": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"memory": {
|
||||||
|
"type": "string",
|
||||||
|
"form": true,
|
||||||
|
"render": "slider",
|
||||||
|
"title": "Memory Request",
|
||||||
|
"sliderMin": 10,
|
||||||
|
"sliderMax": 2048,
|
||||||
|
"sliderUnit": "Mi"
|
||||||
|
},
|
||||||
|
"cpu": {
|
||||||
|
"type": "string",
|
||||||
|
"form": true,
|
||||||
|
"render": "slider",
|
||||||
|
"title": "CPU Request",
|
||||||
|
"sliderMin": 10,
|
||||||
|
"sliderMax": 2000,
|
||||||
|
"sliderUnit": "m"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"replication": {
|
||||||
|
"type": "object",
|
||||||
|
"form": true,
|
||||||
|
"title": "Replication Details",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Enable Replication",
|
||||||
|
"form": true
|
||||||
|
},
|
||||||
|
"readReplicas": {
|
||||||
|
"type": "integer",
|
||||||
|
"title": "read Replicas",
|
||||||
|
"form": true,
|
||||||
|
"hidden": {
|
||||||
|
"value": "standalone",
|
||||||
|
"path": "architecture"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"volumePermissions": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"form": true,
|
||||||
|
"title": "Enable Init Containers",
|
||||||
|
"description": "Change the owner of the persist volume mountpoint to RunAsUser:fsGroup"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"metrics": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Configure metrics exporter",
|
||||||
|
"form": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1933
charts/authentik/charts/postgresql/values.yaml
Normal file
1933
charts/authentik/charts/postgresql/values.yaml
Normal file
File diff suppressed because it is too large
Load Diff
25
charts/authentik/charts/redis/.helmignore
Normal file
25
charts/authentik/charts/redis/.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
|
||||||
6
charts/authentik/charts/redis/Chart.lock
Normal file
6
charts/authentik/charts/redis/Chart.lock
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 2.31.0
|
||||||
|
digest: sha256:c4c9af4e0ca23cf2c549e403b2a2bba2c53a3557cee23da09fa4cdf710044c2c
|
||||||
|
generated: "2025-05-06T10:59:26.624907586+02:00"
|
||||||
39
charts/authentik/charts/redis/Chart.yaml
Normal file
39
charts/authentik/charts/redis/Chart.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
annotations:
|
||||||
|
category: Database
|
||||||
|
images: |
|
||||||
|
- name: kubectl
|
||||||
|
image: docker.io/bitnami/kubectl:1.33.1-debian-12-r2
|
||||||
|
- name: os-shell
|
||||||
|
image: docker.io/bitnami/os-shell:12-debian-12-r45
|
||||||
|
- name: redis
|
||||||
|
image: docker.io/bitnami/redis:8.0.1-debian-12-r2
|
||||||
|
- name: redis-exporter
|
||||||
|
image: docker.io/bitnami/redis-exporter:1.73.0-debian-12-r0
|
||||||
|
- name: redis-sentinel
|
||||||
|
image: docker.io/bitnami/redis-sentinel:8.0.1-debian-12-r1
|
||||||
|
licenses: Apache-2.0
|
||||||
|
tanzuCategory: service
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 8.0.1
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
tags:
|
||||||
|
- bitnami-common
|
||||||
|
version: 2.x.x
|
||||||
|
description: Redis(R) is an open source, advanced key-value store. It is often referred
|
||||||
|
to as a data structure server since keys can contain strings, hashes, lists, sets
|
||||||
|
and sorted sets.
|
||||||
|
home: https://bitnami.com
|
||||||
|
icon: https://dyltqmyl993wv.cloudfront.net/assets/stacks/redis/img/redis-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- redis
|
||||||
|
- keyvalue
|
||||||
|
- database
|
||||||
|
maintainers:
|
||||||
|
- name: Broadcom, Inc. All Rights Reserved.
|
||||||
|
url: https://github.com/bitnami/charts
|
||||||
|
name: redis
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/charts/tree/main/bitnami/redis
|
||||||
|
version: 21.1.6
|
||||||
1336
charts/authentik/charts/redis/README.md
Normal file
1336
charts/authentik/charts/redis/README.md
Normal file
File diff suppressed because it is too large
Load Diff
26
charts/authentik/charts/redis/charts/common/.helmignore
Normal file
26
charts/authentik/charts/redis/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
|
||||||
23
charts/authentik/charts/redis/charts/common/Chart.yaml
Normal file
23
charts/authentik/charts/redis/charts/common/Chart.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
annotations:
|
||||||
|
category: Infrastructure
|
||||||
|
licenses: Apache-2.0
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 2.31.0
|
||||||
|
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.31.0
|
||||||
381
charts/authentik/charts/redis/charts/common/README.md
Normal file
381
charts/authentik/charts/redis/charts/common/README.md
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
# Bitnami Common Library Chart
|
||||||
|
|
||||||
|
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between Bitnami charts.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
version: 2.x.x
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
```
|
||||||
|
|
||||||
|
```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.
|
||||||
|
|
||||||
|
Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment and management of Helm Charts in clusters.
|
||||||
|
|
||||||
|
## 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.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` 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 |
|
||||||
|
|
||||||
|
### 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.supportsPathType` | Prints "true" if the pathType field is supported | `.` Chart context |
|
||||||
|
| `common.ingress.supportsIngressClassname` | Prints "true" if the ingressClassname field is supported | `.` Chart context |
|
||||||
|
| `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 $` |
|
||||||
|
|
||||||
|
## 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" .context -}}
|
||||||
|
{{- 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,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,85 @@
|
|||||||
|
{{/*
|
||||||
|
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 -}}
|
||||||
|
{{- $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 -}}
|
||||||
|
{{- 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 Tanzu Application Catalog 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 or (contains "docker.io/bitnami/" $originalImages) (contains "docker.io/bitnamiprem/" $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 Tanzu Application Catalog 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,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,61 @@
|
|||||||
|
{{/*
|
||||||
|
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 -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
TODO: Remove as soon it is removed from the rest of the charts
|
||||||
|
Print "true" if the API pathType field is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.supportsPathType" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.supportsPathType" -}}
|
||||||
|
{{- print "true" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
TODO: Remove as soon it is removed from the rest of the charts
|
||||||
|
Returns true if the ingressClassname field is supported
|
||||||
|
Usage:
|
||||||
|
{{ include "common.ingress.supportsIngressClassname" . }}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.ingress.supportsIngressClassname" -}}
|
||||||
|
{{- print "true" -}}
|
||||||
|
{{- 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: {{ . | 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 -}}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user