mirror of
https://github.com/apricote/home-cloud.git
synced 2026-01-13 21:11:02 +00:00
deploy flux to cluster
This commit is contained in:
parent
2863062e44
commit
4219439b5e
4 changed files with 39 additions and 0 deletions
18
k3s_cluster/files/k8s-apps/flux.yaml
Normal file
18
k3s_cluster/files/k8s-apps/flux.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: flux
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: helm.cattle.io/v1
|
||||||
|
kind: HelmChart
|
||||||
|
metadata:
|
||||||
|
name: flux
|
||||||
|
namespace: flux
|
||||||
|
spec:
|
||||||
|
chart: flux
|
||||||
|
repo: https://charts.fluxcd.io
|
||||||
|
version: ${version}
|
||||||
|
targetNamespace: flux
|
||||||
|
set:
|
||||||
|
git.url: ${git_url}
|
||||||
|
|
@ -16,6 +16,11 @@ locals {
|
||||||
version = var.cert_manager_version
|
version = var.cert_manager_version
|
||||||
email = var.letsencrypt_email
|
email = var.letsencrypt_email
|
||||||
})
|
})
|
||||||
|
|
||||||
|
manifest_flux = templatefile("${path.module}/files/k8s-apps/flux.yaml", {
|
||||||
|
version = var.flux_version
|
||||||
|
git_url = var.flux_git_url
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
resource null_resource install_manifests {
|
resource null_resource install_manifests {
|
||||||
|
|
@ -26,6 +31,7 @@ resource null_resource install_manifests {
|
||||||
hcloud_csi_driver = sha256(local.manifest_hcloud_csi_driver)
|
hcloud_csi_driver = sha256(local.manifest_hcloud_csi_driver)
|
||||||
cert_manager_crds = sha256(local.manifest_cert_manager_crds)
|
cert_manager_crds = sha256(local.manifest_cert_manager_crds)
|
||||||
cert_manager = sha256(local.manifest_cert_manager)
|
cert_manager = sha256(local.manifest_cert_manager)
|
||||||
|
flux = sha256(local.manifest_flux)
|
||||||
}
|
}
|
||||||
|
|
||||||
connection {
|
connection {
|
||||||
|
|
@ -47,5 +53,10 @@ resource null_resource install_manifests {
|
||||||
content = local.manifest_cert_manager
|
content = local.manifest_cert_manager
|
||||||
destination = "${local.k3s_manifest_folder}/cert-manager.yaml"
|
destination = "${local.k3s_manifest_folder}/cert-manager.yaml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provisioner file {
|
||||||
|
content = local.manifest_flux
|
||||||
|
destination = "${local.k3s_manifest_folder}/flux.yaml"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,3 +65,12 @@ variable cert_manager_version {
|
||||||
type = string
|
type = string
|
||||||
default = "v0.14.3"
|
default = "v0.14.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable flux_version {
|
||||||
|
type = string
|
||||||
|
default = "v1.3.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable flux_git_url {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
|
||||||
1
main.tf
1
main.tf
|
|
@ -15,4 +15,5 @@ module k3s_cluster {
|
||||||
letsencrypt_email = "julian.toelle97+le@gmail.com"
|
letsencrypt_email = "julian.toelle97+le@gmail.com"
|
||||||
ssh_keys = [file("./keys/id_terraform")]
|
ssh_keys = [file("./keys/id_terraform")]
|
||||||
hcloud_csi_driver_token = var.hcloud_csi_driver_token
|
hcloud_csi_driver_token = var.hcloud_csi_driver_token
|
||||||
|
flux_git_url = "git@github.com:apricote/home-cloud-flux"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue