mirror of
https://github.com/apricote/home-cloud.git
synced 2026-01-13 13:01:03 +00:00
deploy flux helm-operator to cluster
This commit is contained in:
parent
0f007bfea3
commit
36b4fe6a6e
4 changed files with 48 additions and 4 deletions
5
k3s_cluster/files/k8s-apps/helm-operator-crds.sh
Normal file
5
k3s_cluster/files/k8s-apps/helm-operator-crds.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
MANIFEST_FILE=https://raw.githubusercontent.com/fluxcd/helm-operator/${version}/deploy/crds.yaml
|
||||
K3S_MANIFEST_FOLDER=${k3s_manifest_folder}
|
||||
|
||||
curl -sfL $MANIFEST_FILE > $K3S_MANIFEST_FOLDER/helm-operator-crds.yml
|
||||
13
k3s_cluster/files/k8s-apps/helm-operator.yaml
Normal file
13
k3s_cluster/files/k8s-apps/helm-operator.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
apiVersion: helm.cattle.io/v1
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: helm-operator
|
||||
namespace: kube-system
|
||||
spec:
|
||||
chart: helm-operator
|
||||
repo: https://charts.fluxcd.io
|
||||
version: ${version}
|
||||
targetNamespace: flux
|
||||
set:
|
||||
helm.versions: v3
|
||||
|
|
@ -21,6 +21,16 @@ locals {
|
|||
version = var.flux_version
|
||||
git_url = var.flux_git_url
|
||||
})
|
||||
|
||||
manifest_helm_operator_crds = templatefile("${path.module}/files/k8s-apps/helm-operator-crds.sh", {
|
||||
version = var.helm_operator_version
|
||||
k3s_manifest_folder = local.k3s_manifest_folder
|
||||
})
|
||||
|
||||
manifest_helm_operator = templatefile("${path.module}/files/k8s-apps/helm-operator.yaml", {
|
||||
version = var.helm_operator_version
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
resource null_resource install_manifests {
|
||||
|
|
@ -32,6 +42,8 @@ resource null_resource install_manifests {
|
|||
cert_manager_crds = sha256(local.manifest_cert_manager_crds)
|
||||
cert_manager = sha256(local.manifest_cert_manager)
|
||||
flux = sha256(local.manifest_flux)
|
||||
helm_operator_crds = sha256(local.manifest_helm_operator_crds)
|
||||
helm_operator = sha256(local.manifest_helm_operator)
|
||||
}
|
||||
|
||||
connection {
|
||||
|
|
@ -49,6 +61,10 @@ resource null_resource install_manifests {
|
|||
inline = [local.manifest_cert_manager_crds]
|
||||
}
|
||||
|
||||
provisioner remote-exec {
|
||||
inline = [local.manifest_helm_operator_crds]
|
||||
}
|
||||
|
||||
provisioner file {
|
||||
content = local.manifest_cert_manager
|
||||
destination = "${local.k3s_manifest_folder}/cert-manager.yaml"
|
||||
|
|
@ -58,5 +74,10 @@ resource null_resource install_manifests {
|
|||
content = local.manifest_flux
|
||||
destination = "${local.k3s_manifest_folder}/flux.yaml"
|
||||
}
|
||||
|
||||
provisioner file {
|
||||
content = local.manifest_helm_operator
|
||||
destination = "${local.k3s_manifest_folder}/helm-operator.yaml"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,3 +74,8 @@ variable flux_version {
|
|||
variable flux_git_url {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable helm_operator_version {
|
||||
type = string
|
||||
default = "v1.0.1"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue