From 2c29b3ef0ecfc5ff57b06b1737b67997ce2a6aaa Mon Sep 17 00:00:00 2001 From: Marko Petrovic Date: Thu, 7 Jul 2022 10:31:54 +0200 Subject: [PATCH 1/6] Fix: cluster-reconciler rolebinding to wrong serviceaccount --- config/rbac/reconciler_binding.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/rbac/reconciler_binding.yaml b/config/rbac/reconciler_binding.yaml index 23faa21..b817055 100644 --- a/config/rbac/reconciler_binding.yaml +++ b/config/rbac/reconciler_binding.yaml @@ -8,5 +8,5 @@ roleRef: name: cluster-admin subjects: - kind: ServiceAccount - name: controller + name: flux-kluctl-controller namespace: flux-system From 26aa02455efd0a6fa0f37b490ffdf5acf5ff9eef Mon Sep 17 00:00:00 2001 From: Marko Petrovic Date: Thu, 7 Jul 2022 10:41:33 +0200 Subject: [PATCH 2/6] Fix: rolebindings targeting correct serviceaccount --- config/rbac/leader_election_role_binding.yaml | 2 +- config/rbac/role_binding.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 26fa855..6d4335e 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -8,5 +8,5 @@ roleRef: name: leader-election-role subjects: - kind: ServiceAccount - name: controller + name: flux-kluctl-controller namespace: flux-system diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index a7c834d..c4cf5eb 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -8,5 +8,5 @@ roleRef: name: manager-role subjects: - kind: ServiceAccount - name: controller + name: flux-kluctl-controller namespace: flux-system From 172f46a2447533ce43f3a6e6e8c4e1e03b56cb7d Mon Sep 17 00:00:00 2001 From: Marko Petrovic Date: Tue, 12 Jul 2022 10:15:24 +0200 Subject: [PATCH 3/6] Add: patch option for using flux-notification-controller with KluctlDeployments --- config/patch/alerts-crd-patch.yaml | 3 +++ docs/install.md | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 config/patch/alerts-crd-patch.yaml diff --git a/config/patch/alerts-crd-patch.yaml b/config/patch/alerts-crd-patch.yaml new file mode 100644 index 0000000..6d567c6 --- /dev/null +++ b/config/patch/alerts-crd-patch.yaml @@ -0,0 +1,3 @@ +- op: "add" + path: "/spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/eventSources/items/properties/kind/enum/-" + value: "KluctlDeployment" diff --git a/docs/install.md b/docs/install.md index 51312bf..18e49b9 100644 --- a/docs/install.md +++ b/docs/install.md @@ -8,3 +8,24 @@ After Flux has been installed, you can install the Flux Kluctl Controller by run ```sh kustomize build "https://github.com/kluctl/flux-kluctl-controller/config/install?ref=v0.3.0" | kubectl apply -f- ``` + + +_NOTE: To set up Flux Alerts from KluctlDeployments you will need to patch the enum in the Alerts CRD. +There is a [patch](../config/patch/alerts-crd-patch.yaml) included in this repository that can do this for you. You can apply it directly or include the [yaml](../config/patch/alerts-crd-patch.yaml) version in `gotk-patch.yaml` with your `flux bootstrap`. +You can also add something like the following to your cluster's `kustomization.yaml`:_ + +```yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- gotk-components.yaml +- gotk-sync.yaml +patchesJson6902: +- target: + group: apiextensions.k8s.io + version: v1 + kind: CustomResourceDefinition + name: alerts.notification.toolkit.fluxcd.io + path: 'alerts-crd-patch.yaml' # The downloaded patch in your flux repository + +``` From afd37c4ed4096567a1ce69f6447de3ed9a6032dd Mon Sep 17 00:00:00 2001 From: Marko Petrovic Date: Tue, 12 Jul 2022 10:18:26 +0200 Subject: [PATCH 4/6] Revert: role binding sa names --- config/rbac/leader_election_role_binding.yaml | 2 +- config/rbac/reconciler_binding.yaml | 2 +- config/rbac/role_binding.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 6d4335e..26fa855 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -8,5 +8,5 @@ roleRef: name: leader-election-role subjects: - kind: ServiceAccount - name: flux-kluctl-controller + name: controller namespace: flux-system diff --git a/config/rbac/reconciler_binding.yaml b/config/rbac/reconciler_binding.yaml index b817055..23faa21 100644 --- a/config/rbac/reconciler_binding.yaml +++ b/config/rbac/reconciler_binding.yaml @@ -8,5 +8,5 @@ roleRef: name: cluster-admin subjects: - kind: ServiceAccount - name: flux-kluctl-controller + name: controller namespace: flux-system diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index c4cf5eb..a7c834d 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -8,5 +8,5 @@ roleRef: name: manager-role subjects: - kind: ServiceAccount - name: flux-kluctl-controller + name: controller namespace: flux-system From 0a5384b604870526e2f79012da812d2996e5874f Mon Sep 17 00:00:00 2001 From: Marko Petrovic Date: Mon, 3 Oct 2022 13:25:41 +0200 Subject: [PATCH 5/6] Add: section about CLI support --- docs/install.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/install.md b/docs/install.md index 6d9833a..3cb3e86 100644 --- a/docs/install.md +++ b/docs/install.md @@ -59,3 +59,11 @@ patchesJson6902: path: 'alerts-crd-patch.yaml' # The downloaded patch in your flux repository ``` + +## CLI support + +Currently kluctl cli supports experimental subcommands to interact with KluctlDeployment Objects and it's source.
+ +You can install kluctl cli following the guideline [here](https://kluctl.io/docs/installation/). + +Usage guidelines can be found [here](https://kluctl.io/docs/reference/commands/flux/). \ No newline at end of file From 09ec8e9b016a87811e09abd82eb4b04fbde8c8b6 Mon Sep 17 00:00:00 2001 From: Marko Petrovic Date: Mon, 3 Oct 2022 13:26:30 +0200 Subject: [PATCH 6/6] Add: section about CLI support --- docs/install.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docs/install.md b/docs/install.md index 3cb3e86..ccad144 100644 --- a/docs/install.md +++ b/docs/install.md @@ -40,26 +40,6 @@ patchesJson6902: ``` -_NOTE: To set up Flux Alerts from KluctlDeployments you will need to patch the enum in the Alerts CRD. -There is a [patch](../config/patch/alerts-crd-patch.yaml) included in this repository that can do this for you. You can apply it directly or include the [yaml](../config/patch/alerts-crd-patch.yaml) version in `gotk-patch.yaml` with your `flux bootstrap`. -You can also add something like the following to your cluster's `kustomization.yaml`:_ - -```yaml -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- gotk-components.yaml -- gotk-sync.yaml -patchesJson6902: -- target: - group: apiextensions.k8s.io - version: v1 - kind: CustomResourceDefinition - name: alerts.notification.toolkit.fluxcd.io - path: 'alerts-crd-patch.yaml' # The downloaded patch in your flux repository - -``` - ## CLI support Currently kluctl cli supports experimental subcommands to interact with KluctlDeployment Objects and it's source.