diff --git a/charts/boundary-chart/Chart.yaml b/charts/boundary-chart/Chart.yaml index 8f25676..9be1709 100644 --- a/charts/boundary-chart/Chart.yaml +++ b/charts/boundary-chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.4 +version: 0.2.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/boundary-chart/templates/configmap.yaml b/charts/boundary-chart/templates/configmap.yaml index ad3c6be..5b4b4a6 100644 --- a/charts/boundary-chart/templates/configmap.yaml +++ b/charts/boundary-chart/templates/configmap.yaml @@ -111,6 +111,13 @@ data: purpose = "proxy" tls_disable = true } + {{- if .Values.metrics.enabled }} + listener "tcp" { + address = "0.0.0.0" + purpose = "ops" + tls_disable = true + } + {{- end }} {{- if .Values.vault.enabled }} {{- $fqdn := .Values.vault.fqdn }} {{- $mountPath := .Values.vault.mountPath }} diff --git a/charts/boundary-chart/templates/deployment.yaml b/charts/boundary-chart/templates/deployment.yaml index 0dc88ce..ff554f9 100644 --- a/charts/boundary-chart/templates/deployment.yaml +++ b/charts/boundary-chart/templates/deployment.yaml @@ -17,6 +17,11 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.metrics.enabled }} + prometheus.io/path: {{ .Values.metrics.path }} + prometheus.io/port: {{ .Values.metrics.port | quote }} + prometheus.io/scrape: "true" + {{- end }} {{- if .Values.vault.enabled }} {{- $credPath := .Values.vault.database.vaultCredPath }} {{- $adminCredPath := .Values.vault.database.vaultAdminCredPath }} @@ -109,6 +114,11 @@ spec: protocol: TCP {{- end }} {{- end }} + {{- if .Values.metrics.enabled }} + - name: {{ .Values.metrics.name }} + containerPort: {{ .Values.metrics.port }} + protocol: TCP + {{- end }} livenessProbe: httpGet: path: / diff --git a/charts/boundary-chart/templates/service.yaml b/charts/boundary-chart/templates/service.yaml index aff69d0..b0dfd76 100644 --- a/charts/boundary-chart/templates/service.yaml +++ b/charts/boundary-chart/templates/service.yaml @@ -36,3 +36,27 @@ spec: selector: {{- $selectorLabels | nindent 4 }} {{- end }} + +--- + +{{ if .Values.metrics.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ $fullName }}-metrics + labels: + {{- $labels | nindent 4 }} + annotations: + prometheus.io/path: {{ .Values.metrics.path }} + prometheus.io/port: {{ .Values.metrics.port | quote }} + prometheus.io/scrape: "true" +spec: + type: ClusterIP + ports: + - port: {{ .Values.metrics.port }} + targetPort: {{ .Values.metrics.name }} + protocol: TCP + name: {{ .Values.metrics.name }} + selector: + {{- $selectorLabels | nindent 4 }} +{{- end }} diff --git a/charts/boundary-chart/values.yaml b/charts/boundary-chart/values.yaml index ecf3c9f..946a579 100644 --- a/charts/boundary-chart/values.yaml +++ b/charts/boundary-chart/values.yaml @@ -52,6 +52,13 @@ vault: vaultCredPath: postgres/creds/boundary-db vaultDbRole: boundary +# set true to enable prometheus metrics +metrics: + enabled: false + name: metrics + port: 9203 + path: /metrics + serviceAccount: # Specifies whether a service account should be created create: true