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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
**/config/*
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ tasks:
- |
flux install --export \
--components-extra="image-reflector-controller,image-automation-controller" \
> gotk-components.yaml
dir: ./templates/fluxcd/resources
> components.yaml
dir: ./templates/fluxcd/templates/resources

pull:
desc: Pulls the resources from the gitops-template ocm.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.3-dev
v0.0.4
42 changes: 33 additions & 9 deletions docs/Templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,51 @@ platformClusterKubeconfigSecretName: "platform-kubeconfig"
resources files:

```yaml
# The information for the git repo
git:
repoUrl: "" # The url to the github gitops repository
mainBranch: "" # The main branch of the gitops repository (most of the time, set it to 'main')
repoUrl: ""
mainBranch: ""

# Image pull secrets to be added to all deployments
imagePullSecrets: []
# - name: my-registry-secret

# Image replacement variables
# You can either specify a prefix which is put in front of xxx-controller or directly specify the images
images:
prefix: "ghcr.io/openmcp-project/fluxcd"
sourceController:
image: "ghcr.io/fluxcd/source-controller"
tag: "latest" # optional
digest: "" # optional
notificationController:
image: "ghcr.io/fluxcd/notification-controller"
kustomizeController:
image: "ghcr.io/fluxcd/kustomize-controller"
helmController:
image: "ghcr.io/fluxcd/helm-controller"
imageReflectorController:
image: "ghcr.io/fluxcd/image-reflector-controller"
imageAutomationController:
image: "ghcr.io/fluxcd/image-automation-controller"
```

When rendering the `overlays` files, the following values are used:

```yaml
fluxCDResourcesPath: "" # The path were the fluxcd resources are lying relative to the overlays
gitRepoEnvBranch: "" # The branch for this environment to look at
envPathFluxSystem: "" # The path were the env overlays are located at from the root of the git repo
# Path from the overlays folder to the resources folder of fluxcd (e.g. ../../../resources/fluxcd)
fluxCDResourcesPath: ""
# Path to the env fluxCD folder (e.g. envs/%ENV%/fluxcd)
fluxCDEnvPath: ""
# branch of the env (e.g. dev)
gitRepoEnvBranch: ""
```

### OpenMCP

```yaml
openMCPResourcesPath: "" # The path were the fluxcd resources are lying relative to the overlays
openMCPResourcesPath: "" # The path were the fluxcd resources are lying relative to the overlays (e.g. ../../../resources/openmcp)
openMCPOperator:
image: "" # the image of the openmcp operator to use
tag: "" # the tag of the image of the openmcp operator you want to use for deployment

onboardingClusterKubeconfigSecretName: "" # the secret name for the onboarding cluster; must be located in the openmcp-system namespace
platformClusterKubeconfigSecretName: "" # the secret name for the platform cluster; must be located in the openmcp-system namespace
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
name: flux-system
namespace: flux-system
spec:
path: {{ .Values.envPathFluxSystem }}
path: {{ .Values.fluxCDEnvPath }}
4 changes: 2 additions & 2 deletions templates/fluxcd/templates/overlays/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: Kustomization
resources:
- {{ .Values.fluxCDResourcesPath }}
patches:
- path: gotk-sync-gitrepo.yaml
- path: gotk-sync-kustomization.yaml
- path: gitrepo.yaml
- path: flux-kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5344,8 +5344,6 @@ spec:
name: data
- mountPath: /tmp
name: tmp
imagePullSecrets:
- name: \{\{ .Values.imagePullSecret }}
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
Expand Down Expand Up @@ -7242,8 +7240,6 @@ spec:
volumeMounts:
- mountPath: /tmp
name: temp
imagePullSecrets:
- name: \{\{ .Values.imagePullSecret }}
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
Expand Down Expand Up @@ -11046,8 +11042,6 @@ spec:
volumeMounts:
- mountPath: /tmp
name: temp
imagePullSecrets:
- name: \{\{ .Values.imagePullSecret }}
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
Expand Down Expand Up @@ -13027,8 +13021,6 @@ spec:
volumeMounts:
- mountPath: /tmp
name: temp
imagePullSecrets:
- name: \{\{ .Values.imagePullSecret }}
nodeSelector:
kubernetes.io/os: linux
securityContext:
Expand Down Expand Up @@ -14139,8 +14131,6 @@ spec:
name: temp
- mountPath: /data
name: data
imagePullSecrets:
- name: \{\{ .Values.imagePullSecret }}
nodeSelector:
kubernetes.io/os: linux
securityContext:
Expand Down Expand Up @@ -14974,8 +14964,6 @@ spec:
volumeMounts:
- mountPath: /tmp
name: temp
imagePullSecrets:
- name: \{\{ .Values.imagePullSecret }}
nodeSelector:
kubernetes.io/os: linux
securityContext:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: environments
namespace: flux-system
spec:
interval: 5m
url: {{ .Values.git.repoUrl }}
ref:
branch: {{ .Values.git.mainBranch }}
secretRef:
name: git
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
Expand Down
13 changes: 13 additions & 0 deletions templates/fluxcd/templates/resources/gitrepo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: environments
namespace: flux-system
spec:
interval: 5m
url: {{ .Values.git.repoUrl }}
ref:
branch: {{ .Values.git.mainBranch }}
secretRef:
name: git
43 changes: 38 additions & 5 deletions templates/fluxcd/templates/resources/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
---
{{- $prefix := .Values.images.prefix }}
{{- $images := dict
"source-controller" .Values.images.sourceController
"notification-controller" .Values.images.notificationController
"kustomize-controller" .Values.images.kustomizeController
"helm-controller" .Values.images.helmController
"image-reflector-controller" .Values.images.imageReflectorController
"image-automation-controller" .Values.images.imageAutomationController
}}
resources:
- gotk-components.yaml
- gotk-sync.yaml
- components.yaml
- gitrepo.yaml
- flux-kustomization.yaml
images:
- name: ghcr.io/fluxcd/source-controller
newName: {{ .Values.sourceControllerImage }}
- name: ghcr.io/fluxcd/notification-controller
{{- range $name, $cfg := $images }}
- name: ghcr.io/fluxcd/{{ $name }}
newName: {{ if $cfg }}{{ $cfg.image }}{{- else if $prefix }}{{ $prefix }}/{{ $name }}{{- else }}ghcr.io/fluxcd/{{ $name }}{{- end }}
{{- if and $cfg $cfg.tag }}
newTag: {{ $cfg.tag }}
{{- end }}
{{- if and $cfg $cfg.digest }}
digest: {{ $cfg.digest }}
{{- end }}
{{- end }}

{{- if .Values.imagePullSecrets }}
patches:
- target:
kind: Deployment
patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: this_value_is_ignored
spec:
template:
spec:
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
35 changes: 31 additions & 4 deletions templates/fluxcd/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
# Path from the overlays folder to the resources folder of fluxcd (e.g. ../../../resources/fluxcd)
fluxCDResourcesPath: "../resources"
# Path to the env fluxCD folder (e.g. envs/%ENV%/fluxcd)
fluxCDEnvPath: ""
# branch of the env (e.g. dev)
gitRepoEnvBranch: ""

# The information for the git repo
git:
repoUrl: ""
mainBranch: ""

# maybe like this
envs:
- git:
branch: ""
# Image pull secrets to be added to all deployments
imagePullSecrets: []
# - name: my-registry-secret

# Image replacement variables
# You can either specify a prefix which is put in front of xxx-controller or directly specify the images
images:
prefix: "ghcr.io/fluxcd"
# prefix: "ghcr.io/openmcp-project/fluxcd"
# sourceController:
# image: "ghcr.io/fluxcd/source-controller"
# tag: "latest" # optional
# digest: "" # optional
# notificationController:
# image: "ghcr.io/fluxcd/notification-controller"
# kustomizeController:
# image: "ghcr.io/fluxcd/kustomize-controller"
# helmController:
# image: "ghcr.io/fluxcd/helm-controller"
# imageReflectorController:
# image: "ghcr.io/fluxcd/image-reflector-controller"
# imageAutomationController:
# image: "ghcr.io/fluxcd/image-automation-controller"
6 changes: 0 additions & 6 deletions templates/kind/clusterprovider.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions templates/kind/deployment.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions templates/kind/kind-cluster-config.yaml

This file was deleted.

1 change: 1 addition & 0 deletions templates/openmcp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v2
name: gitops-templates-openmcp
description: GitOps Template for deploying openmcp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# please fill this out
3 changes: 3 additions & 0 deletions templates/openmcp/templates/overlays/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ images:
- name: <openmcp/openmcp-operator>
newName: {{.Values.openmcpOperator.image }}
newTag: {{.Values.openmcpOperator.tag | default "latest"}}
{{- if .Values.openmcpOperator.digest }}
digest: {{ .Values.openmcpOperator.digest }}
{{- end }}
secretGenerator:
- name: openmcp-operator-config
namespace: openmcp-system
Expand Down
Loading
Loading