Skip to content

Commit 74999cc

Browse files
committed
Creat appropriate vhost for httpd metrics
Fixes #276
1 parent b0aabcd commit 74999cc

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

charts/yourls/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
version: 6.0.0
2+
version: 6.1.0
33
name: yourls
44
description: Your Own URL Shortener
55
appVersion: "1.9.2"
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<VirtualHost 127.0.0.1:80>
2+
ServerName status.localhost
3+
<Location /server-status>
4+
Require local
5+
SetHandler server-status
6+
</Location>
7+
</VirtualHost>

charts/yourls/templates/deployment.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ spec:
210210
- mountPath: /docker-entrypoint-init.d
211211
name: custom-postinit
212212
{{- end }}
213+
{{- if and .Values.metrics.enabled .Values.metrics.apacheVhost }}
214+
- name: apache-metrics
215+
mountPath: /etc/apache2/sites-available/00_status-vhost.conf
216+
subPath: 00_status-vhost.conf
217+
{{- end }}
213218
{{- if .Values.extraVolumeMounts }}
214219
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
215220
{{- end }}
@@ -275,6 +280,12 @@ spec:
275280
name: {{ printf "%s-postinit" (include "common.names.fullname" .) }}
276281
defaultMode: 0755
277282
{{- end }}
283+
{{- if and .Values.metrics.enabled .Values.metrics.apacheVhost }}
284+
- name: apache-metrics
285+
configMap:
286+
name: {{ printf "%s-apache-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
287+
defaultMode: 0644
288+
{{- end }}
278289
- name: yourls-data
279290
{{- if .Values.persistence.enabled }}
280291
persistentVolumeClaim:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if and .Values.metrics.enabled .Values.metrics.apacheVhost }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ printf "%s-apache-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
6+
namespace: {{ .Release.Namespace | quote }}
7+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
8+
{{- if .Values.commonAnnotations }}
9+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
10+
{{- end }}
11+
data:
12+
00_status-vhost.conf: |-
13+
{{- .Files.Get "files/00_status-vhost.conf" | nindent 4 }}
14+
{{- end }}

charts/yourls/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ metrics:
672672
## @param metrics.enabled Start a sidecar prometheus exporter to expose metrics
673673
##
674674
enabled: false
675+
## @param metrics.apacheVhost Create a virtual host to enable Apache httpd to serve metrics
676+
##
677+
apacheVhost: true
675678
## Bitnami Apache Exporter image
676679
## ref: https://hub.docker.com/r/bitnami/apache-exporter/tags/
677680
## @param metrics.image.registry Apache Exporter image registry

0 commit comments

Comments
 (0)