deploy flux to cluster

This commit is contained in:
Julian Tölle 2020-05-06 01:35:52 +02:00
parent 2863062e44
commit 4219439b5e
4 changed files with 39 additions and 0 deletions

View 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}

View file

@ -16,6 +16,11 @@ locals {
version = var.cert_manager_version
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 {
@ -26,6 +31,7 @@ resource null_resource install_manifests {
hcloud_csi_driver = sha256(local.manifest_hcloud_csi_driver)
cert_manager_crds = sha256(local.manifest_cert_manager_crds)
cert_manager = sha256(local.manifest_cert_manager)
flux = sha256(local.manifest_flux)
}
connection {
@ -47,5 +53,10 @@ resource null_resource install_manifests {
content = local.manifest_cert_manager
destination = "${local.k3s_manifest_folder}/cert-manager.yaml"
}
provisioner file {
content = local.manifest_flux
destination = "${local.k3s_manifest_folder}/flux.yaml"
}
}

View file

@ -65,3 +65,12 @@ variable cert_manager_version {
type = string
default = "v0.14.3"
}
variable flux_version {
type = string
default = "v1.3.0"
}
variable flux_git_url {
type = string
}

View file

@ -15,4 +15,5 @@ module k3s_cluster {
letsencrypt_email = "julian.toelle97+le@gmail.com"
ssh_keys = [file("./keys/id_terraform")]
hcloud_csi_driver_token = var.hcloud_csi_driver_token
flux_git_url = "git@github.com:apricote/home-cloud-flux"
}