From b13f0b1cbba02d9bbcc032d42e13c6b2fc2d5678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Rodr=C3=ADguez=20Hern=C3=A1ndez?= Date: Tue, 11 Jun 2019 15:38:20 +0200 Subject: [PATCH] [stable/wordpress] Unify and document production values (#14665) * Unify and document production values Signed-off-by: Carlos Rodriguez Hernandez * Fix typo Signed-off-by: Carlos Rodriguez Hernandez * Add suggestion Signed-off-by: Carlos Rodriguez Hernandez * Bump version Signed-off-by: Carlos Rodriguez Hernandez --- stable/wordpress/Chart.yaml | 2 +- stable/wordpress/README.md | 61 ++++++++++++++++++++----- stable/wordpress/values-production.yaml | 13 ++++-- stable/wordpress/values.yaml | 6 +-- 4 files changed, 64 insertions(+), 18 deletions(-) diff --git a/stable/wordpress/Chart.yaml b/stable/wordpress/Chart.yaml index c1e4c1e85f..667b3eb37b 100644 --- a/stable/wordpress/Chart.yaml +++ b/stable/wordpress/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: wordpress -version: 5.12.2 +version: 5.12.3 appVersion: 5.2.1 description: Web publishing platform for building blogs and websites. icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png diff --git a/stable/wordpress/README.md b/stable/wordpress/README.md index 8045c5fb4e..bd41ac3a3d 100644 --- a/stable/wordpress/README.md +++ b/stable/wordpress/README.md @@ -54,7 +54,7 @@ The following table lists the configurable parameters of the WordPress chart and | `image.registry` | WordPress image registry | `docker.io` | | `image.repository` | WordPress image name | `bitnami/wordpress` | | `image.tag` | WordPress image tag | `{TAG_NAME}` | -| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | +| `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) | | `wordpressSkipInstall` | Skip wizard installation | `false` | | `wordpressUsername` | User of the application | `user` | @@ -146,22 +146,55 @@ $ helm install --name my-release -f values.yaml stable/wordpress > **Tip**: You can use the default [values.yaml](values.yaml) -### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/) +### Production configuration -It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image. - -Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist. - -## Production and horizontal scaling - -The following repo contains the recommended production settings for wordpress capture in an alternative [values file](values-production.yaml). Please read carefully the comments in the values-production.yaml file to set up your environment appropriately. - -To horizontally scale this chart, first download the [values-production.yaml](values-production.yaml) file to your local folder, then: +This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. ```console $ helm install --name my-release -f ./values-production.yaml stable/wordpress ``` +- Set Apache AllowOverride directive to None: +```diff +- allowOverrideNone: false ++ allowOverrideNone: true +``` + +- Number of WordPress Pods to run +```diff +- replicaCount: 1 ++ replicaCount: 3 +``` + +- Kubernetes Service type: +```diff +- service.type: LoadBalancer ++ service.type: ClusterIP +``` + +- Enable client source IP preservation: +```diff +- service.externalTrafficPolicy: Cluster ++ service.externalTrafficPolicy: Local +``` + +- PVC Access Mode: +```diff +- persistence.accessMode: ReadWriteOnce ++ ## ++ ## To use the /admin portal and to ensure you can scale wordpress you need to provide a ++ ## ReadWriteMany PVC, if you dont have a provisioner for this type of storage ++ ## We recommend that you install the nfs provisioner and map it to a RWO volume ++ ## helm install stable/nfs-server-provisioner --set persistence.enabled=true,persistence.size=10Gi ++ persistence.accessMode: ReadWriteMany +``` + +- Start a side-car prometheus exporter: +```diff +- metrics.enabled: false ++ metrics.enabled: true +``` + Note that [values-production.yaml](values-production.yaml) includes a replicaCount of 3, so there will be 3 WordPress pods. As a result, to use the /admin portal and to ensure you can scale wordpress you need to provide a ReadWriteMany PVC, if you don't have a provisioner for this type of storage, we recommend that you install the nfs provisioner and map it to a RWO volume. ```console @@ -169,6 +202,12 @@ $ helm install stable/nfs-server-provisioner --set persistence.enabled=true,pers $ helm install --name my-release -f values-production.yaml --set persistence.storageClass=nfs stable/wordpress --set mariadb.master.persistence.storageClass=nfs ``` +### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/) + +It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image. + +Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist. + ## Sidecars If you have a need for additional containers to run within the same pod as WordPress (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec. diff --git a/stable/wordpress/values-production.yaml b/stable/wordpress/values-production.yaml index 7e3491eef6..440b1a5449 100644 --- a/stable/wordpress/values-production.yaml +++ b/stable/wordpress/values-production.yaml @@ -14,6 +14,10 @@ image: registry: docker.io repository: bitnami/wordpress tag: 5.2.1-debian-9-r21 + ## 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 + ## pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -80,7 +84,7 @@ updateStrategy: allowEmptyPassword: true ## Set Apache allowOverride to None - +## ref: https://github.com/bitnami/bitnami-docker-wordpress#environment-variables ## allowOverrideNone: true @@ -193,7 +197,6 @@ service: ## Allow health checks to be pointed at the https port healthcheckHttps: false - ## Configure extra options for liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) livenessProbe: @@ -314,6 +317,10 @@ tolerations: [] ## affinity: {} +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} ## Prometheus Exporter / Metrics ## metrics: @@ -329,7 +336,7 @@ metrics: ## # pullSecrets: # - myRegistryKeySecretName - ## Metrics exporter pod Annotation and Labels + ## Metrics exporter pod Annotation and Labels podAnnotations: prometheus.io/scrape: "true" prometheus.io/port: "9117" diff --git a/stable/wordpress/values.yaml b/stable/wordpress/values.yaml index 93f381e142..ca5e8eb9a8 100644 --- a/stable/wordpress/values.yaml +++ b/stable/wordpress/values.yaml @@ -335,9 +335,9 @@ metrics: podAnnotations: prometheus.io/scrape: "true" prometheus.io/port: "9117" - ## Metrics exporter resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## + ## Metrics exporter resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## # resources: {} sidecars: