Skip to content

Commit

Permalink
feat(base-cluster/raise_api_version): raise api version for helm.tool… (
Browse files Browse the repository at this point in the history
#983)

…kit.fluxcd.io
  • Loading branch information
marvinWolff authored Jun 18, 2024
1 parent 8d1b24a commit 1439938
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 36 deletions.
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/_helmRelease.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "base-cluster.helm.resourceWithDependencies" -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: {{ .name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.backup.backupStorageLocations (hasPrefix "4." (dig "spec" "chart" "spec" "version" "" (lookup "helm.toolkit.fluxcd.io/v2beta2" "HelmRelease" "backup" "velero"))) }}
{{- if and .Values.backup.backupStorageLocations (hasPrefix "4." (dig "spec" "chart" "spec" "version" "" (lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" "backup" "velero"))) }}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/backup/velero.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.backup.backupStorageLocations }}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: velero
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cert-manager
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/descheduler/descheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- $versionMatrix := dict 18 "0.20.x" 19 "0.21.x" 20 "0.22.x" 21 "0.23.x" 22 "0.24.x" 23 "0.25.x" 24 "0.26.x" 25 "0.27.x" 26 "0.28.x" -}}
{{- $latestVersion := .Values.global.helmRepositories.descheduler.charts.descheduler -}}
{{- $selectedVersion := (hasKey $versionMatrix $kubeMinorVersion) | ternary (index $versionMatrix $kubeMinorVersion) $latestVersion -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: descheduler
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/dns/external-dns.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.dns.provider -}}
{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .) -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: external-dns
Expand Down
4 changes: 2 additions & 2 deletions charts/base-cluster/templates/flux/flux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ stringData:
{{- end }}


apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: {{ printf "%s-flux-%s" (include "common.names.fullname" $) $name }}
Expand All @@ -67,7 +67,7 @@ spec:
ref: {{- toYaml $ref | nindent 4 }}
{{- end }}
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: {{ printf "%s-flux-%s" (include "common.names.fullname" $) $name }}
Expand Down
4 changes: 2 additions & 2 deletions charts/base-cluster/templates/global/helmRepositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- end -}}
{{- if $create -}}
{{- if eq ($config.type | default "helm") "helm" }}
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: {{ $name | quote }}
Expand All @@ -20,7 +20,7 @@ spec:
---
{{ else -}}
{{- range $chartName, $chartConfig := $config.charts -}}
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: {{ printf "%s-%s" $name $chartName | quote }}
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/global/reflector.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if include "base-cluster.reflector.enabled" (dict "context" .) -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: reflector
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/ingress/nginx.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if .Values.ingress.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: ingress-nginx
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/kyverno/kyverno.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.kyverno.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: kyverno
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.kyverno.enabled }}
# https://github.com/kyverno/kyverno/tree/main/charts/kyverno-policies
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: kyverno-policies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ spec:
- Pod
preconditions:
any:
- key: {{ `{{ request.object.spec.serviceAccountName || '' }}` | quote }}
operator: Equals
value: ""
- key: {{ `{{ request.object.spec.serviceAccountName || 'default' }}` | quote }}
operator: Equals
value: default
Expand All @@ -36,4 +33,4 @@ spec:
pattern:
spec:
automountServiceAccountToken: "false"
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/kyverno/validation.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $existingKyverno := lookup "helm.toolkit.fluxcd.io/v2beta2" "HelmRelease" "kyverno" "kyverno" -}}
{{- $existingKyverno := lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" "kyverno" "kyverno" -}}
{{- $lastAttemptedRevision := dig "status" "lastAttemptedRevision" "" $existingKyverno }}
{{- $lastAppliedRevision := dig "status" "lastAppliedRevision" "" $existingKyverno }}
{{- if or $lastAppliedRevision $lastAttemptedRevision -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{- $port := $backend.port -}}
{{- $targetServiceName := printf "%s-%s" (include "common.names.dependency.fullname" (dict "chartName" "kube-prometheus-stack" "chartValues" (dict) "context" (dict "Release" (dict "Name" "kube-prometheus-stack")))) $host -}}
{{- $ingress := include "base-cluster.monitoring.ingress.config" (dict "name" $host "context" $) | fromYaml -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cluster-{{ $host }}-oauth-proxy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.monitoring.prometheus.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: kube-prometheus-stack
Expand All @@ -21,15 +21,13 @@ spec:
crds: CreateReplace
postRenderers:
- kustomize:
patchesStrategicMerge:
- apiVersion: apps/v1
kind: Deployment
metadata:
patches:
- target:
kind: Deployment
name: kube-prometheus-stack-grafana-image-renderer
namespace: monitoring
spec:
template:
spec:
automountServiceAccountToken: false
patch: |-
- op: add
path: /spec/template/spec/automountServiceAccountToken
value: false
values: {{- include "base-cluster.prometheus.config" . | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/monitoring/loki/loki.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.monitoring.prometheus.enabled .Values.monitoring.loki.enabled -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: loki
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.monitoring.metricsServer.enabled -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: metrics-server
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.monitoring.securityScanning.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: trivy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.monitoring.tracing.enabled .Values.monitoring.prometheus.enabled -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: grafana-tempo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.monitoring.tracing.enabled .Values.monitoring.prometheus.enabled -}}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: open-telemetry-collector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.storage.readWriteMany.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: nfs-server-provisioner
Expand Down

0 comments on commit 1439938

Please sign in to comment.