diff --git a/charts/authelia/Chart.yaml b/charts/authelia/Chart.yaml index 121cad6..dbe7359 100644 --- a/charts/authelia/Chart.yaml +++ b/charts/authelia/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: authelia -version: 0.8.36 +version: 0.8.37 kubeVersion: ">= 1.13.0-0" description: Authelia is a Single Sign-On Multi-Factor portal for web apps type: application diff --git a/charts/authelia/templates/configMap.yaml b/charts/authelia/templates/configMap.yaml index f54b498..3458639 100644 --- a/charts/authelia/templates/configMap.yaml +++ b/charts/authelia/templates/configMap.yaml @@ -41,6 +41,12 @@ data: format: {{ default "text" .Values.configMap.log.format }} file_path: {{ .Values.configMap.log.file_path | default "" | quote }} keep_stdout: true + {{- if semverCompare ">=4.36.0" (include "authelia.version" .) }} + telemetry: + metrics: + enabled: {{ .Values.configMap.telemetry.metrics.enabled | default false }} + address: '0.0.0.0:{{ .Values.configMap.telemetry.metrics.port | default 9959 }}' + {{- end }} totp: {{- if semverCompare ">=4.34.0" (include "authelia.version" .) }} disable: {{ .Values.configMap.totp.disable | default false }} diff --git a/charts/authelia/templates/deployment.yaml b/charts/authelia/templates/deployment.yaml index 2b51aed..b387234 100644 --- a/charts/authelia/templates/deployment.yaml +++ b/charts/authelia/templates/deployment.yaml @@ -158,8 +158,13 @@ spec: {{- end }} ports: - name: http - containerPort: {{ default 9091 .Values.configMap.port }} + containerPort: {{ .Values.configMap.port | default 9091 }} protocol: TCP + {{- if and (semverCompare ">=4.36.0" (include "authelia.version" .)) .Values.configMap.telemetry.metrics.enabled }} + - name: metrics + containerPort: {{ .Values.configMap.telemetry.metrics.port | default 9959 }} + protocol: TCP + {{- end }} volumeMounts: {{- if (include "authelia.enabled.persistentVolumeClaim" .) }} - mountPath: /config diff --git a/charts/authelia/templates/service.yaml b/charts/authelia/templates/service.yaml index 29ff82d..d18dcd0 100644 --- a/charts/authelia/templates/service.yaml +++ b/charts/authelia/templates/service.yaml @@ -21,4 +21,10 @@ spec: - name: http protocol: TCP port: {{ include "authelia.service.port" . }} - targetPort: http \ No newline at end of file + targetPort: http + {{- if and (semverCompare ">=4.36.0" (include "authelia.version" .)) .Values.configMap.telemetry.metrics.enabled }} + - name: metrics + protocol: TCP + port: {{ .Values.configMap.telemetry.metrics.port | default 9959 }} + targetPort: metrics + {{- end }} \ No newline at end of file diff --git a/charts/authelia/templates/serviceMonitor.yaml b/charts/authelia/templates/serviceMonitor.yaml new file mode 100644 index 0000000..e6d874d --- /dev/null +++ b/charts/authelia/templates/serviceMonitor.yaml @@ -0,0 +1,21 @@ +{{- if and (semverCompare ">=4.36.0" (include "authelia.version" .)) .Values.configMap.telemetry.metrics.enabled .Values.configMap.telemetry.metrics.serviceMonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "authelia.name" . }} + labels: {{ include "authelia.labels" (merge (dict "Labels" .Values.configMap.telemetry.metrics.serviceMonitor.labels) .) | nindent 4 }} + {{- with $annotations := include "authelia.annotations" (merge (dict "Annotations" .Values.configMap.telemetry.metrics.serviceMonitor.annotations) .) }} + annotations: {{ $annotations | nindent 4 }} + {{- end }} +spec: + endpoints: + - path: /metrics + port: metrics + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: {{ include "authelia.labels" (merge (dict "Labels" .Values.service.labels) .) | nindent 6 }} +... +{{- end }} \ No newline at end of file diff --git a/charts/authelia/values.local.yaml b/charts/authelia/values.local.yaml index c44fc90..aed694d 100644 --- a/charts/authelia/values.local.yaml +++ b/charts/authelia/values.local.yaml @@ -456,6 +456,26 @@ configMap: # file_path: /config/authelia.log file_path: "" + ## + ## Telemetry Configuration + ## + telemetry: + + ## + ## Metrics Configuration + ## + metrics: + ## Enable Metrics. + enabled: false + + ## The port to listen on for metrics. This should be on a different port to the main server.port value. + port: 9959 + + serviceMonitor: + enabled: false + annotations: {} + labels: {} + ## Default redirection URL ## ## If user tries to authenticate without any referer, Authelia does not know where to redirect the user to at the end diff --git a/charts/authelia/values.yaml b/charts/authelia/values.yaml index 6760c36..fe0cb8a 100644 --- a/charts/authelia/values.yaml +++ b/charts/authelia/values.yaml @@ -454,6 +454,26 @@ configMap: # file_path: /config/authelia.log file_path: "" + ## + ## Telemetry Configuration + ## + telemetry: + + ## + ## Metrics Configuration + ## + metrics: + ## Enable Metrics. + enabled: false + + ## The port to listen on for metrics. This should be on a different port to the main server.port value. + port: 9959 + + serviceMonitor: + enabled: false + annotations: {} + labels: {} + ## Default redirection URL ## ## If user tries to authenticate without any referer, Authelia does not know where to redirect the user to at the end