Skip to content

Commit 5e297db

Browse files
committed
fix: Add GitRepository and Kustomization resources for FluxCD synchronization
- Created gotk-sync.yaml to define a GitRepository for managing environments. - Added kustomization.yaml to include gotk-components and gotk-sync resources. - Updated openmcp overlay kustomization to use dynamic resources path from values.
1 parent a55727b commit 5e297db

File tree

9 files changed

+40
-7
lines changed

9 files changed

+40
-7
lines changed

docs/Templating.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ git:
3434
When rendering the `overlays` files, the following values are used:
3535

3636
```yaml
37-
targetPath: "" # The path were the fluxcd resources are lying relative to the overlays
37+
fluxCDResourcesPath: "" # The path were the fluxcd resources are lying relative to the overlays
3838
gitRepoEnvBranch: "" # The branch for this environment to look at
3939
envPathFluxSystem: "" # The path were the env overlays are located at from the root of the git repo
4040
```
4141

4242
### OpenMCP
4343

4444
```yaml
45+
openMCPResourcesPath: "" # The path were the fluxcd resources are lying relative to the overlays
4546
openMCPOperator:
4647
image: "" # the image of the openmcp operator to use
4748
tag: "" # the tag of the image of the openmcp operator you want to use for deployment

templates/fluxcd/resources/kustomization.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

templates/fluxcd/overlays/gotk-sync-kustomization.yaml renamed to templates/fluxcd/templates/overlays/gotk-sync-kustomization.yaml

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
4-
- {{ .Values.targetPath }}
4+
- {{ .Values.fluxCDResourcesPath }}
55
patches:
66
- path: gotk-sync-gitrepo.yaml
77
- path: gotk-sync-kustomization.yaml

templates/fluxcd/resources/gotk-components.yaml renamed to templates/fluxcd/templates/resources/gotk-components.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5344,6 +5344,8 @@ spec:
53445344
name: data
53455345
- mountPath: /tmp
53465346
name: tmp
5347+
imagePullSecrets:
5348+
- name: \{\{ .Values.imagePullSecret }}
53475349
nodeSelector:
53485350
kubernetes.io/os: linux
53495351
priorityClassName: system-cluster-critical
@@ -7240,6 +7242,8 @@ spec:
72407242
volumeMounts:
72417243
- mountPath: /tmp
72427244
name: temp
7245+
imagePullSecrets:
7246+
- name: \{\{ .Values.imagePullSecret }}
72437247
nodeSelector:
72447248
kubernetes.io/os: linux
72457249
priorityClassName: system-cluster-critical
@@ -11042,6 +11046,8 @@ spec:
1104211046
volumeMounts:
1104311047
- mountPath: /tmp
1104411048
name: temp
11049+
imagePullSecrets:
11050+
- name: \{\{ .Values.imagePullSecret }}
1104511051
nodeSelector:
1104611052
kubernetes.io/os: linux
1104711053
priorityClassName: system-cluster-critical
@@ -13021,6 +13027,8 @@ spec:
1302113027
volumeMounts:
1302213028
- mountPath: /tmp
1302313029
name: temp
13030+
imagePullSecrets:
13031+
- name: \{\{ .Values.imagePullSecret }}
1302413032
nodeSelector:
1302513033
kubernetes.io/os: linux
1302613034
securityContext:
@@ -14131,6 +14139,8 @@ spec:
1413114139
name: temp
1413214140
- mountPath: /data
1413314141
name: data
14142+
imagePullSecrets:
14143+
- name: \{\{ .Values.imagePullSecret }}
1413414144
nodeSelector:
1413514145
kubernetes.io/os: linux
1413614146
securityContext:
@@ -14964,6 +14974,8 @@ spec:
1496414974
volumeMounts:
1496514975
- mountPath: /tmp
1496614976
name: temp
14977+
imagePullSecrets:
14978+
- name: \{\{ .Values.imagePullSecret }}
1496714979
nodeSelector:
1496814980
kubernetes.io/os: linux
1496914981
securityContext:

templates/fluxcd/resources/gotk-sync.yaml renamed to templates/fluxcd/templates/resources/gotk-sync.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,19 @@ spec:
2424
sourceRef:
2525
kind: GitRepository
2626
name: environments
27+
28+
29+
30+
##
31+
GITREPO/
32+
envs/
33+
dev/ envName
34+
flux-system/
35+
gotk-sync-gitrepo.yaml
36+
gotk-sync-kustomization.yaml (envPathFluxSystem zeigt auf parent /envs/dev/flux-system)
37+
kustomization.yaml (targetpath zeigt auf ../../../resources/flux-system)
38+
resources/
39+
flux-system/ TARGETPATH
40+
gotk-components.yaml
41+
gotk-sync.yaml
42+
kustomization.yaml
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
resources:
3+
- gotk-components.yaml
4+
- gotk-sync.yaml
5+
images:
6+
- name: ghcr.io/fluxcd/source-controller
7+
newName: {{ .Values.sourceControllerImage }}
8+
- name: ghcr.io/fluxcd/notification-controller

templates/openmcp/templates/overlays/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
4-
- ../resources
4+
- {{ .Values.openMCPResourcesPath }}
55
images:
66
- name: <openmcp/openmcp-operator>
77
newName: {{.Values.openmcpOperator.image }}

0 commit comments

Comments
 (0)