-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CAPI capability of Flux's HelmRelease to install apps into target…
… cluster
- Loading branch information
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Install applications into Target Cluster | ||
|
||
To install applications into the target cluster created using Cluster API (CAPI) upon creation, a Flux `HelmRelease` object is to be made such that its `.spec.KubeConfig` references the kubeconfig of the target cluster. | ||
|
||
**Reference:** https://fluxcd.io/flux/components/helm/helmreleases/#remote-clusters--cluster-api | ||
|
||
This chart/template already defines the following applications under `templates/apps` to be installed into the target cluster: | ||
1. cert-manager | ||
2. nginx-ingress | ||
|
||
**Important:** The Flux objects added to `templates/apps` to install custom applications must have the `hmc.mirantis.com/managed: "true"` label to be reconciled by HMC. |
40 changes: 40 additions & 0 deletions
40
templates/aws-standalone-cp/templates/apps/cert-manager.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: cert-manager | ||
labels: | ||
hmc.mirantis.com/managed: "true" | ||
spec: | ||
interval: 24h | ||
url: https://charts.jetstack.io | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: {{ include "cluster.name" . }}-cert-manager | ||
labels: | ||
hmc.mirantis.com/managed: "true" | ||
spec: | ||
chart: | ||
metadata: | ||
labels: | ||
hmc.mirantis.com/managed: "true" | ||
spec: | ||
chart: cert-manager | ||
version: ">=v1.12.3" | ||
sourceRef: | ||
kind: HelmRepository | ||
name: cert-manager | ||
install: | ||
createNamespace: true | ||
remediation: | ||
retries: -1 | ||
interval: 10m | ||
kubeConfig: | ||
secretRef: | ||
name: {{ include "cluster.name" . }}-kubeconfig | ||
releaseName: cert-manager | ||
targetNamespace: cert-manager | ||
storageNamespace: cert-manager | ||
values: | ||
installCRDs: true |
34 changes: 34 additions & 0 deletions
34
templates/aws-standalone-cp/templates/apps/nginx-ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: source.toolkit.fluxcd.io/v1beta2 | ||
kind: OCIRepository | ||
metadata: | ||
name: nginx-ingress | ||
labels: | ||
hmc.mirantis.com/managed: "true" | ||
spec: | ||
interval: 24h | ||
url: oci://ghcr.io/nginxinc/charts/nginx-ingress | ||
ref: | ||
semver: "1.3.2" | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: {{ include "cluster.name" . }}-nginx-ingress | ||
labels: | ||
hmc.mirantis.com/managed: "true" | ||
spec: | ||
targetNamespace: nginx-ingress | ||
storageNamespace: nginx-ingress | ||
kubeConfig: | ||
secretRef: | ||
name: {{ include "cluster.name" . }}-kubeconfig | ||
interval: 10m | ||
chartRef: | ||
kind: OCIRepository | ||
name: nginx-ingress | ||
install: | ||
createNamespace: true | ||
remediation: | ||
retries: -1 | ||
values: | ||
fullnameOverride: nginx-ingress |