Skip to content

Commit 1f0bb74

Browse files
authored
feat: flux-config - OCIRepository and HelmRelease configurations added (#26)
* feat: flux-config - OCIRepository and HelmRelease configurations added * chore(ci): update helm/charts/flux-config/Chart.yaml.version 0.0.17 -> 0.0.18 * chore(ci): update Helm Chart helm/charts/flux-config/README.md file --------- Co-authored-by: sk31337 <sk31337@users.noreply.github.com>
1 parent 51a5c98 commit 1f0bb74

File tree

6 files changed

+96
-3
lines changed

6 files changed

+96
-3
lines changed

helm/charts/flux-config/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ icon: "https://avatars.githubusercontent.com/u/52158677?s=200&v=4"
1717
# This is the chart version. This version number should be incremented each time you make changes
1818
# to the chart and its templates, including the app version.
1919
# Versions are expected to follow Semantic Versioning (https://semver.org/)
20-
version: 0.0.17
20+
version: 0.0.18
2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to
2323
# follow Semantic Versioning. They should reflect the version the application is using.

helm/charts/flux-config/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# flux-config
44

5-
![Version: 0.0.17](https://img.shields.io/badge/Version-0.0.17-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.3.0](https://img.shields.io/badge/AppVersion-2.3.0-informational?style=flat-square)
5+
![Version: 0.0.18](https://img.shields.io/badge/Version-0.0.18-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.3.0](https://img.shields.io/badge/AppVersion-2.3.0-informational?style=flat-square)
66

77
A Helm Chart to template flux manifests to leverage GitOps on a OpenMCP cluster.
88

@@ -54,6 +54,9 @@ A Helm Chart to template flux manifests to leverage GitOps on a OpenMCP cluster.
5454
| gitRepositorys[0].spec.secretRef | object | `{"name":""}` | *(optional)* [SecretRef](https://fluxcd.io/flux/components/source/api/v1/#source.toolkit.fluxcd.io/v1.GitRepositorySpec) specifies the Secret containing authentication credentials for the GitRepository. For HTTPS repositories the Secret must contain ‘username’ and ‘password’ fields for basic auth or ‘bearerToken’ field for token auth. For SSH repositories the Secret must contain ‘identity’ and ‘known_hosts’ fields. |
5555
| gitRepositorys[0].spec.secretRef.name | string | `""` | [`type SecretKeySelector `](https://pkg.go.dev/github.com/external-secrets/external-secrets/apis/meta/v1#SecretKeySelector) |
5656
| gitRepositorys[0].spec.url | string | `""` | [URL]() specifies the Git repository URL, it can be an HTTP/S or SSH address. |
57+
| helmReleases[0].name | string | `""` | defines k8s [`metadata.name`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository` |
58+
| helmReleases[0].namespace | string | `"default"` | *(optional)* defines k8s [`metadata.namespace`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository` |
59+
| helmReleases[0].spec | string | `nil` | |
5760
| kustomizations | list | `[{"commonMetadata":[],"components":{},"decryption":[],"dependsOn":{},"force":null,"healthChecks":{},"images":{},"interval":null,"kubeConfig":[],"name":"","namePrefix":null,"nameSuffix":null,"namespace":"ns1","patches":null,"path":"","postBuild":[],"prune":null,"retryInterval":null,"serviceAccountName":null,"sourceRef":{"apiVersion":"","kind":"GitRepository","name":"","namespace":"ns1"},"suspend":null,"targetnamespace":"ns1","timeout":null,"wait":null}]` | defines independent [`kind: Kustomization`](https://fluxcd.io/flux/components/kustomize/api/v1/#kustomize.toolkit.fluxcd.io/v1.Kustomization) manifest without the generation of `kind: GitRepository`. |
5861
| kustomizations[0].commonMetadata | list | `[]` | [commonMetadata](https://fluxcd.io/flux/components/kustomize/kustomizations/#common-metadata) is an *(optional)*field used to specify any metadata that should be applied to all the Kustomization’s resources. |
5962
| kustomizations[0].components | object | `{}` | [components](https://fluxcd.io/flux/components/kustomize/kustomizations/#components) is an *(optional)*list used to specify Kustomize components. This allows using reusable pieces of configuration logic that can be included from multiple overlays. |
@@ -83,6 +86,9 @@ A Helm Chart to template flux manifests to leverage GitOps on a OpenMCP cluster.
8386
| kustomizations[0].targetnamespace | string | `"ns1"` | *(optional)* targetNamespace defines the namespace in the `kind: Kustomization` manifests. |
8487
| kustomizations[0].timeout | string | `nil` | *(optional)* [Timeout](https://fluxcd.io/flux/components/kustomize/api/v1/#kustomize.toolkit.fluxcd.io/v1.KustomizationSpec) for validation, apply and health checking operations. Defaults to ‘Interval’ duration. e.g. 1m |
8588
| kustomizations[0].wait | string | `nil` | [wait](https://fluxcd.io/flux/components/kustomize/kustomizations/#wait) is an *(optional)*boolean field to perform health checks for all reconciled resources as part of the Kustomization. If set to true, .spec.healthChecks is ignored. |
89+
| ociRepositorys[0].name | string | `""` | defines k8s [`metadata.name`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository` |
90+
| ociRepositorys[0].namespace | string | `"default"` | *(optional)* defines k8s [`metadata.namespace`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository` |
91+
| ociRepositorys[0].spec | string | `nil` | |
8692

8793
----------------------------------------------
8894
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- range $item := .Values.helmReleases}}
2+
{{- if and ($item) (ne $item.name "")}}
3+
---
4+
apiVersion: helm.toolkit.fluxcd.io/v2
5+
kind: HelmRelease
6+
metadata:
7+
name: {{required "A valid value is required! (.Values.helmReleases[].name)" $item.name | lower | quote}}
8+
namespace: {{ $item.namespace | default $.Values.defaults.namespace | lower | quote }}
9+
labels:
10+
openmcp.cloud/blueprint-building-block: "{{ $.Chart.Name }}"
11+
openmcp.cloud/blueprint-building-block-version: "{{ $.Chart.Version }}"
12+
spec:
13+
{{- toYaml $item.spec | nindent 2 }}
14+
{{- end }}
15+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- range $item := .Values.ociRepositorys}}
2+
{{- if and ($item) (ne $item.name "")}}
3+
---
4+
apiVersion: source.toolkit.fluxcd.io/v1
5+
kind: OCIRepository
6+
metadata:
7+
name: {{required "A valid value is required! (.Values.ociRepositorys[].name)" $item.name | lower | quote}}
8+
namespace: {{ $item.namespace | default $.Values.defaults.namespace | lower | quote }}
9+
labels:
10+
openmcp.cloud/blueprint-building-block: "{{ $.Chart.Name }}"
11+
openmcp.cloud/blueprint-building-block-version: "{{ $.Chart.Version }}"
12+
spec:
13+
{{- toYaml $item.spec | nindent 2 }}
14+
{{- end }}
15+
{{- end }}

helm/charts/flux-config/values.ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
---
22
###! /!\ this file is only used in github pipeline to template a valid and NOT empty helm manifest! #####
33
########################################################################################################################
4+
ociRepositorys:
5+
- name: podinfo
6+
namespace: "default"
7+
spec:
8+
interval: 5m0s
9+
url: oci://ghcr.io/stefanprodan/manifests/podinfo
10+
ref:
11+
tag: lates
12+
########################################################################################################################
13+
helmReleases:
14+
- name: podinfo
15+
namespace: "default"
16+
spec:
17+
interval: 10m
18+
timeout: 5m
19+
chart:
20+
spec:
21+
chart: podinfo
22+
version: '6.5.*'
23+
sourceRef:
24+
kind: HelmRepository
25+
name: podinfo
26+
interval: 5m
27+
releaseName: podinfo
28+
install:
29+
remediation:
30+
retries: 3
31+
upgrade:
32+
remediation:
33+
retries: 3
34+
test:
35+
enable: true
36+
driftDetection:
37+
mode: enabled
38+
ignore:
39+
- paths: ["/spec/replicas"]
40+
target:
41+
kind: Deployment
42+
values:
43+
replicaCount: 2
44+
########################################################################################################################
445
kustomizations:
546
- name: chrome-hub-root-app
647
namespace: "default"

helm/charts/flux-config/values.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,28 @@ defaults:
66
# -- targetNamespace sets or overrides the default namespace in the `kind: Kustomization` manifests.
77
targetNamespace: "default"
88
########################################################################################################################
9+
ociRepositorys:
10+
# ociRepositorys[0].name -- defines k8s [`metadata.name`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository`
11+
- name: ""
12+
# -- *(optional)* defines k8s [`metadata.namespace`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository`
13+
namespace: "default"
14+
# spec -- defines k8s `spec` structured value of `kind: OCIRepository`. See [API browser](https://fluxcd.io/flux/components/source/ocirepositories/)
15+
spec:
16+
########################################################################################################################
17+
helmReleases:
18+
# helmReleases[0].name -- defines k8s [`metadata.name`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository`
19+
- name: ""
20+
# -- *(optional)* defines k8s [`metadata.namespace`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository`
21+
namespace: "default"
22+
# spec -- defines k8s `spec` structured value of `kind: HelmRelease`. See [API browser](https://fluxcd.io/flux/components/helm/helmreleases/)
23+
spec:
24+
########################################################################################################################
925
gitRepositorys:
1026
# gitRepositorys[0].name -- defines k8s [`metadata.name`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository`
1127
- name: ""
1228
# -- *(optional)* defines k8s [`metadata.namespace`](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta) value of `kind: GitRepository`
1329
namespace: "ns1"
14-
# spec -- defines k8s `spec` structured value of `kind: GitRepository`. See [API broswer](https://fluxcd.io/flux/components/source/api/v1/#source.toolkit.fluxcd.io/v1.GitRepositorySpec)
30+
# spec -- defines k8s `spec` structured value of `kind: GitRepository`. See [API browser](https://fluxcd.io/flux/components/source/api/v1/#source.toolkit.fluxcd.io/v1.GitRepositorySpec)
1531
spec:
1632
# -- [Interval](https://fluxcd.io/flux/components/source/api/v1/#source.toolkit.fluxcd.io/v1.GitRepositorySpec) at which the GitRepository URL is checked for updates. This interval is approximate and may be subject to jitter to ensure efficient use of resources.
1733
interval: 1m

0 commit comments

Comments
 (0)