Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/phpbb] Add apache exporter (#8854)
Browse files Browse the repository at this point in the history
* [stable/phpbb] Add apache exporter

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>

* [stable/phpbb] Add podAnnotations

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>

* [stable/phpbb] Add podAnnotations

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>
  • Loading branch information
javsalgar authored and k8s-ci-robot committed Oct 31, 2018
1 parent e6e4e73 commit 856f64c
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/phpbb/Chart.yaml
@@ -1,5 +1,5 @@
name: phpbb
version: 3.1.1
version: 3.2.0
appVersion: 3.2.3
description: Community forum that supports the notion of users and groups, file attachments,
full-text search, notifications and more.
Expand Down
9 changes: 9 additions & 0 deletions stable/phpbb/README.md
Expand Up @@ -81,6 +81,15 @@ The following table lists the configurable parameters of the phpBB chart and the
| `persistence.phpbb.accessMode` | PVC Access Mode for phpBB volume | `ReadWriteOnce` |
| `persistence.phpbb.size` | PVC Storage Request for phpBB volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |
| `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/phpbb](http://github.com/bitnami/bitnami-docker-phpbb). For more information please refer to the [bitnami/phpbb](http://github.com/bitnami/bitnami-docker-phpbb) image documentation.

Expand Down
10 changes: 10 additions & 0 deletions stable/phpbb/templates/_helpers.tpl
Expand Up @@ -45,3 +45,13 @@ Also, we can't use a single if because lazy evaluation is not an option
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- 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 -}}
36 changes: 36 additions & 0 deletions stable/phpbb/templates/deployment.yaml
Expand Up @@ -20,13 +20,26 @@ spec:
app: {{ template "phpbb.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
{{- 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:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "status.localhost"
containers:
- name: {{ template "phpbb.fullname" . }}
image: {{ template "phpbb.image" . }}
Expand Down Expand Up @@ -112,6 +125,29 @@ spec:
mountPath: /bitnami/phpbb
- 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: phpbb-data
{{- if .Values.persistence.enabled }}
Expand Down
28 changes: 28 additions & 0 deletions stable/phpbb/values.yaml
Expand Up @@ -155,3 +155,31 @@ resources:
requests:
memory: 512Mi
cpu: 300m

## 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: {}

0 comments on commit 856f64c

Please sign in to comment.