From e5ec69576fae8034bee4de032f002d81bff28cfd Mon Sep 17 00:00:00 2001 From: Marcos Bjoerkelund Date: Mon, 28 Sep 2020 13:04:25 +0200 Subject: [PATCH] [bitnami/prestashop] Follow non-root approach (#3748) * [bitnami/prestashop] Add support for non-root approach * implement feedback * [bitnami/prestashop] Update components versions Signed-off-by: Bitnami Containers Co-authored-by: Bitnami Containers --- bitnami/prestashop/Chart.yaml | 2 +- bitnami/prestashop/README.md | 232 ++++++---- bitnami/prestashop/requirements.lock | 7 +- bitnami/prestashop/requirements.yaml | 11 +- bitnami/prestashop/templates/NOTES.txt | 25 +- bitnami/prestashop/templates/_helpers.tpl | 144 +----- bitnami/prestashop/templates/deployment.yaml | 424 ++++++++++-------- .../templates/externaldb-secrets.yaml | 8 +- bitnami/prestashop/templates/extra-list.yaml | 5 + bitnami/prestashop/templates/ingress.yaml | 40 +- .../prestashop/templates/prestashop-pvc.yaml | 18 - bitnami/prestashop/templates/pv.yaml | 20 + bitnami/prestashop/templates/pvc.yaml | 23 + bitnami/prestashop/templates/secrets.yaml | 18 +- bitnami/prestashop/templates/svc.yaml | 18 +- bitnami/prestashop/templates/tls-secrets.yaml | 12 +- bitnami/prestashop/values.yaml | 239 ++++++++-- 17 files changed, 717 insertions(+), 529 deletions(-) create mode 100644 bitnami/prestashop/templates/extra-list.yaml delete mode 100644 bitnami/prestashop/templates/prestashop-pvc.yaml create mode 100644 bitnami/prestashop/templates/pv.yaml create mode 100644 bitnami/prestashop/templates/pvc.yaml diff --git a/bitnami/prestashop/Chart.yaml b/bitnami/prestashop/Chart.yaml index 739e9c4c6..15c1e8225 100644 --- a/bitnami/prestashop/Chart.yaml +++ b/bitnami/prestashop/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: prestashop -version: 9.2.14 +version: 10.0.0 appVersion: 1.7.6-8 description: A popular open source ecommerce solution. Professional tools are easily accessible to increase online sales including instant guest checkout, abandoned cart reminders and automated Email marketing. keywords: diff --git a/bitnami/prestashop/README.md b/bitnami/prestashop/README.md index cfe76e043..52ee600e6 100644 --- a/bitnami/prestashop/README.md +++ b/bitnami/prestashop/README.md @@ -48,96 +48,142 @@ The command removes all the Kubernetes components associated with the chart and ## Parameters -The following table lists the configurable parameters of the PrestaShop chart and their default values. +The following table lists the configurable parameters of the PrestaShop chart and their default values per section/component: -| Parameter | Description | Default | -|--------------------------------------|---------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| -| `global.imageRegistry` | Global Docker image registry | `nil` | -| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | -| `image.registry` | PrestaShop image registry | `docker.io` | -| `image.repository` | PrestaShop image name | `bitnami/prestashop` | -| `image.tag` | PrestaShop image tag | `{TAG_NAME}` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `nameOverride` | String to partially override prestashop.fullname template with a string (will prepend the release name) | `nil` | -| `fullnameOverride` | String to fully override prestashop.fullname template with a string | `nil` | -| `service.type` | Kubernetes Service type | `LoadBalancer` | -| `service.port` | Service HTTP port | `80` | -| `service.httpsPort` | Service HTTPS port | `443` | -| `service.nodePorts.http` | Kubernetes http node port | `""` | -| `service.nodePorts.https` | Kubernetes https node port | `""` | -| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | -| `service.loadBalancerIP ` | LoadBalancer service IP address | `""` | -| `ingress.enabled` | Enable ingress controller resource | `false` | -| `ingress.certManager` | Add annotations for cert-manager | `false` | -| `ingress.annotations` | Ingress annotations | `[]` | -| `ingress.hosts[0].name` | Hostname to your PrestaShop installation | `prestashop.local` | -| `ingress.hosts[0].path` | Path within the url structure | `/` | -| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | -| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `prestashop.local-tls` | -| `ingress.secrets[0].name` | TLS Secret Name | `nil` | -| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | -| `ingress.secrets[0].key` | TLS Secret Key | `nil` | -| `prestashopHost` | PrestaShop host to create application URLs (when ingress, it will be ignored) | `nil` | -| `prestashopUsername` | User of the application | `user@example.com` | -| `prestashopPassword` | Application password | _random 10 character long alphanumeric string_ | -| `prestashopEmail` | Admin email | `user@example.com` | -| `prestashopFirstName` | First Name | `Bitnami` | -| `prestashopLastName` | Last Name | `Name` | -| `prestashopCookieCheckIP` | Whether to check the cookie's IP address or not | `no` | -| `prestashopCountry` | Default country of the store | `us` | -| `prestashopLanguage` | Default language of the store (iso code) | `en` | -| `smtpHost` | SMTP host | `nil` | -| `smtpPort` | SMTP port | `nil` | -| `smtpUser` | SMTP user | `nil` | -| `smtpPassword` | SMTP password | `nil` | -| `smtpProtocol` | SMTP protocol [`ssl`, `tls`] | `nil` | -| `allowEmptyPassword` | Allow DB blank passwords | `yes` | -| `externalDatabase.host` | Host of the external database | `nil` | -| `externalDatabase.port` | SMTP protocol [`ssl`, `none`] | `3306` | -| `externalDatabase.user` | Existing username in the external db | `bn_prestashop` | -| `externalDatabase.password` | Password for the above username | `nil` | -| `externalDatabase.database` | Name of the existing database | `bitnami_prestashop` | -| `mariadb.enabled` | Whether to use the MariaDB chart | `true` | -| `mariadb.image.registry` | MariaDB image registry | `docker.io` | -| `mariadb.image.repository` | MariaDB image name | `bitnami/mariadb` | -| `mariadb.image.tag` | MariaDB image tag | `{TAG_NAME}` | -| `mariadb.db.name` | Database name to create | `bitnami_prestashop` | -| `mariadb.db.user` | Database user to create | `bn_prestashop` | -| `mariadb.db.password` | Password for the database | `nil` | -| `mariadb.rootUser.password` | MariaDB admin password | `nil` | -| `sessionAffinity` | Configures the session affinity | `None` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.storageClass` | PVC Storage Class for PrestaShop volume | `nil` (uses alpha storage class annotation) | -| `persistence.existingClaim` | An Existing PVC name for PrestaShop volume | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | PVC Access Mode for PrestaShop volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for PrestaShop volume | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | -| `livenessProbe.enabled` | Would you like a livenessProbe to be enabled | `true` | -| `livenessProbe.path` | Path to perform the liveness probe | `/login` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 600 | -| `livenessProbe.periodSeconds` | How often to perform the probe | 3 | -| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | -| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | -| `readinessProbe.enabled` | Would you like a readinessProbe to be enabled | `true` | -| `readinessProbe.path` | Path to perform the readiness probe | `/login` | -| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | 30 | -| `readinessProbe.periodSeconds` | How often to perform the probe | 3 | -| `readinessProbe.timeoutSeconds` | When the probe times out | 5 | -| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | -| `podAnnotations` | Pod annotations | `{}` | -| `affinity` | Map of node/pod affinities | `{}` | -| `metrics.enabled` | Start a side-car prometheus exporter | `false` | -| `metrics.image.registry` | Apache exporter image registry | `docker.io` | -| `metrics.image.repository` | Apache exporter image name | `bitnami/apache-exporter` | -| `metrics.image.tag` | Apache exporter image tag | `{TAG_NAME}` | -| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | -| `metrics.resources` | Exporter resource requests/limit | {} | +### Global parameters + +| Parameter | Description | Default | +|---------------------------|-------------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | + +### Common parameters + +| Parameter | Description | Default | +|---------------------|------------------------------------------------------------------------------|---------------------------------------------------------| +| `image.registry` | PrestaShop image registry | `docker.io` | +| `image.repository` | PrestaShop Image name | `bitnami/prestashop` | +| `image.tag` | PrestaShop Image tag | `{TAG_NAME}` | +| `image.pullPolicy` | PrestaShop image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `image.debug` | Specify if debug logs should be enabled | `false` | +| `nameOverride` | String to partially override prestashop.fullname template | `nil` | +| `fullnameOverride` | String to fully override prestashop.fullname template | `nil` | +| `commonLabels` | Labels to add to all deployed objects | `nil` | +| `commonAnnotations` | Annotations to add to all deployed objects | `[]` | +| `extraDeploy` | Array of extra objects to deploy with the release (evaluated as a template). | `nil` | + +### PrestaShop parameters + +| Parameter | Description | Default | +|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------| +| `affinity` | Map of node/pod affinities | `{}` | +| `allowEmptyPassword` | Allow DB blank passwords | `yes` | +| `args` | Override default container args (useful when using custom images) | `nil` | +| `command` | Override default container command (useful when using custom images) | `nil` | +| `containerSecurityContext.enabled` | Enable PrestaShop containers' Security Context | `true` | +| `containerSecurityContext.runAsUser` | PrestaShop containers' Security Context | `1001` | +| `customLivenessProbe` | Override default liveness probe | `nil` | +| `customReadinessProbe` | Override default readiness probe | `nil` | +| `existingSecret` | Name of a secret with the application password | `nil` | +| `extraEnvVarsCM` | ConfigMap containing extra env vars | `nil` | +| `extraEnvVarsSecret` | Secret containing extra env vars (in case of sensitive data) | `nil` | +| `extraEnvVars` | Extra environment variables | `nil` | +| `extraVolumeMounts` | Array of extra volume mounts to be added to the container (evaluated as template). Normally used with `extraVolumes`. | `nil` | +| `extraVolumes` | Array of extra volumes to be added to the deployment (evaluated as template). Requires setting `extraVolumeMounts` | `nil` | +| `initContainers` | Add additional init containers to the pod (evaluated as a template) | `nil` | +| `lifecycleHooks` | LifecycleHook to set additional configuration at startup Evaluated as a template | `` | +| `livenessProbe` | Liveness probe configuration | `Check values.yaml file` | +| `prestashopHost` | PrestaShop host to create application URLs (when ingress, it will be ignored) | `nil` | +| `prestashopUsername` | User of the application | `user@example.com` | +| `prestashopPassword` | Application password | _random 10 character long alphanumeric string_ | +| `prestashopEmail` | Admin email | `user@example.com` | +| `prestashopFirstName` | First Name | `Bitnami` | +| `prestashopLastName` | Last Name | `Name` | +| `prestashopCookieCheckIP` | Whether to check the cookie's IP address or not | `no` | +| `prestashopCountry` | Default country of the store | `us` | +| `prestashopLanguage` | Default language of the store (iso code) | `en` | +| `prestashopSkipInstall` | Skip PrestaShop installation wizard (`no` / `yes`) | `no` | +| `nodeSelector` | Node labels for pod assignment | `{}` (The value is evaluated as a template) | +| `persistence.accessMode` | PVC Access Mode for PrestaShop volume | `ReadWriteOnce` | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.existingClaim` | An Existing PVC name | `nil` | +| `persistence.hostPath` | Host mount path for PrestaShop volume | `nil` (will not mount to a host path) | +| `persistence.size` | PVC Storage Request for PrestaShop volume | `8Gi` | +| `persistence.storageClass` | PVC Storage Class for PrestaShop volume | `nil` (uses alpha storage class annotation) | +| `podAnnotations` | Pod annotations | `{}` | +| `podLabels` | Add additional labels to the pod (evaluated as a template) | `nil` | +| `podSecurityContext.enabled` | Enable PrestaShop pods' Security Context | `true` | +| `podSecurityContext.fsGroup` | PrestaShop pods' group ID | `1001` | +| `readinessProbe` | Readiness probe configuration | `Check values.yaml file` | +| `replicaCount` | Number of PrestaShop Pods to run | `1` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `sidecars` | Attach additional containers to the pod (evaluated as a template) | `nil` | +| `smtpHost` | SMTP host | `nil` | +| `smtpPort` | SMTP port | `nil` (but prestashop internal default is 25) | +| `smtpProtocol` | SMTP Protocol (options: ssl,tls, nil) | `nil` | +| `smtpUser` | SMTP user | `nil` | +| `smtpPassword` | SMTP password | `nil` | +| `tolerations` | Tolerations for pod assignment | `[]` (The value is evaluated as a template) | +| `updateStrategy` | Deployment update strategy | `nil` | + +### Traffic Exposure Parameters + +| Parameter | Description | Default | +|----------------------------------|---------------------------------------|--------------------| +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `8080` | +| `service.httpsPort` | Service HTTPS port | `8443` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | +| `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.certManager` | Add annotations for cert-manager | `false` | +| `ingress.hostname` | Default host for the ingress resource | `prestashop.local` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.hosts[0].name` | Hostname to your PrestaShop installation | `nil` | +| `ingress.hosts[0].path` | Path within the url structure | `nil` | +| `ingress.tls[0].hosts[0]` | TLS hosts | `nil` | +| `ingress.tls[0].secretName` | TLS Secret (certificates) | `nil` | +| `ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ingress.secrets[0].key` | TLS Secret Key | `nil` | + +### Database parameters + +| Parameter | Description | Default | +|--------------------------------------------|------------------------------------------|------------------------------------------------| +| `mariadb.enabled` | Whether to use the MariaDB chart | `true` | +| `mariadb.rootUser.password` | MariaDB admin password | `nil` | +| `mariadb.db.name` | Database name to create | `bitnami_prestashop` | +| `mariadb.db.user` | Database user to create | `bn_prestashop` | +| `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | +| `mariadb.replication.enabled` | MariaDB replication enabled | `false` | +| `mariadb.master.persistence.enabled` | Enable database persistence using PVC | `true` | +| `mariadb.master.persistence.accessMode` | Database Persistent Volume Access Modes | `ReadWriteOnce` | +| `mariadb.master.persistence.size` | Database Persistent Volume Size | `8Gi` | +| `mariadb.master.persistence.existingClaim` | Enable persistence using an existing PVC | `nil` | +| `mariadb.master.persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) | +| `mariadb.master.persistence.hostPath` | Host mount path for MariaDB volume | `nil` (will not mount to a host path) | +| `externalDatabase.user` | Existing username in the external db | `bn_prestashop` | +| `externalDatabase.password` | Password for the above username | `nil` | +| `externalDatabase.database` | Name of the existing database | `bitnami_prestashop` | +| `externalDatabase.host` | Host of the existing database | `nil` | +| `externalDatabase.port` | Port of the existing database | `3306` | + +### Metrics parameters + +| Parameter | Description | Default | +|-----------------------------|--------------------------------------------------|--------------------------------------------------------------| +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | +| `metrics.image.registry` | Apache exporter image registry | `docker.io` | +| `metrics.image.repository` | Apache exporter image name | `bitnami/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `{TAG_NAME}` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | +| `metrics.resources` | Exporter resource requests/limit | {} | The above parameters map to the env variables defined in [bitnami/prestashop](http://github.com/bitnami/bitnami-docker-prestashop). For more information please refer to the [bitnami/prestashop](http://github.com/bitnami/bitnami-docker-prestashop) image documentation. @@ -204,6 +250,14 @@ To enable SSL on all pages, follow these steps: ## Upgrading +### To 10.0.0 + +The [Bitnami PrestaShop](https://github.com/bitnami/bitnami-docker-prestashop) image was updated to support and enable the "non-root" user approach + +If you want to continue to run the container image as the `root` user, you need to set `podSecurityContext.enabled=false` and `containerSecurity.context.enabled=false`. + +This upgrade also adapts the chart to the latest Bitnami good practices. Check the Parameters section for more information. + ### To 9.0.0 Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec. diff --git a/bitnami/prestashop/requirements.lock b/bitnami/prestashop/requirements.lock index 6fab65dd8..9a31e3f86 100644 --- a/bitnami/prestashop/requirements.lock +++ b/bitnami/prestashop/requirements.lock @@ -2,5 +2,8 @@ dependencies: - name: mariadb repository: https://charts.bitnami.com/bitnami version: 7.10.2 -digest: sha256:de40add8388c04bd253723f085cf7daff51b30636b34b84f05e6d4ee3da47a11 -generated: "2020-09-24T18:44:51.519864421Z" +- name: common + repository: https://charts.bitnami.com/bitnami + version: 0.7.1 +digest: sha256:69d52756d54f7f7b91b7f6ea62f495dd8dfbe64865a66a8961e5dbabb6ac6b05 +generated: "2020-09-22T16:31:57.783305769+02:00" diff --git a/bitnami/prestashop/requirements.yaml b/bitnami/prestashop/requirements.yaml index 071b34ae7..c8c5ed43d 100644 --- a/bitnami/prestashop/requirements.yaml +++ b/bitnami/prestashop/requirements.yaml @@ -1,5 +1,8 @@ dependencies: -- name: mariadb - version: 7.x.x - repository: https://charts.bitnami.com/bitnami - condition: mariadb.enabled + - name: mariadb + version: 7.x.x + repository: https://charts.bitnami.com/bitnami + condition: mariadb.enabled + - name: common + version: 0.x.x + repository: https://charts.bitnami.com/bitnami diff --git a/bitnami/prestashop/templates/NOTES.txt b/bitnami/prestashop/templates/NOTES.txt index 184c36857..eade89282 100644 --- a/bitnami/prestashop/templates/NOTES.txt +++ b/bitnami/prestashop/templates/NOTES.txt @@ -12,16 +12,16 @@ host. To configure PrestaShop with the URL of your service: {{- if contains "NodePort" .Values.service.type }} - export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") + export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prestashop.fullname" . }}' + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "common.names.fullname" . }}' - export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") - export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) + export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") + export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.secretName" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) {{- if .Values.mariadb.mariadbRootPassword }} export DATABASE_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} @@ -49,7 +49,7 @@ host. To configure PrestaShop with the URL of your service: echo "Store URL: http://127.0.0.1:8080/" echo "Admin URL: http://127.0.0.1:8080/administration" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "prestashop.fullname" . }} 8080:{{ .Values.service.port }} + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }} 8080:{{ .Values.service.port }} {{- else }} @@ -64,7 +64,7 @@ host. To configure PrestaShop with the URL of your service: echo Admin Email : {{ .Values.prestashopEmail }} echo Admin Username: {{ .Values.prestashopUsername }} - echo Admin Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) + echo Admin Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.secretName" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) {{- end }} {{- else -}} @@ -84,14 +84,14 @@ host. To configure PrestaShop to use and external database host: {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prestashop.fullname" . }}' + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "common.names.fullname" . }}' - export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") + export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") {{- else }} export APP_HOST=127.0.0.1 {{- end }} - export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.fullname" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) + export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "prestashop.secretName" . }} -o jsonpath="{.data.prestashop-password}" | base64 --decode) ## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ## @@ -99,9 +99,4 @@ host. To configure PrestaShop to use and external database host: --set prestashopPassword=$APP_PASSWORD,prestashopHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST{{- if .Values.global }}{{- if .Values.global.imagePullSecrets }},global.imagePullSecrets={{ .Values.global.imagePullSecrets }}{{- end }}{{- end }} {{- end }} -{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }} - -WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. -+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ - -{{- end }} +{{- include "prestashop.checkRollingTags" . }} diff --git a/bitnami/prestashop/templates/_helpers.tpl b/bitnami/prestashop/templates/_helpers.tpl index 36bfd14f1..03f34f8df 100644 --- a/bitnami/prestashop/templates/_helpers.tpl +++ b/bitnami/prestashop/templates/_helpers.tpl @@ -1,35 +1,3 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "prestashop.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "prestashop.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "prestashop.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). @@ -69,125 +37,41 @@ When using Ingress, it will be set to the Ingress hostname. Return the proper Prestashop image name */}} {{- define "prestashop.image" -}} -{{- $registryName := .Values.image.registry -}} -{{- $repositoryName := .Values.image.repository -}} -{{- $tag := .Values.image.tag | toString -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. -Also, we can't use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} - {{- if .Values.global.imageRegistry }} - {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} - {{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} - {{- end -}} -{{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} -{{- end -}} +{{- include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) -}} {{- end -}} {{/* Return the proper image name (for the metrics image) */}} {{- define "prestashop.metrics.image" -}} -{{- $registryName := .Values.metrics.image.registry -}} -{{- $repositoryName := .Values.metrics.image.repository -}} -{{- $tag := .Values.metrics.image.tag | toString -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. -Also, we can't use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} - {{- if .Values.global.imageRegistry }} - {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} - {{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} - {{- end -}} -{{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} -{{- end -}} +{{- include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) -}} {{- end -}} {{/* Return the proper Docker Image Registry Secret Names */}} {{- define "prestashop.imagePullSecrets" -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. -Also, we can not use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} -{{- if .Values.global.imagePullSecrets }} -imagePullSecrets: -{{- range .Values.global.imagePullSecrets }} - - name: {{ . }} -{{- end }} -{{- else if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }} -imagePullSecrets: -{{- range .Values.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- range .Values.metrics.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- end -}} -{{- else if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }} -imagePullSecrets: -{{- range .Values.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- range .Values.metrics.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- end -}} +{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image) "global" .Values.global) -}} {{- end -}} {{/* Return the proper Storage Class */}} {{- define "prestashop.storageClass" -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. -*/}} -{{- if .Values.global -}} - {{- if .Values.global.storageClass -}} - {{- if (eq "-" .Values.global.storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" .Values.global.storageClass -}} - {{- end -}} - {{- else -}} - {{- if .Values.persistence.storageClass -}} - {{- if (eq "-" .Values.persistence.storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" .Values.persistence.storageClass -}} - {{- end -}} - {{- end -}} - {{- end -}} -{{- else -}} - {{- if .Values.persistence.storageClass -}} - {{- if (eq "-" .Values.persistence.storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" .Values.persistence.storageClass -}} - {{- end -}} - {{- end -}} -{{- end -}} +{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) -}} {{- end -}} {{/* -Return the appropriate apiVersion for deployment. +PrestaShop credential secret name */}} -{{- define "prestashop.deployment.apiVersion" -}} -{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} -{{- print "extensions/v1beta1" -}} -{{- else -}} -{{- print "apps/v1" -}} +{{- define "prestashop.secretName" -}} +{{- coalesce .Values.existingSecret (include "common.names.fullname" .) -}} {{- end -}} + +{{/* +Check if there are rolling tags in the images +*/}} +{{- define "prestashop.checkRollingTags" -}} +{{- include "common.warnings.rollingTag" .Values.image -}} +{{- include "common.warnings.rollingTag" .Values.metrics.image -}} {{- end -}} diff --git a/bitnami/prestashop/templates/deployment.yaml b/bitnami/prestashop/templates/deployment.yaml index 97d7ccb4a..4aa592f2a 100644 --- a/bitnami/prestashop/templates/deployment.yaml +++ b/bitnami/prestashop/templates/deployment.yaml @@ -1,198 +1,254 @@ {{- if include "prestashop.host" . -}} -apiVersion: {{ template "prestashop.deployment.apiVersion" . }} +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ template "prestashop.fullname" . }} - labels: - app: "{{ template "prestashop.name" . }}" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} + name: {{ template "common.names.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} spec: selector: - matchLabels: - app: {{ template "prestashop.name" . }} - release: "{{ .Release.Name }}" + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + {{- if .Values.updateStrategy }} + strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} + {{- end }} + replicas: {{ .Values.replicaCount }} template: metadata: - labels: - app: "{{ template "prestashop.name" . }}" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} -{{- if or .Values.podAnnotations .Values.metrics.enabled }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} + {{- end }} + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} annotations: - {{- if .Values.podAnnotations }} -{{ toYaml .Values.podAnnotations | indent 8 }} - {{- end }} - {{- if .Values.metrics.podAnnotations }} -{{ toYaml .Values.metrics.podAnnotations | indent 8 }} - {{- end }} -{{- end }} + {{- if .Values.podAnnotations }} + {{- toYaml .Values.podAnnotations | nindent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} + {{- toYaml .Values.metrics.podAnnotations | nindent 8 }} + {{- end }} spec: -{{- include "prestashop.imagePullSecrets" . | indent 6 }} + {{- include "prestashop.imagePullSecrets" . | nindent 6 }} + {{- if .Values.podSecurityContext.enabled }} + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }} + {{- end }} hostAliases: - - ip: "127.0.0.1" - hostnames: - - "status.localhost" + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "prestashop.fullname" . }} - image: {{ template "prestashop.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - env: - - name: ALLOW_EMPTY_PASSWORD - value: {{ .Values.allowEmptyPassword | quote }} - {{- if .Values.prestashopCookieCheckIP }} - - name: PRESTASHOP_COOKIE_CHECK_IP - value: {{ .Values.prestashopCookieCheckIP | quote }} - {{- end }} - {{- if .Values.prestashopCountry }} - - name: PRESTASHOP_COUNTRY - value: {{ .Values.prestashopCountry | quote }} - {{- end }} - {{- if .Values.prestashopLanguage }} - - name: PRESTASHOP_LANGUAGE - value: {{ .Values.prestashopLanguage | quote }} - {{- end }} - {{- if .Values.mariadb.enabled }} - - name: MARIADB_HOST - value: {{ template "prestashop.mariadb.fullname" . }} - - name: MARIADB_PORT_NUMBER - value: "3306" - - name: PRESTASHOP_DATABASE_NAME - value: {{ .Values.mariadb.db.name | quote }} - - name: PRESTASHOP_DATABASE_USER - value: {{ .Values.mariadb.db.user | quote }} - - name: PRESTASHOP_DATABASE_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "prestashop.mariadb.fullname" . }} - key: mariadb-password - {{- else }} - - name: MARIADB_HOST - value: {{ .Values.externalDatabase.host | quote }} - - name: MARIADB_PORT_NUMBER - value: {{ .Values.externalDatabase.port | quote }} - - name: PRESTASHOP_DATABASE_NAME - value: {{ .Values.externalDatabase.database | quote }} - - name: PRESTASHOP_DATABASE_USER - value: {{ .Values.externalDatabase.user | quote }} - - name: PRESTASHOP_DATABASE_PASSWORD - valueFrom: - secretKeyRef: - name: {{ printf "%s-%s" .Release.Name "externaldb" }} - key: db-password - {{- end }} -{{- $port:=.Values.service.port | toString }} - - name: PRESTASHOP_HOST - value: "{{ include "prestashop.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}" - - name: PRESTASHOP_USERNAME - value: {{ .Values.prestashopUsername | quote }} - - name: PRESTASHOP_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "prestashop.fullname" . }} - key: prestashop-password - - name: PRESTASHOP_EMAIL - value: {{ .Values.prestashopEmail | quote }} - - name: PRESTASHOP_FIRST_NAME - value: {{ .Values.prestashopFirstName | quote }} - - name: PRESTASHOP_LAST_NAME - value: {{ .Values.prestashopLastName | quote }} - {{- if .Values.smtpHost }} - - name: SMTP_HOST - value: {{ .Values.smtpHost | quote }} - {{- end }} - {{- if .Values.smtpPort }} - - name: SMTP_PORT - value: {{ .Values.smtpPort | quote }} - {{- end }} - {{- if .Values.smtpUser }} - - name: SMTP_USER - value: {{ .Values.smtpUser | quote }} - {{- end }} - {{- if .Values.smtpPassword }} - - name: SMTP_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "prestashop.fullname" . }} - key: smtp-password - {{- end }} - {{- if .Values.smtpProtocol }} - - name: SMTP_PROTOCOL - value: {{ .Values.smtpProtocol | quote }} - {{- end }} - ports: - - name: http - containerPort: 80 - - name: https - containerPort: 443 - {{- if .Values.livenessProbe.enabled }} - livenessProbe: - httpGet: - path: {{ .Values.livenessProbe.path }} - port: http - httpHeaders: - - name: Host - value: {{ include "prestashop.host" . | quote }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: - httpGet: - path: {{ .Values.readinessProbe.path }} - port: http - httpHeaders: - - name: Host - value: {{ include "prestashop.host" . | quote }} - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.readinessProbe.failureThreshold }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 10 }} - volumeMounts: - - mountPath: /bitnami/prestashop - name: prestashop-data - subPath: prestashop -{{- if .Values.metrics.enabled }} - - name: metrics - image: {{ template "prestashop.metrics.image" . }} - imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} - command: [ '/bin/apache_exporter', '--scrape_uri', 'http://status.localhost:80/server-status/?auto'] - ports: + - name: {{ include "common.names.fullname" . }} + image: {{ template "prestashop.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + {{- if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + env: + - name: BITNAMI_DEBUG + value: {{ ternary "true" "false" .Values.image.debug | quote }} + - name: ALLOW_EMPTY_PASSWORD + value: {{ .Values.allowEmptyPassword | quote }} + - name: APACHE_HTTP_PORT_NUMBER + value: {{ .Values.containerPorts.http | quote }} + - name: APACHE_HTTPS_PORT_NUMBER + value: {{ .Values.containerPorts.https | quote }} + {{- if .Values.prestashopCookieCheckIP }} + - name: PRESTASHOP_COOKIE_CHECK_IP + value: {{ .Values.prestashopCookieCheckIP | quote }} + {{- end }} + {{- if .Values.prestashopCountry }} + - name: PRESTASHOP_COUNTRY + value: {{ .Values.prestashopCountry | quote }} + {{- end }} + {{- if .Values.prestashopLanguage }} + - name: PRESTASHOP_LANGUAGE + value: {{ .Values.prestashopLanguage | quote }} + {{- end }} + {{- if .Values.mariadb.enabled }} + - name: MARIADB_HOST + value: {{ template "prestashop.mariadb.fullname" . }} + - name: MARIADB_PORT_NUMBER + value: "3306" + - name: PRESTASHOP_DATABASE_NAME + value: {{ .Values.mariadb.db.name | quote }} + - name: PRESTASHOP_DATABASE_USER + value: {{ .Values.mariadb.db.user | quote }} + - name: PRESTASHOP_DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "prestashop.mariadb.fullname" . }} + key: mariadb-password + {{- else }} + - name: MARIADB_HOST + value: {{ .Values.externalDatabase.host | quote }} + - name: MARIADB_PORT_NUMBER + value: {{ .Values.externalDatabase.port | quote }} + - name: PRESTASHOP_DATABASE_NAME + value: {{ .Values.externalDatabase.database | quote }} + - name: PRESTASHOP_DATABASE_USER + value: {{ .Values.externalDatabase.user | quote }} + - name: PRESTASHOP_DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ printf "%s-%s" .Release.Name "externaldb" }} + key: db-password + {{- end }} + {{- $port:=.Values.service.port | toString }} + - name: PRESTASHOP_HOST + value: "{{ include "prestashop.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}" + - name: PRESTASHOP_USERNAME + value: {{ .Values.prestashopUsername | quote }} + - name: PRESTASHOP_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "common.names.fullname" . }} + key: prestashop-password + - name: PRESTASHOP_EMAIL + value: {{ .Values.prestashopEmail | quote }} + - name: PRESTASHOP_FIRST_NAME + value: {{ .Values.prestashopFirstName | quote }} + - name: PRESTASHOP_LAST_NAME + value: {{ .Values.prestashopLastName | quote }} + {{- if .Values.smtpHost }} + - name: SMTP_HOST + value: {{ .Values.smtpHost | quote }} + {{- end }} + {{- if .Values.smtpPort }} + - name: SMTP_PORT + value: {{ .Values.smtpPort | quote }} + {{- end }} + {{- if .Values.smtpUser }} + - name: SMTP_USER + value: {{ .Values.smtpUser | quote }} + {{- end }} + {{- if .Values.smtpPassword }} + - name: SMTP_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "common.names.fullname" . }} + key: smtp-password + {{- end }} + {{- if .Values.smtpProtocol }} + - name: SMTP_PROTOCOL + value: {{ .Values.smtpProtocol | quote }} + {{- end }} + {{- if .Values.extraEnvVars }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} + {{- end }} + envFrom: + {{- if .Values.extraEnvVarsCM }} + - configMapRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }} + {{- end }} + {{- if .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + {{- end }} + {{- if .Values.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.containerPorts.http }} + - name: https + containerPort: {{ .Values.containerPorts.https }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: {{ .Values.livenessProbe.path }} + port: http + httpHeaders: + - name: Host + value: {{ include "prestashop.host" . | quote }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- else if .Values.customLivenessProbe }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: {{ .Values.readinessProbe.path }} + port: http + httpHeaders: + - name: Host + value: {{ include "prestashop.host" . | quote }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- else if .Values.customReadinessProbe }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.resources }} + resources: {{ toYaml .Values.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: prestashop-data + mountPath: /bitnami/prestashop + subPath: prestashop + {{- if .Values.extraVolumeMounts }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.metrics.enabled }} - name: metrics - containerPort: 9117 - livenessProbe: - httpGet: - path: /metrics - port: metrics - initialDelaySeconds: 15 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: /metrics - port: metrics - initialDelaySeconds: 5 - timeoutSeconds: 1 - resources: -{{ toYaml .Values.metrics.resources | indent 12 }} -{{- end }} + image: {{ template "prestashop.metrics.image" . }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: [ '/bin/apache_exporter', '--scrape_uri', 'http://status.localhost:80/server-status/?auto'] + ports: + - name: metrics + containerPort: 9117 + livenessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 15 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: metrics + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: {{ toYaml .Values.metrics.resources | nindent 12 }} + {{- end }} + {{- if .Values.sidecars }} + {{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }} + {{- end }} volumes: - - name: prestashop-data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "prestashop.fullname" . }}-prestashop{{- end }} - {{- else }} - emptyDir: {} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} + - name: prestashop-data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "common.names.fullname" . }}-prestashop{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + {{- if .Values.extraVolumes }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }} + {{- end }} {{- end -}} diff --git a/bitnami/prestashop/templates/externaldb-secrets.yaml b/bitnami/prestashop/templates/externaldb-secrets.yaml index ebfb829f9..43e9f4e0d 100644 --- a/bitnami/prestashop/templates/externaldb-secrets.yaml +++ b/bitnami/prestashop/templates/externaldb-secrets.yaml @@ -2,12 +2,8 @@ apiVersion: v1 kind: Secret metadata: - name: "{{ template "prestashop.fullname" . }}-externaldb" - labels: - app: "{{ template "prestashop.name" . }}-externaldb" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} + name: "{{ include "common.names.fullname" . }}-externaldb" + labels: {{- include "common.labels.standard" . | nindent 4 }} type: Opaque data: db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }} diff --git a/bitnami/prestashop/templates/extra-list.yaml b/bitnami/prestashop/templates/extra-list.yaml new file mode 100644 index 000000000..184da188e --- /dev/null +++ b/bitnami/prestashop/templates/extra-list.yaml @@ -0,0 +1,5 @@ +{{- if .Values.extraDeploy }} +apiVersion: v1 +kind: List +items: {{- include "common.tplvalues.render" (dict "value" .Values.extraDeploy "context" $) | nindent 2 }} +{{- end }} diff --git a/bitnami/prestashop/templates/ingress.yaml b/bitnami/prestashop/templates/ingress.yaml index 892ab0f0e..3b5518fce 100644 --- a/bitnami/prestashop/templates/ingress.yaml +++ b/bitnami/prestashop/templates/ingress.yaml @@ -2,36 +2,40 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: {{ template "prestashop.fullname" . }} - labels: - app: "{{ template "prestashop.name" . }}" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} - annotations: - {{- if .Values.ingress.certManager }} - kubernetes.io/tls-acme: "true" + name: {{ include "common.names.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} - {{- range $key, $value := .Values.ingress.annotations }} - {{ $key }}: {{ $value | quote }} + annotations: + {{- if .Values.ingress.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.annotations "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} + {{- if .certManager }} + kubernetes.io/tls-acme: "true" {{- end }} spec: rules: + - host: {{ .Values.ingress.hostname }} + http: + paths: + - path: {{ default "/" .path }} + backend: + serviceName: "{{ include "common.names.fullname" $ }}" + servicePort: http {{- range .Values.ingress.hosts }} - host: {{ .name }} http: paths: - path: {{ default "/" .path }} backend: - serviceName: "{{ template "prestashop.fullname" $ }}" + serviceName: "{{ include "common.names.fullname" $ }}" servicePort: http {{- end }} - tls: - {{- range .Values.ingress.hosts }} {{- if .tls }} - - hosts: - - {{ .name }} - secretName: {{ .tlsSecret }} - {{- end }} + tls: {{- toYaml .Values.ingress.tls | nindent 4 }} {{- end }} {{- end }} diff --git a/bitnami/prestashop/templates/prestashop-pvc.yaml b/bitnami/prestashop/templates/prestashop-pvc.yaml deleted file mode 100644 index db6c0c80e..000000000 --- a/bitnami/prestashop/templates/prestashop-pvc.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if .Values.persistence.enabled -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "prestashop.fullname" . }}-prestashop - labels: - app: "{{ template "prestashop.name" . }}" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} - {{ include "prestashop.storageClass" . }} -{{- end -}} diff --git a/bitnami/prestashop/templates/pv.yaml b/bitnami/prestashop/templates/pv.yaml new file mode 100644 index 000000000..01cbc9ac8 --- /dev/null +++ b/bitnami/prestashop/templates/pv.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.persistence.enabled .Values.persistence.hostPath (not .Values.persistence.existingClaim) -}} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ include "common.names.fullname" . }}-prestashop + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + capacity: + storage: {{ .Values.persistence.size | quote }} + hostPath: + path: {{ .Values.persistence.hostPath | quote }} +{{- end -}} diff --git a/bitnami/prestashop/templates/pvc.yaml b/bitnami/prestashop/templates/pvc.yaml new file mode 100644 index 000000000..23bd99451 --- /dev/null +++ b/bitnami/prestashop/templates/pvc.yaml @@ -0,0 +1,23 @@ +{{- if .Values.persistence.enabled -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "common.names.fullname" . }}-prestashop + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + {{- if .Values.persistence.hostPath }} + storageClassName: "" + {{- end }} + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- include "prestashop.storageClass" . | nindent 2 }} +{{- end -}} diff --git a/bitnami/prestashop/templates/secrets.yaml b/bitnami/prestashop/templates/secrets.yaml index 6cbf30452..c1dcfb1f3 100644 --- a/bitnami/prestashop/templates/secrets.yaml +++ b/bitnami/prestashop/templates/secrets.yaml @@ -1,14 +1,15 @@ +{{- if not .Values.existingSecret }} apiVersion: v1 kind: Secret metadata: - name: {{ template "prestashop.fullname" . }} - labels: - app: "{{ template "prestashop.name" . }}" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} - annotations: - "helm.sh/hook": pre-install + name: {{ include "common.names.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} type: Opaque data: {{- if .Values.prestashopPassword }} @@ -19,3 +20,4 @@ data: {{- if .Values.smtpPassword }} smtp-password: {{ .Values.smtpPassword | b64enc | quote }} {{- end }} +{{- end }} diff --git a/bitnami/prestashop/templates/svc.yaml b/bitnami/prestashop/templates/svc.yaml index ad78af06c..a2dd90be4 100644 --- a/bitnami/prestashop/templates/svc.yaml +++ b/bitnami/prestashop/templates/svc.yaml @@ -1,12 +1,14 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "prestashop.fullname" . }} - labels: - app: "{{ template "prestashop.name" . }}" - chart: "{{ template "prestashop.chart" . }}" - release: {{ .Release.Name | quote }} - heritage: {{ .Release.Service | quote }} + name: {{ include "common.names.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} @@ -28,6 +30,4 @@ spec: {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} nodePort: {{ .Values.service.nodePorts.https }} {{- end }} - selector: - app: "{{ template "prestashop.name" . }}" - release: "{{ .Release.Name }}" + selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/bitnami/prestashop/templates/tls-secrets.yaml b/bitnami/prestashop/templates/tls-secrets.yaml index 245f8f398..36742a979 100644 --- a/bitnami/prestashop/templates/tls-secrets.yaml +++ b/bitnami/prestashop/templates/tls-secrets.yaml @@ -4,11 +4,13 @@ apiVersion: v1 kind: Secret metadata: name: {{ .name }} - labels: - app: {{ template "prestashop.name" $ }} - chart: {{ template "prestashop.chart" $ }} - release: {{ $.Release.Name }} - heritage: {{ $.Release.Service }} + labels: {{- include "common.labels.standard" $ | nindent 4 }} + {{- if $.Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if $.Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} type: kubernetes.io/tls data: tls.crt: {{ .certificate | b64enc }} diff --git a/bitnami/prestashop/values.yaml b/bitnami/prestashop/values.yaml index 3fa53446b..eaf72cd98 100644 --- a/bitnami/prestashop/values.yaml +++ b/bitnami/prestashop/values.yaml @@ -14,7 +14,7 @@ image: registry: docker.io repository: bitnami/prestashop - tag: 1.7.6-8-debian-10-r0 + tag: 1.7.6-8-debian-10-r4 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -24,21 +24,29 @@ image: ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## - # pullSecrets: + pullSecrets: # - myRegistryKeySecretName + ## Set to true if you would like to see extra information on logs + ## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging + ## + debug: false ## String to partially override prestashop.fullname template (will maintain the release name) ## -# nameOverride: +nameOverride: ## String to fully override prestashop.fullname template ## -# fullnameOverride: +fullnameOverride: + +## Number of replicas (requires ReadWriteMany PVC support) +## +replicaCount: 1 ## PrestaShop host to create application URLs ## ref: https://github.com/bitnami/bitnami-docker-prestashop#configuration ## -# prestashopHost: +prestashopHost: ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-prestashop#configuration @@ -49,7 +57,7 @@ prestashopUsername: user@example.com ## Defaults to a random 10-character alphanumeric string if not set ## ref: https://github.com/bitnami/bitnami-docker-prestashop#configuration ## -# prestashopPassword: +prestashopPassword: ## Admin email ## ref: https://github.com/bitnami/bitnami-docker-prestashop#configuration @@ -83,35 +91,104 @@ prestashopLanguage: "en" ## Set to `yes` to allow the container to be started with blank passwords ## ref: https://github.com/bitnami/bitnami-docker-prestashop#environment-variables +## allowEmptyPassword: "yes" +## Container command (using container default if not set) +## +command: +## Container args (using container default if ot set) +## +args: + +## Common annotations to add to all PrestaShop resources (sub-charts are not considered). Evaluated as a template +## +commonAnnotations: {} + +## Common labels to add to all PrestaShop resources (sub-charts are not considered). Evaluated as a template +## +commonLabels: {} + +## Update strategy - only really applicable for deployments with RWO PVs attached +## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the +## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will +## terminate the single previous pod, so that the new, incoming pod can attach to the PV +## +updateStrategy: + type: RollingUpdate + +## An array to add extra env vars +## For example: +## +extraEnvVars: [] +# - name: BEARER_AUTH +# value: true + +## ConfigMap with extra environment variables +## +extraEnvVarsCM: + +## Secret with extra environment variables +## +extraEnvVarsSecret: + +## Extra volumes to add to the deployment +## +extraVolumes: [] + +## Extra volume mounts to add to the container +## +extraVolumeMounts: [] + +## Extra init containers to add to the deployment +## +initContainers: [] + +## Extra sidecar containers to add to the deployment +## +sidecars: [] + +## Tolerations for pod assignment. Evaluated as a template. +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Use existing secret for the application password +## +existingSecret: + ## ## External database configuration ## externalDatabase: ## Database host + ## host: ## Database host + ## port: 3306 ## Database user - user: bn_jasperreports + ## + user: bn_prestashop ## Database password + ## password: ## Database name + ## database: bitnami_prestashop ## SMTP mail delivery configuration ## ref: https://github.com/bitnami/bitnami-docker-prestashop/#smtp-configuration ## -# smtpHost: -# smtpPort: -# smtpUser: -# smtpPassword: -# smtpProtocol: +smtpHost: +smtpPort: +smtpUser: +smtpPassword: +smtpProtocol: ## ## MariaDB chart configuration @@ -120,14 +197,17 @@ externalDatabase: ## mariadb: ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters + ## enabled: true ## Tag for the Bitnami MariaDB image to use ## ref: https://github.com/bitnami/bitnami-docker-mariadb + ## image: registry: docker.io repository: bitnami/mariadb - tag: 10.1.46-debian-10-r39 + tag: 10.1.46-debian-10-r47 ## Disable MariaDB replication + ## replication: enabled: false @@ -137,15 +217,15 @@ mariadb: db: name: bitnami_prestashop user: bn_prestashop - ## If the password is not specified, mariadb will generates a random password + ## If the password is not specified, mariadb will generate a random password ## - # password: + password: "" ## MariaDB admin password ## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#setting-the-root-password-on-first-run ## - # rootUser: - # password: + rootUser: + password: "" ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ @@ -160,9 +240,22 @@ mariadb: ## set, choosing the default provisioner. (gp2 on AWS, standard on ## GKE, AWS & OpenStack) ## - # storageClass: "-" - accessMode: ReadWriteOnce + storageClass: + accessMode: + - ReadWriteOnce size: 8Gi + ## Set path in case you want to use local host path volumes (not recommended in production) + ## + hostPath: + ## Use an existing PVC + ## + existingClaim: + +## Container ports +## +containerPorts: + http: 8080 + https: 8443 ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer @@ -194,31 +287,43 @@ service: ## ingress: ## Set to true to enable ingress record generation + ## enabled: false ## Set this to true in order to add the corresponding annotations for cert-manager + ## certManager: false + ## When the ingress is enabled, a host pointing to this will be created + ## + hostname: prestashop.local + ## Ingress annotations done as key:value pairs ## For a full list of possible ingress annotations, please see ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md ## ## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set - annotations: + ## + annotations: {} # kubernetes.io/ingress.class: nginx - ## The list of hostnames to be covered with this ingress record. - ## Most likely this will be just one host, but in the event more hosts are needed, this is an array + ## The list of additional hostnames to be covered with this ingress record. + ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array + ## hosts: + ## - name: prestashop.local + ## path: / + ## hosts: - - name: prestashop.local - path: / + ## The tls configuration for the ingress + ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls - # Set this to true in order to enable TLS on the ingress record - tls: false - - ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS - tlsSecret: prestashop.local-tls + ## tls: + ## - hosts: + ## - prestashop.local + ## secretName: prestashop.local-tls + ## + tls: secrets: ## If you're providing your own certificates, please use this to add the certificates as secrets @@ -230,6 +335,7 @@ ingress: ## ## It is also possible to create and manage the certificates outside of this helm chart ## Please see README.md for more information + ## # - name: prestashop.local-tls # key: # certificate: @@ -256,11 +362,33 @@ persistence: ## A manually managed Persistent Volume and Claim ## Requires persistence.enabled: true ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - + ## accessMode: ReadWriteOnce size: 8Gi + ## A manually managed Persistent Volume Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + ## + # existingClaim: + + ## If defined, the drupal-data volume will mount to the specified hostPath. + ## Requires persistence.enabled: true + ## Requires persistence.existingClaim: nil|false + ## Default: nil. + ## + hostPath: + +## Affinity for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Node labels for pod assignment. Evaluated as a template. +## ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## @@ -269,6 +397,20 @@ resources: memory: 512Mi cpu: 300m +## Configure Pods Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod +## +podSecurityContext: + enabled: true + fsGroup: 1001 + +## Configure Container Security Context (only main container) +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container +## +containerSecurityContext: + enabled: true + runAsUser: 1001 + ## Configure extra options for liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) livenessProbe: @@ -288,15 +430,27 @@ readinessProbe: failureThreshold: 6 successThreshold: 1 +## Custom Liveness probe +## +customLivenessProbe: {} + +## Custom Readiness probe +## +customReadinessProbe: {} + +## lifecycleHooks for the container to automate configuration before or after startup. +## +lifecycleHooks: + ## Pod annotations ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ ## podAnnotations: {} -## Affinity for pod assignment -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## Pod extra labels +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ ## -affinity: {} +podLabels: {} ## Prometheus Exporter / Metrics ## @@ -305,19 +459,24 @@ metrics: image: registry: docker.io repository: bitnami/apache-exporter - tag: 0.8.0-debian-10-r159 + tag: 0.8.0-debian-10-r167 pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## - # pullSecrets: + pullSecrets: # - myRegistryKeySecretName - ## Metrics exporter pod Annotation and Labels - podAnnotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9117" ## Metrics exporter resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## # resources: {} + ## Metrics exporter pod Annotation and Labels + ## + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9117" + +## Array with extra yaml to deploy with the chart. Evaluated as a template +## +extraDeploy: []