feat(external): add external ApplicationSet

For charts that requires external resources
This commit is contained in:
Khue Doan 2021-12-08 10:32:20 +07:00
parent 8414b70c1c
commit 043329c5e6
3 changed files with 79 additions and 0 deletions

3
external/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.terraform*
terraform.tfstate
terraform.tfvars

47
external/applicationset.tf vendored Normal file
View File

@ -0,0 +1,47 @@
resource "kubernetes_manifest" "external_applicationset" {
manifest = {
apiVersion = "argoproj.io/v1alpha1"
kind = "ApplicationSet"
metadata = {
name = "external"
namespace = "argocd"
}
spec = {
generators = [
{
git = {
directories = [
{
path = "external/*"
}
]
repoURL = "https://github.com/khuedoan/homelab.git"
revision = "master"
}
},
]
template = {
metadata = {
name = "{{path.basename}}"
}
spec = {
destination = {
name = "in-cluster"
namespace = "{{path.basename}}"
}
project = "default"
source = {
path = "{{path}}"
repoURL = "https://github.com/khuedoan/homelab.git"
}
syncPolicy = {
automated = {
prune = true
selfHeal = true
}
}
}
}
}
}
}

29
external/versions.tf vendored Normal file
View File

@ -0,0 +1,29 @@
terraform {
required_version = "~> 1.0.0"
backend "remote" {
hostname = "app.terraform.io"
organization = "khuedoan"
workspaces {
name = "homelab-external"
}
}
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 3.4.0"
}
b2 = {
source = "Backblaze/b2"
version = "~> 0.7.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.7.0"
}
}
}