Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PrometheusRule CRD and PDB #34

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/prometheus-prefect-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ maintainers:
name: prometheus-prefect-exporter
sources:
- https://github.com/devops-ia/prometheus-prefect-exporter
version: 0.1.0
appVersion: "0.1.0"
version: 0.1.1
appVersion: "0.2.0"
home: https://github.com/devops-ia/helm-charts/tree/main/charts/prometheus-prefect-exporter
keywords:
- prometheus-prefect-exporter
Expand Down
8 changes: 6 additions & 2 deletions charts/prometheus-prefect-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ helm show values devops-ia/prometheus-prefect-exporter
| nameOverride | string | `""` | String to partially override prometheus-prefect-exporter.fullname template (will maintain the release name) |
| nodeSelector | object | `{}` | Node labels for pod assignment |
| podAnnotations | object | `{}` | Pod annotations |
| podDisruptionBudget | object | `{}` | |
| podSecurityContext | object | `{}` | To specify security settings for a Pod |
| prometheusRule.additionalLabels | object | `{}` | |
| prometheusRule.enabled | bool | `false` | |
| prometheusRule.rules | list | `[]` | |
| replicaCount | int | `1` | Number of replicas |
| resources | object | `{}` | The resources limits and requested |
| securityContext | object | `{}` | Defines privilege and access control settings for a Pod or Container |
| service | object | `{"port":80,"targetPort":80,"type":"ClusterIP"}` | Kubernetes servide to expose Pod |
| service | object | `{"port":80,"targetPort":8000,"type":"ClusterIP"}` | Kubernetes servide to expose Pod |
| service.port | int | `80` | Kubernetes Service port |
| service.targetPort | int | `80` | Pod expose port |
| service.targetPort | int | `8000` | Pod expose port |
| service.type | string | `"ClusterIP"` | Kubernetes Service type. Allowed values: NodePort, LoadBalancer or ClusterIP |
| serviceAccount | object | `{"annotations":{},"create":true,"name":""}` | Enable creation of ServiceAccount |
| serviceMonitor | object | `{"enabled":false,"interval":"30s","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"10s"}` | Enable ServiceMonitor to get metrics ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor |
Expand Down
13 changes: 13 additions & 0 deletions charts/prometheus-prefect-exporter/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.podDisruptionBudget -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "prometheus-prefect-exporter.fullname" . }}
labels:
{{- include "prometheus-prefect-exporter.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "prometheus-prefect-exporter.selectorLabels" . | nindent 6 }}
{{ toYaml .Values.podDisruptionBudget | indent 2 }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/prometheus-prefect-exporter/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "prometheus-prefect-exporter.fullname" . }}
labels:
{{- include "prometheus-prefect-exporter.labels" . | nindent 4 }}
{{- with .Values.prometheusRule.additionalLabels -}}
{{- toYaml . | nindent 4 -}}
{{- end }}
spec:
{{- with .Values.prometheusRule.rules }}
groups:
- name: {{ template "prometheus-prefect-exporter.name" $ }}
rules: {{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
labels:
{{- include "prometheus-prefect-exporter.labels" . | nindent 4 }}
spec:
jobLabel: "{{ .Release.Name }}"
selector:
matchLabels:
{{- include "prometheus-prefect-exporter.selectorLabels" . | nindent 8 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/prometheus-prefect-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ env: {}
# foo: bar
# my_env: my_value

podDisruptionBudget: {}
# maxUnavailable: 0

# -- Pod annotations
podAnnotations: {}

Expand Down Expand Up @@ -68,9 +71,17 @@ serviceMonitor:
metricRelabelings: []
relabelings: []

## -- Custom PrometheusRules to be defined
# ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
prometheusRule:
enabled: false
additionalLabels: {}
rules: []

# -- Enable livenessProbe and readinessProbe
testConnection: false


# -- Ingress configuration to expose app
ingress:
enabled: false
Expand Down