diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc4eb38..43317b8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Use PodMonitor for monitoring instead of legacy system. - Updated `tbot` deployment to use standalone `tbot` image (smaller image size) - Bump teleport version to `15.1.7` diff --git a/helm/teleport-operator/templates/deployment.yaml b/helm/teleport-operator/templates/deployment.yaml index 92b296e9..a67cf0b6 100644 --- a/helm/teleport-operator/templates/deployment.yaml +++ b/helm/teleport-operator/templates/deployment.yaml @@ -11,7 +11,7 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - {{- include "labels.selector" . | nindent 6 }} + {{- include "labels.selector" . | nindent 6 }} strategy: type: Recreate template: @@ -19,7 +19,7 @@ spec: annotations: releaseRevision: {{ .Release.Revision | quote }} labels: - {{- include "labels.selector" . | nindent 8 }} + {{- include "labels.selector" . | nindent 8 }} spec: serviceAccountName: {{ include "resource.default.name" . }} securityContext: @@ -36,6 +36,10 @@ spec: image: "{{ .Values.registry.domain }}/{{ .Values.image.name }}:{{ .Chart.Version }}" args: - "--namespace={{ include "resource.default.namespace" . }}" + ports: + - name: metrics + protocol: TCP + containerPort: 8080 securityContext: {{- with .Values.containerSecurityContext }} {{- . | toYaml | nindent 10 }} diff --git a/helm/teleport-operator/templates/pod-monitor.yaml b/helm/teleport-operator/templates/pod-monitor.yaml new file mode 100644 index 00000000..fe1bc9d5 --- /dev/null +++ b/helm/teleport-operator/templates/pod-monitor.yaml @@ -0,0 +1,16 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + labels: + {{- include "labels.common" . | nindent 4 }} + name: {{ include "resource.default.name" . }} + namespace: {{ include "resource.default.namespace" . }} +spec: + namespaceSelector: + matchNames: + - {{ include "resource.default.namespace" . }} + podMetricsEndpoints: + - port: metrics + selector: + matchLabels: + {{- include "labels.selector" . | nindent 6 }} diff --git a/helm/teleport-operator/templates/service.yaml b/helm/teleport-operator/templates/service.yaml deleted file mode 100644 index d5e4807a..00000000 --- a/helm/teleport-operator/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "resource.default.name" . }} - namespace: {{ include "resource.default.namespace" . }} - labels: - {{- include "labels.common" . | nindent 4 }} - giantswarm.io/monitoring: "true" - annotations: - giantswarm.io/monitoring-path: "/metrics" - giantswarm.io/monitoring-port: "8080" - prometheus.io/scrape: "true" -spec: - selector: - {{- include "labels.selector" . | nindent 4 }} - ports: - - name: metrics - port: 8080 - targetPort: 8080