Skip to content

Commit

Permalink
Configure service monitor (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinBisson authored Apr 2, 2024
1 parent 34d0007 commit e9eacde
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add ServiceMonitor for monitoring.

### Changed

- Change container image registry values name to use values from `config` repo.
Expand Down
4 changes: 2 additions & 2 deletions config/helm/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ images:

transformers:
- common-labels.yaml
- monitoring-annotations.yaml
- webhook-prefix.yaml

patches:
Expand All @@ -43,10 +42,11 @@ patches:
- path: deployment-securitycontext.yaml
- path: delete-namespace.yaml
- path: delete-serviceaccount-annotation.yaml
- path: metrics-service-named-port.yaml
- path: webhook-mutating-certificate.yaml
- path: webhook-mutating-watchfilter.yaml
- path: webhook-validating-certificate.yaml
- path: webhook-validating-watchfilter.yaml
- path: service-add-metrics-port.yaml
- path: webhook-service-named-port.yaml
- path: certificate.yaml
- path: secret.yaml
12 changes: 12 additions & 0 deletions config/helm/metrics-service-named-port.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: capa-metrics-service
namespace: capa-system
spec:
ports:
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
13 changes: 0 additions & 13 deletions config/helm/monitoring-annotations.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
apiVersion: v1
kind: Service
metadata:
namespace: capa-system
name: capa-webhook-service
namespace: capa-system
spec:
ports:
- name: metrics
port: 8080
targetPort: metrics
- name: webhook-server
port: 443
targetPort: webhook-server
13 changes: 13 additions & 0 deletions helm/cluster-api-provider-aws/files/copy/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "resource.default.name" . }}
namespace: {{ include "resource.default.namespace" . }}
labels:
{{- include "labels.common" . | nindent 4 }}
spec:
endpoints:
- port: metrics
selector:
matchLabels:
cluster.x-k8s.io/provider: infrastructure-aws
13 changes: 13 additions & 0 deletions helm/cluster-api-provider-aws/templates/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "resource.default.name" . }}
namespace: {{ include "resource.default.namespace" . }}
labels:
{{- include "labels.common" . | nindent 4 }}
spec:
endpoints:
- port: metrics
selector:
matchLabels:
cluster.x-k8s.io/provider: infrastructure-aws
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ metadata:
namespace: '{{ .Release.Namespace }}'
spec:
ports:
- port: 8080
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ metadata:
namespace: '{{ .Release.Namespace }}'
spec:
ports:
- name: metrics
port: 8080
targetPort: metrics
- name: webhook-server
port: 443
targetPort: webhook-server
Expand Down

0 comments on commit e9eacde

Please sign in to comment.