Skip to content

Commit

Permalink
fix: Adding PodMonitor resources
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Tyr <[email protected]>
  • Loading branch information
jtyr committed Jun 17, 2022
1 parent d3e62d0 commit 2679bf9
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/build/helmify/static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi
| service.loadBalancerIP | The IP address of LoadBalancer service | `` |
| service.healthzPort | Service port to gatekeeper Webhook health port | `9090` |
| rbac.create | Enable the creation of RBAC resources | `true` |
| podMonitor.enabled | Whether to install `PodMonitor` resources or not | `false` |

## Contributing Changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
gatekeeper.sh/system: "yes"
heritage: '{{ .Release.Service }}'
release: '{{ .Release.Name }}'
name: gatekeeper-audit-controller
spec:
namespaceSelector:
matchNames:
- '{{ .Release.Namespace }}'
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
control-plane: audit-controller
release: '{{ .Release.Name }}'
podMetricsEndpoints:
- port: metrics
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: gatekeeper-controller-manager
labels:
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
gatekeeper.sh/system: "yes"
heritage: '{{ .Release.Service }}'
release: '{{ .Release.Name }}'
spec:
namespaceSelector:
matchNames:
- '{{ .Release.Namespace }}'
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
control-plane: controller-manager
release: '{{ .Release.Name }}'
podMetricsEndpoints:
- port: metrics
{{- end }}
2 changes: 2 additions & 0 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,5 @@ upgradeCRDs:
tolerations: []
rbac:
create: true
podMonitor:
enabled: false
1 change: 1 addition & 0 deletions manifest_staging/charts/gatekeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi
| service.loadBalancerIP | The IP address of LoadBalancer service | `` |
| service.healthzPort | Service port to gatekeeper Webhook health port | `9090` |
| rbac.create | Enable the creation of RBAC resources | `true` |
| podMonitor.enabled | Whether to install `PodMonitor` resources or not | `false` |

## Contributing Changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
gatekeeper.sh/system: "yes"
heritage: '{{ .Release.Service }}'
release: '{{ .Release.Name }}'
name: gatekeeper-audit-controller
spec:
namespaceSelector:
matchNames:
- '{{ .Release.Namespace }}'
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
control-plane: audit-controller
release: '{{ .Release.Name }}'
podMetricsEndpoints:
- port: metrics
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: gatekeeper-controller-manager
labels:
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
gatekeeper.sh/system: "yes"
heritage: '{{ .Release.Service }}'
release: '{{ .Release.Name }}'
spec:
namespaceSelector:
matchNames:
- '{{ .Release.Namespace }}'
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
control-plane: controller-manager
release: '{{ .Release.Name }}'
podMetricsEndpoints:
- port: metrics
{{- end }}
2 changes: 2 additions & 0 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,5 @@ upgradeCRDs:
tolerations: []
rbac:
create: true
podMonitor:
enabled: false

0 comments on commit 2679bf9

Please sign in to comment.