From 844942c913de0ad05e73cc09f0ba20c969a75900 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 14 Aug 2024 09:05:56 +0200 Subject: [PATCH] fix: Fix chart --- charts/azure-app-exporter/Chart.yaml | 2 +- charts/azure-app-exporter/README.md | 50 +++---------------- .../azure-app-exporter/templates/cronjob.yaml | 25 ++++++++++ .../templates/deployment.yaml | 5 +- .../azure-app-exporter/templates/secret.yaml | 5 -- 5 files changed, 37 insertions(+), 50 deletions(-) create mode 100644 charts/azure-app-exporter/templates/cronjob.yaml diff --git a/charts/azure-app-exporter/Chart.yaml b/charts/azure-app-exporter/Chart.yaml index 8cac26e..ea13d1c 100644 --- a/charts/azure-app-exporter/Chart.yaml +++ b/charts/azure-app-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: azure-app-exporter description: Exposing Prometheus Metrics for Azure Service Principals type: application -version: 0.4.1 +version: 0.4.2 appVersion: "0.1.38" keywords: - azure diff --git a/charts/azure-app-exporter/README.md b/charts/azure-app-exporter/README.md index ff06ac6..a3826c5 100644 --- a/charts/azure-app-exporter/README.md +++ b/charts/azure-app-exporter/README.md @@ -1,6 +1,6 @@ # azure-app-exporter -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.19](https://img.shields.io/badge/AppVersion-0.1.19-informational?style=flat-square) +![Version: 0.4.2](https://img.shields.io/badge/Version-0.4.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.38](https://img.shields.io/badge/AppVersion-0.1.38-informational?style=flat-square) Exposing Prometheus Metrics for Azure Service Principals @@ -8,10 +8,10 @@ Exposing Prometheus Metrics for Azure Service Principals ## Maintainers -| Name | Email | Url | -|----------------|-----------------------------|--------------------------------| +| Name | Email | Url | +| ---- | ------ | --- | | Marcel Körtgen | | | -| DO! DevOps | | | +| DO! DevOps | | | ## Source Code @@ -21,51 +21,15 @@ Exposing Prometheus Metrics for Azure Service Principals | Key | Type | Default | Description | |-----|------|---------|-------------| -| affinity | object | `{}` | | -| autoscaling.enabled | bool | `false` | | -| autoscaling.maxReplicas | int | `100` | | -| autoscaling.minReplicas | int | `1` | | -| autoscaling.targetCPUUtilizationPercentage | int | `80` | | | azure.client.id | string | `"-unset-"` | The AppId of the Service Principal for listing Azure applications | | azure.client.secret | string | `"-unset-"` | The Client Secret of the Service Principal | | azure.enabled | bool | `false` | Enable connection to Azure | +| azure.tagsFilter | list | `[]` | a list of tags. Only the apps having one of the tags are returned | | azure.tenant | string | `"-unset-"` | Your Azure Tenant Id | -| fullnameOverride | string | `""` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"ghcr.io/mkoertgen/azure-app-exporter/azure-app-exporter"` | The container image repository to use | +| image.repository | string | `"ghcr.io/dodevops/azure-app-exporter/azure-app-exporter"` | The container image repository to use | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | -| imagePullSecrets | list | `[]` | | -| ingress.annotations | object | `{}` | | -| ingress.className | string | `""` | | -| ingress.enabled | bool | `false` | | -| ingress.hosts[0].host | string | `"chart-example.local"` | | -| ingress.hosts[0].paths[0].path | string | `"/"` | | -| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | -| ingress.tls | list | `[]` | | | metrics.enabled | bool | `true` | Enable Prometheus metrics | -| metrics.serviceMonitor.additionalLabels | list | `[]` | | | metrics.serviceMonitor.enabled | bool | `false` | Enable a [ServiceMonitor](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec) | -| metrics.serviceMonitor.honorLabels | bool | `false` | | -| metrics.serviceMonitor.jobLabel | string | `""` | | -| metrics.serviceMonitor.metricRelabelings | list | `[]` | | -| metrics.serviceMonitor.namespace | string | `""` | | -| metrics.serviceMonitor.namespaceSelector | object | `{}` | | -| metrics.serviceMonitor.relabelings | list | `[]` | | -| metrics.serviceMonitor.scrapeInterval | string | `"30s"` | | -| metrics.serviceMonitor.targetLabels | list | `[]` | | -| nameOverride | string | `""` | | -| nodeSelector | object | `{}` | | -| podAnnotations | object | `{}` | | -| podSecurityContext | object | `{}` | | -| replicaCount | int | `1` | | -| resources | object | `{}` | | -| securityContext | object | `{}` | | -| service.port | int | `8000` | | -| service.type | string | `"ClusterIP"` | | -| serviceAccount.annotations | object | `{}` | | -| serviceAccount.create | bool | `true` | | -| serviceAccount.name | string | `""` | | -| tolerations | list | `[]` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.8.1](https://github.com/norwoodj/helm-docs/releases/v1.8.1) +Autogenerated from chart metadata using [helm-docs v1.14.0](https://github.com/norwoodj/helm-docs/releases/v1.14.0) diff --git a/charts/azure-app-exporter/templates/cronjob.yaml b/charts/azure-app-exporter/templates/cronjob.yaml new file mode 100644 index 0000000..57d7449 --- /dev/null +++ b/charts/azure-app-exporter/templates/cronjob.yaml @@ -0,0 +1,25 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ include "azure-app-exporter.fullname" . }}-refresh-apis + labels: + {{- include "azure-app-exporter.labels" . | nindent 4 }} +spec: + schedule: "0 * * * *" + jobTemplate: + spec: + template: + spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 14 }} + containers: + - name: refresh-apis + image: busybox:latest + imagePullPolicy: IfNotPresent + securityContext: + {{- toYaml .Values.securityContext | nindent 18 }} + command: + - /bin/sh + - -c + - wget -O - "http://{{ include "azure-app-exporter.fullname" . }}:{{ .Values.service.port }}/api/apps" + restartPolicy: OnFailure \ No newline at end of file diff --git a/charts/azure-app-exporter/templates/deployment.yaml b/charts/azure-app-exporter/templates/deployment.yaml index 6e6a7a5..3df4176 100644 --- a/charts/azure-app-exporter/templates/deployment.yaml +++ b/charts/azure-app-exporter/templates/deployment.yaml @@ -33,7 +33,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - + ports: + - name: http + containerPort: 8000 + protocol: TCP livenessProbe: httpGet: path: /health diff --git a/charts/azure-app-exporter/templates/secret.yaml b/charts/azure-app-exporter/templates/secret.yaml index 66ea4f3..1279d7f 100644 --- a/charts/azure-app-exporter/templates/secret.yaml +++ b/charts/azure-app-exporter/templates/secret.yaml @@ -1,16 +1,11 @@ -{{ if (.Release.IsInstall | default true) }} apiVersion: v1 kind: Secret metadata: name: {{ include "azure-app-exporter.secretName" . }} labels: {{- include "azure-app-exporter.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": pre-install - "helm.sh/hook-delete-policy": hook-failed type: Opaque data: azure-client-id: {{ .Values.azure.client.id | default "-unset-" | b64enc | quote }} azure-client-secret: {{ .Values.azure.client.secret | default "-unset-" | b64enc | quote }} azure-tenant-id: {{ .Values.azure.tenant | default "-unset-" | b64enc | quote }} -{{- end -}}