mirror of
https://github.com/2martens/terraform.git
synced 2026-10-17 14:36:50 +02:00
Install argocd in high availability if at least three nodes are available
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
resource "null_resource" "install_argocd" {
|
||||
resource "null_resource" "install_setup" {
|
||||
connection {
|
||||
host = hcloud_server_network.manager_private[0].ip
|
||||
user = "root"
|
||||
@@ -10,8 +10,56 @@ resource "null_resource" "install_argocd" {
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"helm repo add 2martens https://repo.2martens.de/charts/",
|
||||
"helm install 2martens/cluster_setup",
|
||||
"helm install 2martens/argocd",
|
||||
"helm install setup 2martens/cluster_setup",
|
||||
]
|
||||
}
|
||||
|
||||
depends_on = [null_resource.join_nodes, hcloud_server.manager]
|
||||
}
|
||||
|
||||
resource "null_resource" "install_argocd_single" {
|
||||
count = var.number_nodes < 3 ? 1 : 0
|
||||
|
||||
connection {
|
||||
host = hcloud_server_network.manager_private[0].ip
|
||||
user = "root"
|
||||
type = "ssh"
|
||||
private_key = var.terraform_private_ssh_key
|
||||
timeout = "2m"
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"helm repo add 2martens https://repo.2martens.de/charts/",
|
||||
"helm install setup 2martens/cluster_setup",
|
||||
"helm install argocd 2martens/argocd",
|
||||
]
|
||||
}
|
||||
|
||||
depends_on = [null_resource.join_nodes, hcloud_server.manager]
|
||||
}
|
||||
|
||||
resource "null_resource" "install_argocd_ha" {
|
||||
count = var.number_nodes >= 3 ? 1 : 0
|
||||
|
||||
connection {
|
||||
host = hcloud_server_network.manager_private[0].ip
|
||||
user = "root"
|
||||
type = "ssh"
|
||||
private_key = var.terraform_private_ssh_key
|
||||
timeout = "2m"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
content = file("${path.module}/templates/argocd-values-ha.yaml")
|
||||
destination = "/home/terraform/argocd-values-ha.yaml"
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"helm repo add 2martens https://repo.2martens.de/charts/",
|
||||
"helm install setup 2martens/cluster_setup",
|
||||
"helm install argocd 2martens/argocd --values /home/terraform/argocd-values-ha.yaml",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
argo-cd:
|
||||
redis-ha:
|
||||
enabled: true
|
||||
|
||||
controller:
|
||||
replicas: 1
|
||||
|
||||
server:
|
||||
replicas: 2
|
||||
|
||||
repoServer:
|
||||
replicas: 2
|
||||
|
||||
applicationSet:
|
||||
replicas: 2
|
||||
Reference in New Issue
Block a user