diff --git a/charts/prometheus-prefect-exporter/Chart.yaml b/charts/prometheus-prefect-exporter/Chart.yaml index a7dedf5..f84cee9 100644 --- a/charts/prometheus-prefect-exporter/Chart.yaml +++ b/charts/prometheus-prefect-exporter/Chart.yaml @@ -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 diff --git a/charts/prometheus-prefect-exporter/README.md b/charts/prometheus-prefect-exporter/README.md index 44d61dc..d24c118 100644 --- a/charts/prometheus-prefect-exporter/README.md +++ b/charts/prometheus-prefect-exporter/README.md @@ -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 | diff --git a/charts/prometheus-prefect-exporter/templates/pdb.yaml b/charts/prometheus-prefect-exporter/templates/pdb.yaml new file mode 100644 index 0000000..63fbf05 --- /dev/null +++ b/charts/prometheus-prefect-exporter/templates/pdb.yaml @@ -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 }} diff --git a/charts/prometheus-prefect-exporter/templates/prometheusrule.yaml b/charts/prometheus-prefect-exporter/templates/prometheusrule.yaml new file mode 100644 index 0000000..f31d3eb --- /dev/null +++ b/charts/prometheus-prefect-exporter/templates/prometheusrule.yaml @@ -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 }} diff --git a/charts/prometheus-prefect-exporter/templates/servicemonitor.yaml b/charts/prometheus-prefect-exporter/templates/servicemonitor.yaml index e490c74..e8c8543 100644 --- a/charts/prometheus-prefect-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-prefect-exporter/templates/servicemonitor.yaml @@ -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 }} diff --git a/charts/prometheus-prefect-exporter/values.yaml b/charts/prometheus-prefect-exporter/values.yaml index 965669e..8fe3301 100644 --- a/charts/prometheus-prefect-exporter/values.yaml +++ b/charts/prometheus-prefect-exporter/values.yaml @@ -33,6 +33,9 @@ env: {} # foo: bar # my_env: my_value +podDisruptionBudget: {} + # maxUnavailable: 0 + # -- Pod annotations podAnnotations: {} @@ -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