Added first kubernetes resources, removed clutter
This commit is contained in:
@@ -20,11 +20,11 @@ tofu plan
|
|||||||
tofu apply
|
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
|
```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:
|
Test if your cluster access works by listing the nodes:
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
8
kubernetes/helm_releases.tf
Normal file
8
kubernetes/helm_releases.tf
Normal 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
|
||||||
|
}
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +1,15 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
kubernetes = {
|
helm = {
|
||||||
source = "opentofu/kubernetes"
|
source = "hashicorp/helm"
|
||||||
version = "2.32.0"
|
version = "3.0.2"
|
||||||
}
|
}
|
||||||
helm = {
|
|
||||||
source = "opentofu/helm"
|
|
||||||
version = "2.15.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
provider "kubernetes" {
|
|
||||||
config_path = "~/.kube/config"
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "helm" {
|
provider "helm" {
|
||||||
kubernetes {
|
kubernetes = {
|
||||||
config_path = "~/.kube/config"
|
config_path = var.kubernetes_config_path
|
||||||
|
config_context = var.Kubernetes_config_context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
9
kubernetes/variables.tf
Normal file
9
kubernetes/variables.tf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
variable "kubernetes_config_path" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "Kubernetes_config_context" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user