Skip to content

Commit 09558f2

Browse files
committed
fix add flux-sync
1 parent e1f6c3d commit 09558f2

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

charts/staging/templates/kubernetes.yaml

+53-1
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@ spec:
2525
{{- if .copySecrets }}
2626
---
2727
### COPY SECRET TO TENANT CLUSTER:
28-
apiVersion: helm.toolkit.fluxcd.io/v2beta1
28+
apiVersion: helm.toolkit.fluxcd.io/v2
2929
kind: HelmRelease
3030
metadata:
3131
name: kubernetes-{{ .name }}-copy-secrets
3232
namespace: {{ $.Values.namespace }}
3333
spec:
3434
targetNamespace: default
3535
storageNamespace: default
36+
install:
37+
remediation:
38+
retries: 3
39+
upgrade:
40+
remediation:
41+
retries: 3
3642
chart:
3743
spec:
3844
chart: ./charts/secret
@@ -64,5 +70,51 @@ spec:
6470
dependsOn:
6571
- name: kubernetes-{{ .name }}
6672
{{- end }}
73+
{{- if .fluxSync }}
74+
---
75+
### COPY SECRET TO TENANT CLUSTER:
76+
apiVersion: helm.toolkit.fluxcd.io/v2
77+
kind: HelmRelease
78+
metadata:
79+
name: kubernetes-{{ .name }}-deploy-application
80+
namespace: {{ $.Values.namespace }}
81+
spec:
82+
targetNamespace: default
83+
storageNamespace: default
84+
install:
85+
remediation:
86+
retries: 3
87+
upgrade:
88+
remediation:
89+
retries: 3
90+
chart:
91+
spec:
92+
chart: flux2-sync
93+
sourceRef:
94+
kind: HelmRepository
95+
name: fluxcd-community
96+
version: '1.9.0'
97+
interval: 1m0s
98+
timeout: 5m0s
99+
kubeConfig:
100+
secretRef:
101+
name: kubernetes-{{ .name }}-admin-kubeconfig
102+
key: super-admin.conf
103+
dependsOn:
104+
- name: kubernetes-{{ .name }}
105+
{{- with .fluxSync.values }}
106+
values:
107+
{{- toYaml . | nindent 4 }}
108+
{{- end }}
109+
{{- end }}
67110

68111
{{- end }}
112+
---
113+
apiVersion: source.toolkit.fluxcd.io/v1
114+
kind: HelmRepository
115+
metadata:
116+
name: fluxcd-community
117+
namespace: {{ $.Values.namespace }}
118+
spec:
119+
interval: 5m0s
120+
url: https://fluxcd-community.github.io/helm-charts

clusters/cluster1/tenant-example.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,24 @@ spec:
124124
- name: kafka-service-clients-ca
125125
valuesKey: ca.key
126126
targetPath: secret.data.ca-key
127+
128+
# Here you can specify applications to deploy via FluxCD into tenant-cluster
129+
#fluxSync:
130+
# values:
131+
# secret:
132+
# create: true
133+
# data:
134+
# password: token-string-here123
135+
# username: pat
136+
# gitRepository:
137+
# spec:
138+
# url: https://gitlab.com/example/infra.git
139+
# ref:
140+
# branch: main
141+
# kustomization:
142+
# spec:
143+
# path: clusters/tenant-example
144+
127145
values:
128146
addons:
129147
certManager:

0 commit comments

Comments
 (0)