Skip to content

Commit

Permalink
Renew homelab
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Dec 20, 2024
1 parent 70142e9 commit cf46c2e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion aks/argocd/1-bootstrap/argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
source:
repoURL: https://github.com/jkroepke/homelab.git
targetRevision: HEAD
path: argocd/1-bootstrap
path: aks/argocd/1-bootstrap

# Destination cluster and namespace to deploy the application
destination:
Expand Down
5 changes: 5 additions & 0 deletions aks/terraform/infrastructure/_providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ provider "azapi" {
tenant_id = "9c1de352-64a4-4509-b3fc-4ef2df8db9b8"
subscription_id = "1988b893-553c-4652-bd9b-52f089b21ead"
}

provider "azureakscommand" {
tenant_id = "9c1de352-64a4-4509-b3fc-4ef2df8db9b8"
subscription_id = "1988b893-553c-4652-bd9b-52f089b21ead"
}
8 changes: 6 additions & 2 deletions aks/terraform/infrastructure/az_aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ resource "azurerm_kubernetes_cluster" "jok" {
#kubelet_disk_type = "Temporary"

only_critical_addons_enabled = false

upgrade_settings {
drain_timeout_in_minutes = 5
max_surge = "1"
node_soak_duration_in_minutes = 0
}
}

linux_profile {
Expand Down Expand Up @@ -127,8 +133,6 @@ resource "azurerm_kubernetes_cluster" "jok" {
sku_tier = "Free"

depends_on = [
azurerm_resource_provider_registration.encryption_at_host,
null_resource.ContainerService_Refresh_Register,
azurerm_role_assignment.mi-aks-contributor,
azurerm_role_assignment.mi-aks-mi-operator
]
Expand Down
14 changes: 10 additions & 4 deletions aks/terraform/infrastructure/k8s-argocd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ resource "azureakscommand_invoke" "argocd" {
resource_group_name = azurerm_kubernetes_cluster.jok.resource_group_name
name = azurerm_kubernetes_cluster.jok.name

command = <<-EOT
helm install argocd argo-cd --wait --repo https://argoproj.github.io/argo-helm --create-namespace -n argocd
k apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
EOT
command = <<EOT
helm install argocd argo-cd --wait --repo https://argoproj.github.io/argo-helm --create-namespace -n argocd;
kubectl apply -n argocd -f - <<API
${file("${path.module}/../../argocd/1-bootstrap/argocd.yaml")}
API
EOT

lifecycle {
postcondition {
Expand All @@ -14,3 +16,7 @@ resource "azureakscommand_invoke" "argocd" {
}
}
}

output "output" {
value = azureakscommand_invoke.argocd.output
}

0 comments on commit cf46c2e

Please sign in to comment.