mirror of
https://github.com/optim-enterprises-bv/homelab.git
synced 2025-11-02 02:48:02 +00:00
feat(init): Initial commit
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -27,3 +27,5 @@ override.tf.json
|
|||||||
|
|
||||||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
|
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
|
||||||
# example: *tfplan*
|
# example: *tfplan*
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|||||||
8
COMPONENTS.md
Normal file
8
COMPONENTS.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
kubespray
|
||||||
|
Argo autopilot
|
||||||
|
|
||||||
|
Traefik
|
||||||
|
cert-manager?
|
||||||
|
ArgoCD
|
||||||
|
Prometheus
|
||||||
|
Grafana
|
||||||
1
README.md
Normal file
1
README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
A Terraform script to provision a Kubernetes Cluster with stuff
|
||||||
1
RESOURCES.md
Normal file
1
RESOURCES.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/guides/getting-started
|
||||||
63
main.tf
Normal file
63
main.tf
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
kubernetes = {
|
||||||
|
source = "hashicorp/kubernetes"
|
||||||
|
version = ">= 2.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
provider "kubernetes" {
|
||||||
|
config_path = "~/.kube/config"
|
||||||
|
}
|
||||||
|
resource "kubernetes_namespace" "test" {
|
||||||
|
metadata {
|
||||||
|
name = "nginx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resource "kubernetes_deployment" "test" {
|
||||||
|
metadata {
|
||||||
|
name = "nginx"
|
||||||
|
namespace = kubernetes_namespace.test.metadata.0.name
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
replicas = 2
|
||||||
|
selector {
|
||||||
|
match_labels = {
|
||||||
|
app = "MyTestApp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template {
|
||||||
|
metadata {
|
||||||
|
labels = {
|
||||||
|
app = "MyTestApp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
container {
|
||||||
|
image = "nginx"
|
||||||
|
name = "nginx-container"
|
||||||
|
port {
|
||||||
|
container_port = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resource "kubernetes_service" "test" {
|
||||||
|
metadata {
|
||||||
|
name = "nginx"
|
||||||
|
namespace = kubernetes_namespace.test.metadata.0.name
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
selector = {
|
||||||
|
app = kubernetes_deployment.test.spec.0.template.0.metadata.0.labels.app
|
||||||
|
}
|
||||||
|
type = "NodePort"
|
||||||
|
port {
|
||||||
|
node_port = 30201
|
||||||
|
port = 80
|
||||||
|
target_port = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user