diff --git a/stable/joomla/Chart.yaml b/stable/joomla/Chart.yaml index 730f6e338a..e374dc63d3 100644 --- a/stable/joomla/Chart.yaml +++ b/stable/joomla/Chart.yaml @@ -1,5 +1,5 @@ name: joomla -version: 3.3.2 +version: 3.4.0 appVersion: 3.9.0 description: PHP content management system (CMS) for publishing web content keywords: diff --git a/stable/joomla/README.md b/stable/joomla/README.md index 2347c0a274..bfaf3a8c0d 100644 --- a/stable/joomla/README.md +++ b/stable/joomla/README.md @@ -114,6 +114,15 @@ The following table lists the configurable parameters of the Joomla! chart and t | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | List of node taints to tolerate | `[]` | | `affinity` | Map of node/pod affinities | `{}` | +| `podAnnotations` | Pod annotations | `{}` | +| `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 | `lusotycoon/apache-exporter` | +| `metrics.image.tag` | Apache exporter image tag | `v0.5.0` | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | +| `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/joomla](http://github.com/bitnami/bitnami-docker-joomla). For more information please refer to the [bitnami/joomla](http://github.com/bitnami/bitnami-docker-joomla) image documentation. diff --git a/stable/joomla/templates/_helpers.tpl b/stable/joomla/templates/_helpers.tpl index 1a7e5a7372..90fb598eb4 100644 --- a/stable/joomla/templates/_helpers.tpl +++ b/stable/joomla/templates/_helpers.tpl @@ -52,3 +52,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "joomla.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper image name (for the metrics image) +*/}} +{{- define "metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} +{{- $repositoryName := .Values.metrics.image.repository -}} +{{- $tag := .Values.metrics.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/stable/joomla/templates/deployment.yaml b/stable/joomla/templates/deployment.yaml index 1032233c8e..78b7ad1de5 100644 --- a/stable/joomla/templates/deployment.yaml +++ b/stable/joomla/templates/deployment.yaml @@ -20,6 +20,15 @@ spec: app: {{ template "joomla.fullname" . }} chart: {{ template "joomla.chart" . }} release: {{ .Release.Name | quote }} +{{- if or .Values.podAnnotations .Values.metrics.enabled }} + annotations: + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + {{- if .Values.metrics.podAnnotations }} +{{ toYaml .Values.metrics.podAnnotations | indent 8 }} + {{- end }} +{{- end }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -27,8 +36,12 @@ spec: - name: {{ . }} {{- end}} {{- end }} + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "status.localhost" containers: - - name: {{ template "joomla.fullname" . }} + - name: joomla image: {{ template "joomla.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: @@ -129,6 +142,29 @@ spec: mountPath: /bitnami/joomla - name: apache-data mountPath: /bitnami/apache +{{- if .Values.metrics.enabled }} + - name: metrics + image: {{ template "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 | indent 10 }} +{{- end }} volumes: - name: joomla-data {{- if .Values.persistence.enabled }} diff --git a/stable/joomla/values.yaml b/stable/joomla/values.yaml index 56438a5992..e7300be7ef 100644 --- a/stable/joomla/values.yaml +++ b/stable/joomla/values.yaml @@ -254,3 +254,33 @@ tolerations: [] ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} + +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## Prometheus Exporter / Metrics +## +metrics: + enabled: false + + image: + registry: docker.io + repository: lusotycoon/apache-exporter + tag: v0.5.0 + 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: + # - myRegistrKeySecretName + + ## 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: {}