Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creat appropriate vhost for httpd metrics #384

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/yourls/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
version: 6.0.0
version: 6.1.0
name: yourls
description: Your Own URL Shortener
appVersion: "1.9.2"
Expand Down
7 changes: 7 additions & 0 deletions charts/yourls/files/00_status-vhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<VirtualHost 127.0.0.1:80>
ServerName status.localhost
<Location /server-status>
Require local
SetHandler server-status
</Location>
</VirtualHost>
11 changes: 11 additions & 0 deletions charts/yourls/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ spec:
- mountPath: /docker-entrypoint-init.d
name: custom-postinit
{{- end }}
{{- if and .Values.metrics.enabled .Values.metrics.apacheVhost }}
- name: apache-metrics
mountPath: /etc/apache2/sites-available/00_status-vhost.conf
subPath: 00_status-vhost.conf
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -275,6 +280,12 @@ spec:
name: {{ printf "%s-postinit" (include "common.names.fullname" .) }}
defaultMode: 0755
{{- end }}
{{- if and .Values.metrics.enabled .Values.metrics.apacheVhost }}
- name: apache-metrics
configMap:
name: {{ printf "%s-apache-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
defaultMode: 0644
{{- end }}
- name: yourls-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
Expand Down
14 changes: 14 additions & 0 deletions charts/yourls/templates/metrics-httpd-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.metrics.enabled .Values.metrics.apacheVhost }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-apache-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
00_status-vhost.conf: |-
{{- .Files.Get "files/00_status-vhost.conf" | nindent 4 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/yourls/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ metrics:
## @param metrics.enabled Start a sidecar prometheus exporter to expose metrics
##
enabled: false
## @param metrics.apacheVhost Create a virtual host to enable Apache httpd to serve metrics
##
apacheVhost: true
## Bitnami Apache Exporter image
## ref: https://hub.docker.com/r/bitnami/apache-exporter/tags/
## @param metrics.image.registry Apache Exporter image registry
Expand Down