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 Jul 7, 2022
1 parent 9924843 commit 6993349
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/build/helmify/static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ _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` |
| podMonitor.extraLabels | Extra labels for `PodMonitor` resources | `{}` |

## Contributing Changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- 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 }}'
{{- with .Values.podMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
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,26 @@
{{- 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 }}'
{{- with .Values.podMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- '{{ .Release.Namespace }}'
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
control-plane: controller-manager
release: '{{ .Release.Name }}'
podMetricsEndpoints:
- port: metrics
{{- end }}
3 changes: 3 additions & 0 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,6 @@ upgradeCRDs:
extraRules: []
rbac:
create: true
podMonitor:
enabled: false
extraLabels: {}
2 changes: 2 additions & 0 deletions manifest_staging/charts/gatekeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ _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` |
| podMonitor.extraLabels | Extra labels for `PodMonitor` resources | `{}` |

## Contributing Changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- 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 }}'
{{- with .Values.podMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
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,26 @@
{{- 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 }}'
{{- with .Values.podMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- '{{ .Release.Namespace }}'
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
control-plane: controller-manager
release: '{{ .Release.Name }}'
podMetricsEndpoints:
- port: metrics
{{- end }}
3 changes: 3 additions & 0 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,6 @@ upgradeCRDs:
extraRules: []
rbac:
create: true
podMonitor:
enabled: false
extraLabels: {}

0 comments on commit 6993349

Please sign in to comment.