Skip to content

Commit

Permalink
Merge pull request #34 from devops-ia/feat/add-pdb-and-prometheusrule…
Browse files Browse the repository at this point in the history
…-crd

Add PrometheusRule CRD and PDB
  • Loading branch information
ialejandro authored Oct 10, 2023
2 parents e3fde5f + 545b14a commit 0877f85
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 4 deletions.
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

0 comments on commit 0877f85

Please sign in to comment.