Skip to content
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
2 changes: 1 addition & 1 deletion charts/azure-resourcemanager-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: azure-resourcemanager-exporter
type: application
description: A Helm chart for azure-resourcemanager-exporter
home: https://github.com/webdevops/azure-resourcemanager-exporter
version: 1.2.3
version: 1.3.0
# renovate: image=webdevops/azure-resourcemanager-exporter
appVersion: 23.6.1
keywords:
Expand Down
6 changes: 3 additions & 3 deletions charts/azure-resourcemanager-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ Allow the release namespace to be overridden for multi-namespace deployments in
{{- end -}}

{{/* Generate basic labels */}}
{{- define "azure-resourcemanager-exporter.labels" }}
{{- define "azure-resourcemanager-exporter.labels" -}}
helm.sh/chart: {{ template "azure-resourcemanager-exporter.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: metrics
app.kubernetes.io/part-of: {{ template "azure-resourcemanager-exporter.name" . }}
{{- include "azure-resourcemanager-exporter.selectorLabels" . }}
{{ include "azure-resourcemanager-exporter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -58,7 +58,7 @@ release: {{ .Release.Name }}
{{/*
Selector labels
*/}}
{{- define "azure-resourcemanager-exporter.selectorLabels" }}
{{- define "azure-resourcemanager-exporter.selectorLabels" -}}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "azure-resourcemanager-exporter.name" . }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if not .Values.config.existingConfigMap }}
{{- if not .Values.existingConfigMap }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
31 changes: 19 additions & 12 deletions charts/azure-resourcemanager-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{{- $configmapHash := include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- $secretHash := include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "azure-resourcemanager-exporter.fullname" . }}
namespace: {{ template "azure-resourcemanager-exporter.namespace" . }}
labels: {{ include "azure-resourcemanager-exporter.labels" . | indent 4 }}
labels: {{ include "azure-resourcemanager-exporter.labels" . | nindent 4 }}
spec:
{{- with .Values.replicas }}
replicas: {{ . }}
Expand All @@ -15,22 +16,28 @@ spec:
{{- end }}

selector:
matchLabels: {{- include "azure-resourcemanager-exporter.selectorLabels" . | nindent 6 }}
matchLabels: {{ include "azure-resourcemanager-exporter.selectorLabels" . | nindent 6 }}

minReadySeconds: {{ .minReadySeconds }}
template:
metadata:
labels:
{{ include "azure-resourcemanager-exporter.selectorLabels" . | indent 8 }}
{{- with .Values.podLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- include "azure-resourcemanager-exporter.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- if or (not .Values.existingConfigMap) (.Values.podAnnotations) (.Values.secrets) }}
annotations:
{{- if not .Values.existingConfigMap }}
checksum/config: {{ $configmapHash | quote }}
{{- end }}
{{- if .Values.secrets }}
checksum/secret: {{ $secretHash | quote }}
{{- with .Values.podAnnotations }}
{{ toYaml . | indent 8 }}
{{- end }}

{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
spec:
serviceAccountName: {{ .Values.serviceAccount.name | quote }}
priorityClassName: {{ .Values.priorityClassName | quote }}
Expand Down Expand Up @@ -62,7 +69,7 @@ spec:
{{- with .Values.extraEnv }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
{{- if not .Values.config.existingConfigMap }}
{{- if not .Values.existingConfigMap }}
- name: CONFIG
value: "/config/config.yaml"
{{- end }}
Expand Down Expand Up @@ -102,7 +109,7 @@ spec:
volumes:
- name: config
configMap:
name: {{ .Values.config.existingConfigMap | default (include "azure-resourcemanager-exporter.fullname" .) }}
name: {{ .Values.existingConfigMap | default (include "azure-resourcemanager-exporter.fullname" .) }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: NetworkPolicy
metadata:
name: {{ template "azure-resourcemanager-exporter.fullname" . }}
namespace: {{ template "azure-resourcemanager-exporter.namespace" . }}
labels: {{ include "azure-resourcemanager-exporter.labels" . | indent 4 }}
labels: {{ include "azure-resourcemanager-exporter.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels: {{- include "azure-resourcemanager-exporter.selectorLabels" . | nindent 6 }}
matchLabels: {{ include "azure-resourcemanager-exporter.selectorLabels" . | nindent 6 }}
policyTypes: {{ toYaml .Values.netpol.policyTypes | nindent 4 }}
ingress: {{ toYaml .Values.netpol.ingress | nindent 4 }}
egress: {{ toYaml .Values.netpol.egress | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ spec:
protocol: TCP
name: {{ .Values.service.portName }}
appProtocol: http
selector: {{- include "azure-resourcemanager-exporter.selectorLabels" . | nindent 4 }}
selector: {{ include "azure-resourcemanager-exporter.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.verticalPodAutoscaler.enabled }}
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: {{ template "azure-resourcemanager-exporter.fullname" . }}
namespace: {{ template "azure-resourcemanager-exporter.namespace" . }}
labels:
{{- include "azure-resourcemanager-exporter.labels" . | nindent 4 }}
spec:
{{- with .Values.verticalPodAutoscaler.recommenders }}
recommenders:
{{- toYaml . | nindent 4 }}
{{- end }}
resourcePolicy:
containerPolicies:
- containerName: azure-resourcemanager-exporter
{{- with .Values.verticalPodAutoscaler.controlledResources }}
controlledResources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.verticalPodAutoscaler.controlledValues }}
controlledValues: {{ .Values.verticalPodAutoscaler.controlledValues }}
{{- end }}
{{- if .Values.verticalPodAutoscaler.maxAllowed }}
maxAllowed:
{{ toYaml .Values.verticalPodAutoscaler.maxAllowed | nindent 8 }}
{{- end }}
{{- if .Values.verticalPodAutoscaler.minAllowed }}
minAllowed:
{{ toYaml .Values.verticalPodAutoscaler.minAllowed | nindent 8 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "azure-resourcemanager-exporter.fullname" . }}
{{- with .Values.verticalPodAutoscaler.updatePolicy }}
updatePolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
33 changes: 32 additions & 1 deletion charts/azure-resourcemanager-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extraEnv: []

secretsEnableTemplateFunctions: false
secrets: {}
# secretName: secretValue
# secretName: secretValue

existingConfigMap: ""
config: {}
Expand Down Expand Up @@ -173,5 +173,36 @@ prometheus:
##
labelValueLengthLimit: 0

# Enable vertical pod autoscaler support
verticalPodAutoscaler:
enabled: false

# Recommender responsible for generating recommendation for the object.
# List should be empty (then the default recommender will generate the recommendation)
# or contain exactly one recommender.
# recommenders:
# - name: custom-recommender-performance

# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
controlledResources: []
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
# controlledValues: RequestsAndLimits

# Define the max allowed resources for the pod
maxAllowed: {}
# cpu: 200m
# memory: 100Mi
# Define the min allowed resources for the pod
minAllowed: {}
# cpu: 200m
# memory: 100Mi

updatePolicy:
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
# minReplicas: 1
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
updateMode: Auto

global:
imagePullSecrets: []