Added first kubernetes resources, removed clutter

This commit is contained in:
Max Pfeiffer
2025-09-18 19:01:32 +02:00
parent 644bb6af90
commit 6db6a6b960
6 changed files with 28 additions and 41 deletions

View File

@@ -20,11 +20,11 @@ tofu plan
tofu apply
```
You can then grab the kube config file for Kubernetes provisioning like so:
You can then grab and move the kube config file for Kubernetes provisioning like so:
```shell
tofu output kubeconfig
tofu output kubeconfig -raw > ~/.kube/config
chmod 600 ~/.kube/config
```
and put its contents into your `~/.kube/config`.
Test if your cluster access works by listing the nodes:
```shell

View File

@@ -0,0 +1,8 @@
resource "helm_release" "argocd" {
name = "argo-cd"
namespace = "argocd"
chart = "argo-cd"
version = "8.3.1"
repository = "https://argoproj.github.io/argo-helm"
timeout = 120
}

View File

@@ -1,23 +0,0 @@
resource "kubernetes_namespace" "ingress" {
metadata {
name = "ingress"
}
}
resource "kubernetes_namespace" "argocd" {
metadata {
name = "argocd"
}
}
resource "kubernetes_namespace" "applications" {
metadata {
name = "applications"
}
}
resource "kubernetes_namespace" "persistence" {
metadata {
name = "persistence"
}
}

View File

@@ -1,22 +1,15 @@
terraform {
required_providers {
kubernetes = {
source = "opentofu/kubernetes"
version = "2.32.0"
}
helm = {
source = "opentofu/helm"
version = "2.15.0"
}
helm = {
source = "hashicorp/helm"
version = "3.0.2"
}
}
}
provider "kubernetes" {
config_path = "~/.kube/config"
}
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
kubernetes = {
config_path = var.kubernetes_config_path
config_context = var.Kubernetes_config_context
}
}
}

9
kubernetes/variables.tf Normal file
View File

@@ -0,0 +1,9 @@
variable "kubernetes_config_path" {
type = string
sensitive = true
}
variable "Kubernetes_config_context" {
type = string
sensitive = true
}