Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(flux2): add variable to customise cluster domain (#139) #140

Merged
merged 11 commits into from
Nov 5, 2022
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
16 changes: 14 additions & 2 deletions charts/flux2/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@ apiVersion: v2
name: flux2
description: A Helm chart for flux2
type: application
version: 1.7.0
version: 2.0.0
appVersion: 0.36.0
sources:
- https://github.com/fluxcd-community/helm-charts
annotations:
artifacthub.io/changes: |
- "[Chore]: Update App Version to upstream 0.36.0"
- "[added]: `clusterDomain` to correctly apply fqdns for event and storage addresses"
- "[removed]: `eventsaddr` has been removed in favour of `clusterDomain`"
- "[fixed]: storage address in source controller assumed cluster domain was always `cluster.local`"
- "[changed]: change case of `helmcontroller` to `helmController`"
- "[changed]: change case of `imageautomationcontroller` to `imageAutomationController`"
- "[changed]: change case of `imagereflectioncontroller` to `imageReflectionController`"
- "[changed]: change case of `kustomizecontroller` to `kustomizeController`"
- "[changed]: change case of `notificationcontroller` to `notificationController`"
- "[changed]: change case of `sourcecontroller` to `sourceController`"
- "[changed]: change case of `serviceaccount` to `serviceAccount`"
- "[changed]: change case of `additionalargs` to `additionalArgs`"
- "[changed]: change case of `loglevel` to `logLevel`"
- "[changed]: change case of `watchallnamespaces` to `watchAllNamespaces`"
236 changes: 118 additions & 118 deletions charts/flux2/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ metadata:
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
rules:
- apiGroups: [""]
resources: ["serviceaccounts"]
resources: ["serviceAccounts"]
verbs: ["impersonate"]
{{- end }}
2 changes: 1 addition & 1 deletion charts/flux2/templates/crd-controller-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rules:
- namespaces
- secrets
- configmaps
- serviceaccounts
- serviceAccounts
verbs:
- get
- list
Expand Down
6 changes: 3 additions & 3 deletions charts/flux2/templates/helm-controller-sa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.helmcontroller.create}}
{{- if .Values.helmcontroller.serviceaccount.create -}}
{{- if and .Values.helmController.create}}
{{- if .Values.helmController.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -10,7 +10,7 @@ metadata:
app.kubernetes.io/part-of: flux
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
name: helm-controller
{{- with .Values.helmcontroller.serviceaccount.annotations }}
{{- with .Values.helmController.serviceAccount.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
Expand Down
54 changes: 27 additions & 27 deletions charts/flux2/templates/helm-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.helmcontroller.create}}
{{- if and .Values.helmController.create}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -11,51 +11,51 @@ metadata:
control-plane: controller
name: helm-controller
spec:
{{- if kindIs "invalid" .Values.helmcontroller.replicas }}
{{- if kindIs "invalid" .Values.helmController.replicas }}
replicas: 1
{{- else }}
replicas: {{ .Values.helmcontroller.replicas }}
replicas: {{ .Values.helmController.replicas }}
{{- end}}
selector:
matchLabels:
app: helm-controller
template:
metadata:
{{- with .Values.helmcontroller.annotations }}
{{- with .Values.helmController.annotations }}
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
labels:
app: helm-controller
{{ with .Values.helmcontroller.labels }}{{ toYaml . | indent 8 }}{{ end }}
{{ with .Values.helmController.labels }}{{ toYaml . | indent 8 }}{{ end }}
spec:
{{- if .Values.helmcontroller.initContainers}}
{{- if .Values.helmController.initContainers}}
initContainers:
{{- toYaml .Values.helmcontroller.initContainers | nindent 8}}
{{- toYaml .Values.helmController.initContainers | nindent 8}}
{{- end}}
containers:
- args:
{{- if .Values.multitenancy.enabled }}
- --no-cross-namespace-refs=true
- --default-service-account={{ .Values.multitenancy.defaultServiceAccount | default "default" }}
{{- end}}
{{- if .Values.notificationcontroller.create }}
- --events-addr={{ .Values.eventsaddr }}
{{- if .Values.notificationController.create }}
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}.
{{- end}}
- --watch-all-namespaces={{ .Values.watchallnamespaces }}
- --log-level={{ .Values.loglevel | default "info" }}
- --watch-all-namespaces={{ .Values.watchAllNamespaces }}
- --log-level={{ .Values.logLevel | default "info" }}
- --log-encoding=json
- --enable-leader-election
{{- range .Values.helmcontroller.container.additionalargs }}
{{- range .Values.helmController.container.additionalArgs }}
- {{ . }}
{{- end}}
env:
- name: RUNTIME_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: {{ template "template.image" .Values.helmcontroller }}
{{- if .Values.helmcontroller.imagePullPolicy }}
imagePullPolicy: {{ .Values.helmcontroller.imagePullPolicy }}
image: {{ template "template.image" .Values.helmController }}
{{- if .Values.helmController.imagePullPolicy }}
imagePullPolicy: {{ .Values.helmController.imagePullPolicy }}
{{- else }}
imagePullPolicy: IfNotPresent
{{- end }}
Expand All @@ -74,11 +74,11 @@ spec:
httpGet:
path: /readyz
port: healthz
{{- with .Values.helmcontroller.resources }}
{{- with .Values.helmController.resources }}
resources: {{ toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.helmcontroller.securityContext }}
securityContext: {{ toYaml .Values.helmcontroller.securityContext | nindent 10 }}
{{- if .Values.helmController.securityContext }}
securityContext: {{ toYaml .Values.helmController.securityContext | nindent 10 }}
{{- else }}
securityContext:
allowPrivilegeEscalation: false
Expand All @@ -93,11 +93,11 @@ spec:
volumeMounts:
- mountPath: /tmp
name: temp
{{- if .Values.helmcontroller.volumeMounts }}
{{- toYaml .Values.helmcontroller.volumeMounts | nindent 8 }}
{{- if .Values.helmController.volumeMounts }}
{{- toYaml .Values.helmController.volumeMounts | nindent 8 }}
{{- end}}
{{- if .Values.helmcontroller.priorityClassName }}
priorityClassName: {{ .Values.helmcontroller.priorityClassName | quote }}
{{- if .Values.helmController.priorityClassName }}
priorityClassName: {{ .Values.helmController.priorityClassName | quote }}
{{- end }}
serviceAccountName: helm-controller
{{- if .Values.imagePullSecrets }}
Expand All @@ -107,16 +107,16 @@ spec:
volumes:
- emptyDir: {}
name: temp
{{- if .Values.helmcontroller.volumes }}
{{- toYaml .Values.helmcontroller.volumes | nindent 6 }}
{{- if .Values.helmController.volumes }}
{{- toYaml .Values.helmController.volumes | nindent 6 }}
{{- end}}
{{- with .Values.helmcontroller.nodeSelector }}
{{- with .Values.helmController.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.helmcontroller.affinity }}
{{- with .Values.helmController.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.helmcontroller.tolerations }}
{{- with .Values.helmController.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/flux2/templates/image-automation-controller-sa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.imageautomationcontroller.create }}
{{- if .Values.imageautomationcontroller.serviceaccount.create -}}
{{- if and .Values.imageAutomationController.create }}
{{- if .Values.imageAutomationController.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -10,7 +10,7 @@ metadata:
app.kubernetes.io/part-of: flux
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
name: image-automation-controller
{{- with .Values.imageautomationcontroller.serviceaccount.annotations }}
{{- with .Values.imageAutomationController.serviceAccount.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
Expand Down
54 changes: 27 additions & 27 deletions charts/flux2/templates/image-automation-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.imageautomationcontroller.create}}
{{- if and .Values.imageAutomationController.create}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -11,50 +11,50 @@ metadata:
control-plane: controller
name: image-automation-controller
spec:
{{- if kindIs "invalid" .Values.imageautomationcontroller.replicas }}
{{- if kindIs "invalid" .Values.imageAutomationController.replicas }}
replicas: 1
{{- else }}
replicas: {{ .Values.imageautomationcontroller.replicas }}
replicas: {{ .Values.imageAutomationController.replicas }}
{{- end}}
selector:
matchLabels:
app: image-automation-controller
template:
metadata:
{{- with .Values.imageautomationcontroller.annotations }}
{{- with .Values.imageAutomationController.annotations }}
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
labels:
app: image-automation-controller
{{ with .Values.imageautomationcontroller.labels }}{{ toYaml . | indent 8 }}{{ end }}
{{ with .Values.imageAutomationController.labels }}{{ toYaml . | indent 8 }}{{ end }}
spec:
{{- if .Values.imageautomationcontroller.initContainers}}
{{- if .Values.imageAutomationController.initContainers}}
initContainers:
{{- toYaml .Values.imageautomationcontroller.initContainers | nindent 8}}
{{- toYaml .Values.imageAutomationController.initContainers | nindent 8}}
{{- end}}
containers:
- args:
{{- if .Values.multitenancy.enabled }}
- --no-cross-namespace-refs=true
{{- end}}
{{- if .Values.notificationcontroller.create }}
- --events-addr={{ .Values.eventsaddr }}
{{- if .Values.notificationController.create }}
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}.
{{- end}}
- --watch-all-namespaces={{ .Values.watchallnamespaces }}
- --log-level={{ .Values.loglevel | default "info" }}
- --watch-all-namespaces={{ .Values.watchAllNamespaces }}
- --log-level={{ .Values.logLevel | default "info" }}
- --log-encoding=json
- --enable-leader-election
{{- range .Values.imageautomationcontroller.container.additionalargs }}
{{- range .Values.imageAutomationController.container.additionalArgs }}
- {{ . }}
{{- end}}
env:
- name: RUNTIME_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: {{ template "template.image" .Values.imageautomationcontroller }}
{{- if .Values.imageautomationcontroller.imagePullPolicy }}
imagePullPolicy: {{ .Values.imageautomationcontroller.imagePullPolicy }}
image: {{ template "template.image" .Values.imageAutomationController }}
{{- if .Values.imageAutomationController.imagePullPolicy }}
imagePullPolicy: {{ .Values.imageAutomationController.imagePullPolicy }}
{{- else }}
imagePullPolicy: IfNotPresent
{{- end }}
Expand All @@ -73,11 +73,11 @@ spec:
httpGet:
path: /readyz
port: healthz
{{- with .Values.imageautomationcontroller.resources }}
{{- with .Values.imageAutomationController.resources }}
resources: {{ toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.imageautomationcontroller.securityContext }}
securityContext: {{ toYaml .Values.imageautomationcontroller.securityContext | nindent 10 }}
{{- if .Values.imageAutomationController.securityContext }}
securityContext: {{ toYaml .Values.imageAutomationController.securityContext | nindent 10 }}
{{- else }}
securityContext:
allowPrivilegeEscalation: false
Expand All @@ -92,11 +92,11 @@ spec:
volumeMounts:
- mountPath: /tmp
name: temp
{{- if .Values.imageautomationcontroller.volumeMounts }}
{{- toYaml .Values.imageautomationcontroller.volumeMounts | nindent 8 }}
{{- if .Values.imageAutomationController.volumeMounts }}
{{- toYaml .Values.imageAutomationController.volumeMounts | nindent 8 }}
{{- end}}
{{- if .Values.imageautomationcontroller.priorityClassName }}
priorityClassName: {{ .Values.imageautomationcontroller.priorityClassName | quote }}
{{- if .Values.imageAutomationController.priorityClassName }}
priorityClassName: {{ .Values.imageAutomationController.priorityClassName | quote }}
{{- end }}
securityContext:
fsGroup: 1337
Expand All @@ -108,16 +108,16 @@ spec:
volumes:
- emptyDir: {}
name: temp
{{- if .Values.imageautomationcontroller.volumes }}
{{- toYaml .Values.imageautomationcontroller.volumes | nindent 6 }}
{{- if .Values.imageAutomationController.volumes }}
{{- toYaml .Values.imageAutomationController.volumes | nindent 6 }}
{{- end}}
{{- with .Values.imageautomationcontroller.nodeSelector }}
{{- with .Values.imageAutomationController.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imageautomationcontroller.affinity }}
{{- with .Values.imageAutomationController.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imageautomationcontroller.tolerations }}
{{- with .Values.imageAutomationController.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/flux2/templates/image-reflector-controller-sa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.imagereflectorcontroller.create }}
{{- if .Values.imagereflectorcontroller.serviceaccount.create -}}
{{- if and .Values.imageReflectionController.create }}
{{- if .Values.imageReflectionController.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -10,7 +10,7 @@ metadata:
app.kubernetes.io/part-of: flux
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
name: image-reflector-controller
{{- with .Values.imagereflectorcontroller.serviceaccount.annotations }}
{{- with .Values.imageReflectionController.serviceAccount.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
Expand Down
Loading