ev crash backloop von hier

This commit is contained in:
Bast 2026-11-13 12:48:00 -06:00
parent 064abfa490
commit a6fbe86a5a
8 changed files with 975 additions and 6 deletions

11
clean-boday-it.sh Executable file
View file

@ -0,0 +1,11 @@
# 1. Helm's release records (what causes the "name still in use" error)
docker compose exec k3s-cluster kubectl delete secret -n default -l owner=helm,name=boday-it
# 2. The release's resources
docker compose exec k3s-cluster kubectl delete -n default \
deployment/boday-it-web statefulset/boday-it-db \
svc/boday-it-web svc/boday-it-db \
ingress/boday-it-ingress secret/boday-it-secrets
# 3. Check: only the PVC should remain
docker compose exec k3s-cluster kubectl get all,ingress,pvc -n default | grep boday

17
consul-tf-backup.json Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
apiVersion: v1 apiVersion: v1
clusters: clusters:
- cluster: - cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJkakNDQVIyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQWpNU0V3SHdZRFZRUUREQmhyTTNNdGMyVnkKZG1WeUxXTmhRREUzT1RNME9UQXlPVFV3SGhjTk1qWXhNRE14TWpNME5EVTFXaGNOTXpZeE1ESTRNak0wTkRVMQpXakFqTVNFd0h3WURWUVFEREJock0zTXRjMlZ5ZG1WeUxXTmhRREUzT1RNME9UQXlPVFV3V1RBVEJnY3Foa2pPClBRSUJCZ2dxaGtqT1BRTUJCd05DQUFTbmxTYkxBeFRzWXZOTktka21ldHBhaG54aGV3ajJPT25ZelZCbjJuRzkKMXB4SlNoS01HbDF2UklmR084M1dvTG1JdExBNEYyaGVHcUsyQVl3c2hpTUhvMEl3UURBT0JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVTBIbENUYXNkbGFEbmVLNUthM000CitOdXQ1YXN3Q2dZSUtvWkl6ajBFQXdJRFJ3QXdSQUlnUER1MTN1N2Y2TjA0WXpnR3dBM0gxcWZ4enpRS2d2YVoKMFdSNnMxNDBnUmtDSUMxUm5sNWRvbmVMWlFPZTVabG5RVjE0MHMyc3dtSzk4ZXo0TjJqQWJmM1cKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJlRENDQVIyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQWpNU0V3SHdZRFZRUUREQmhyTTNNdGMyVnkKZG1WeUxXTmhRREUzT1RRME5ERXlNRFV3SGhjTk1qWXhNVEV4TWpNMU16STFXaGNOTXpZeE1UQTRNak0xTXpJMQpXakFqTVNFd0h3WURWUVFEREJock0zTXRjMlZ5ZG1WeUxXTmhRREUzT1RRME5ERXlNRFV3V1RBVEJnY3Foa2pPClBRSUJCZ2dxaGtqT1BRTUJCd05DQUFTUmR0V0FCOXZEU1VSNDZQeEFBcDUrZ05TNVRqZWhhQUZnanJsVmF4dS8KdVBFSnJ0b3JRdmpPSlpIVmVzR00yemtockRPU1F0VDE0WU4wUmIybGhFdWZvMEl3UURBT0JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVUZic2kwVVFuYi9jQnZ3dXdKQyszCjREalZtSW93Q2dZSUtvWkl6ajBFQXdJRFNRQXdSZ0loQUpJcjh1ZUxybCtGUEZmS1RpS012WUJ5VUVoc2hBQkYKWkJJbXlqcUg5NzVuQWlFQXFOT2lrSkVxODJOcnNyTkJWMTNjQ1lEOEFEM1FGNU54RGlobVhmV0V4bmc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
server: https://127.0.0.1:6443 server: https://127.0.0.1:6443
name: default name: default
contexts: contexts:
@ -15,5 +15,5 @@ preferences: {}
users: users:
- name: default - name: default
user: user:
client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJrVENDQV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TjhTRzRuQ3ZISXlWRnNnZjd3OE1lYldvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFUzQ0Uk1HbGFNWHFYN0V1ZGJiYklhdDlnakFpZ1dsNUxNMmZyZERsemNqTjBRZ0VwWkc3bgpQSWVmYTJhSFVGTVJ5RkJCdThMMSsyTmg0WHFxSW1yOGl3PT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo= client-key-data: LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUh1cDZlUTJ5c0JOTzQ3T0ZCQXZPSUkxV09xdnpoRmVwZ3FwTlQ5M05CSTZvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFZWxOYUNJM0dXWFlob25KUlFHWkpxckFyM3V0OGNzNk5DSDRHWDVEdGpiMWhQZXF2OTVMQQo2UEVsaVRDT1ZHdWo1ZkpVNnlEZ011TXIzRGh5b2Q5Zzh3PT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=

View file

@ -30,7 +30,7 @@ provider "helm" {
# 2. Den NGINX-Ingress-Controller installieren (Simuliert den Cloud-Loadbalancer) # 2. Den NGINX-Ingress-Controller installieren (Simuliert den Cloud-Loadbalancer)
resource "helm_release" "nginx_ingress" { resource "helm_release" "nginx_ingress" {
name = "ingress-nginx" name = "ingress-nginx"
repository = "https://github.io" repository = "https://kubernetes.github.io/ingress-nginx"
chart = "ingress-nginx" chart = "ingress-nginx"
namespace = "kube-system" namespace = "kube-system"
@ -71,7 +71,7 @@ resource "kubernetes_deployment" "webapp" {
resource "kubernetes_service" "webapp_service" { resource "kubernetes_service" "webapp_service" {
metadata { name = "webapp-service" } metadata { name = "webapp-service" }
spec { spec {
selector = { app = "kubernetes_deployment.webapp.metadata[0].name" } selector = { app = kubernetes_deployment.webapp.spec[0].template[0].metadata[0].labels.app }
port { port {
port = 80 port = 80
target_port = 80 target_port = 80

107
main.tf.bak Normal file
View file

@ -0,0 +1,107 @@
variable "app_version" {
type = string
default = "latest"
}
terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.26"
}
helm = {
source = "hashicorp/helm"
version = "~> 2.12"
}
}
}
# 1. Verbindung zum lokalen K3s-Container herstellen
provider "kubernetes" {
config_path = "./kind_kubeconfig/config"
}
provider "helm" {
kubernetes {
config_path = "./kind_kubeconfig/config"
}
}
# 2. Den NGINX-Ingress-Controller installieren (Simuliert den Cloud-Loadbalancer)
resource "helm_release" "nginx_ingress" {
name = "ingress-nginx"
repository = "https://github.io"
chart = "ingress-nginx"
namespace = "kube-system"
# Zwingt den Ingress-Controller, auf K3s-Standard-Ports zu lauschen
set {
name = "controller.service.type"
value = "ClusterIP"
}
set {
name = "controller.hostNetwork"
value = "true"
}
}
# 3. Deine Webapp (App 1)
resource "kubernetes_deployment" "webapp" {
metadata {
name = "webapp"
labels = { app = "webapp" }
}
spec {
replicas = 1
selector { match_labels = { app = "webapp" } }
template {
metadata { labels = { app = "webapp" } }
spec {
container {
name = "web"
# Später: forgejo:3000/dein-user/webapp:${var.app_version}
image = "nginx:alpine"
port { container_port = 80 }
}
}
}
}
}
resource "kubernetes_service" "webapp_service" {
metadata { name = "webapp-service" }
spec {
selector = { app = "kubernetes_deployment.webapp.metadata[0].name" }
port {
port = 80
target_port = 80
}
}
}
# 4. Der Ingress-Routing-Eintrag (Das "Produktions-Verhalten")
resource "kubernetes_ingress_v1" "app_ingress" {
depends_on = [helm_release.nginx_ingress]
metadata {
name = "app-ingress"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
}
}
spec {
rule {
http {
path {
path = "/"
path_type = "Prefix"
backend {
service {
name = kubernetes_service.webapp_service.metadata[0].name
port { number = 80 }
}
}
}
}
}
}
}

View file

@ -2,7 +2,11 @@ events { worker_connections 1024; }
http { http {
client_max_body_size 0; client_max_body_size 0;
map "$http_host|$upstream_http_www_authenticate" $registry_www_auth {
"~^registry\.local:3005\|(?<pre>.*realm=\")https?://forgejo:3000(?<post>.*)$"
"${pre}https://registry.local:3005${post}";
default $upstream_http_www_authenticate;
}
# BLOCK 1: HTTPS (Port 443) - Für die Pipeline # BLOCK 1: HTTPS (Port 443) - Für die Pipeline
server { server {
listen 443 ssl; listen 443 ssl;
@ -17,6 +21,8 @@ http {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_hide_header WWW-Authenticate;
add_header WWW-Authenticate $registry_www_auth always;
} }
} }

414
terraform.tfstate Normal file
View file

@ -0,0 +1,414 @@
{
"version": 4,
"terraform_version": "1.9.8",
"serial": 13,
"lineage": "252fb5b6-b03d-ea0e-99be-fd8b89626463",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "helm_release",
"name": "nginx_ingress",
"provider": "provider[\"registry.terraform.io/hashicorp/helm\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"atomic": false,
"chart": "ingress-nginx",
"cleanup_on_fail": false,
"create_namespace": false,
"dependency_update": false,
"description": null,
"devel": null,
"disable_crd_hooks": false,
"disable_openapi_validation": false,
"disable_webhooks": false,
"force_update": false,
"id": "ingress-nginx",
"keyring": null,
"lint": false,
"manifest": null,
"max_history": 0,
"metadata": [
{
"app_version": "1.15.1",
"chart": "ingress-nginx",
"first_deployed": 1794522908,
"last_deployed": 1794522908,
"name": "ingress-nginx",
"namespace": "kube-system",
"notes": "The ingress-nginx controller has been installed.\nGet the application URL by running these commands:\n export POD_NAME=\"$(kubectl get pods --namespace kube-system --selector app.kubernetes.io/name=ingress-nginx,app.kubernetes.io/instance=ingress-nginx,app.kubernetes.io/component=controller --output jsonpath=\"{.items[0].metadata.name}\")\"\n kubectl port-forward --namespace kube-system \"${POD_NAME}\" 8080:80\n echo \"Visit http://127.0.0.1:8080 to access your application.\"\n\nAn example Ingress that makes use of the controller:\n apiVersion: networking.k8s.io/v1\n kind: Ingress\n metadata:\n name: example\n namespace: foo\n spec:\n ingressClassName: nginx\n rules:\n - host: www.example.com\n http:\n paths:\n - pathType: Prefix\n backend:\n service:\n name: exampleService\n port:\n number: 80\n path: /\n # This section is only required if TLS is to be enabled for the Ingress\n tls:\n - hosts:\n - www.example.com\n secretName: example-tls\n\nIf TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:\n\n apiVersion: v1\n kind: Secret\n metadata:\n name: example-tls\n namespace: foo\n data:\n tls.crt: \u003cbase64 encoded cert\u003e\n tls.key: \u003cbase64 encoded key\u003e\n type: kubernetes.io/tls\n",
"revision": 1,
"values": "{\"controller\":{\"hostNetwork\":true,\"service\":{\"type\":\"ClusterIP\"}}}",
"version": "4.15.1"
}
],
"name": "ingress-nginx",
"namespace": "kube-system",
"pass_credentials": false,
"postrender": [],
"recreate_pods": false,
"render_subchart_notes": true,
"replace": false,
"repository": "https://kubernetes.github.io/ingress-nginx",
"repository_ca_file": null,
"repository_cert_file": null,
"repository_key_file": null,
"repository_password": null,
"repository_username": null,
"reset_values": false,
"reuse_values": false,
"set": [
{
"name": "controller.hostNetwork",
"type": "",
"value": "true"
},
{
"name": "controller.service.type",
"type": "",
"value": "ClusterIP"
}
],
"set_list": [],
"set_sensitive": [],
"skip_crds": false,
"status": "deployed",
"timeout": 300,
"upgrade_install": null,
"values": null,
"verify": false,
"version": "4.15.1",
"wait": true,
"wait_for_jobs": false
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "repository_password"
}
]
],
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
},
{
"mode": "managed",
"type": "kubernetes_deployment",
"name": "webapp",
"provider": "provider[\"registry.terraform.io/hashicorp/kubernetes\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "default/webapp",
"metadata": [
{
"annotations": {},
"generate_name": "",
"generation": 1,
"labels": {
"app": "webapp"
},
"name": "webapp",
"namespace": "default",
"resource_version": "25006",
"uid": "5d5fc79f-ed16-4cd6-9acf-f1d8d4e2614e"
}
],
"spec": [
{
"min_ready_seconds": 0,
"paused": false,
"progress_deadline_seconds": 600,
"replicas": "1",
"revision_history_limit": 10,
"selector": [
{
"match_expressions": [],
"match_labels": {
"app": "webapp"
}
}
],
"strategy": [
{
"rolling_update": [
{
"max_surge": "25%",
"max_unavailable": "25%"
}
],
"type": "RollingUpdate"
}
],
"template": [
{
"metadata": [
{
"annotations": {},
"generate_name": "",
"generation": 0,
"labels": {
"app": "webapp"
},
"name": "",
"namespace": "",
"resource_version": "",
"uid": ""
}
],
"spec": [
{
"active_deadline_seconds": 0,
"affinity": [],
"automount_service_account_token": true,
"container": [
{
"args": [],
"command": [],
"env": [],
"env_from": [],
"image": "nginx:alpine",
"image_pull_policy": "IfNotPresent",
"lifecycle": [],
"liveness_probe": [],
"name": "web",
"port": [
{
"container_port": 80,
"host_ip": "",
"host_port": 0,
"name": "",
"protocol": "TCP"
}
],
"readiness_probe": [],
"resources": [
{
"limits": {},
"requests": {}
}
],
"security_context": [],
"startup_probe": [],
"stdin": false,
"stdin_once": false,
"termination_message_path": "/dev/termination-log",
"termination_message_policy": "File",
"tty": false,
"volume_device": [],
"volume_mount": [],
"working_dir": ""
}
],
"dns_config": [],
"dns_policy": "ClusterFirst",
"enable_service_links": true,
"host_aliases": [],
"host_ipc": false,
"host_network": false,
"host_pid": false,
"hostname": "",
"image_pull_secrets": [],
"init_container": [],
"node_name": "",
"node_selector": {},
"os": [],
"priority_class_name": "",
"readiness_gate": [],
"restart_policy": "Always",
"runtime_class_name": "",
"scheduler_name": "default-scheduler",
"security_context": [],
"service_account_name": "",
"share_process_namespace": false,
"subdomain": "",
"termination_grace_period_seconds": 30,
"toleration": [],
"topology_spread_constraint": [],
"volume": []
}
]
}
]
}
],
"timeouts": null,
"wait_for_rollout": true
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9"
}
]
},
{
"mode": "managed",
"type": "kubernetes_ingress_v1",
"name": "app_ingress",
"provider": "provider[\"registry.terraform.io/hashicorp/kubernetes\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "default/app-ingress",
"metadata": [
{
"annotations": {
"kubernetes.io/ingress.class": "nginx"
},
"generate_name": "",
"generation": 1,
"labels": {},
"name": "app-ingress",
"namespace": "default",
"resource_version": "25420",
"uid": "6e5e595a-2954-4977-aaba-74cf1afa90be"
}
],
"spec": [
{
"default_backend": [],
"ingress_class_name": "",
"rule": [
{
"host": "",
"http": [
{
"path": [
{
"backend": [
{
"resource": [],
"service": [
{
"name": "webapp-service",
"port": [
{
"name": "",
"number": 80
}
]
}
]
}
],
"path": "/",
"path_type": "Prefix"
}
]
}
]
}
],
"tls": []
}
],
"status": [
{
"load_balancer": [
{
"ingress": []
}
]
}
],
"timeouts": null,
"wait_for_load_balancer": null
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDB9fQ==",
"dependencies": [
"helm_release.nginx_ingress",
"kubernetes_deployment.webapp",
"kubernetes_service.webapp_service"
]
}
]
},
{
"mode": "managed",
"type": "kubernetes_service",
"name": "webapp_service",
"provider": "provider[\"registry.terraform.io/hashicorp/kubernetes\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "default/webapp-service",
"metadata": [
{
"annotations": {},
"generate_name": "",
"generation": 0,
"labels": {},
"name": "webapp-service",
"namespace": "default",
"resource_version": "25273",
"uid": "2b45b34c-7b27-4bc1-b0bc-970ddc0f0fb6"
}
],
"spec": [
{
"allocate_load_balancer_node_ports": true,
"cluster_ip": "10.43.255.164",
"cluster_ips": [
"10.43.255.164"
],
"external_ips": [],
"external_name": "",
"external_traffic_policy": "",
"health_check_node_port": 0,
"internal_traffic_policy": "Cluster",
"ip_families": [
"IPv4"
],
"ip_family_policy": "SingleStack",
"load_balancer_class": "",
"load_balancer_ip": "",
"load_balancer_source_ranges": [],
"port": [
{
"app_protocol": "",
"name": "",
"node_port": 0,
"port": 80,
"protocol": "TCP",
"target_port": "80"
}
],
"publish_not_ready_addresses": false,
"selector": {
"app": "webapp"
},
"session_affinity": "None",
"session_affinity_config": [],
"type": "ClusterIP"
}
],
"status": [
{
"load_balancer": [
{
"ingress": []
}
]
}
],
"timeouts": null,
"wait_for_load_balancer": true
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
"dependencies": [
"kubernetes_deployment.webapp"
]
}
]
}
],
"check_results": null
}

414
terraform.tfstate.backup Normal file
View file

@ -0,0 +1,414 @@
{
"version": 4,
"terraform_version": "1.9.8",
"serial": 12,
"lineage": "252fb5b6-b03d-ea0e-99be-fd8b89626463",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "helm_release",
"name": "nginx_ingress",
"provider": "provider[\"registry.terraform.io/hashicorp/helm\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"atomic": false,
"chart": "ingress-nginx",
"cleanup_on_fail": false,
"create_namespace": false,
"dependency_update": false,
"description": null,
"devel": null,
"disable_crd_hooks": false,
"disable_openapi_validation": false,
"disable_webhooks": false,
"force_update": false,
"id": "ingress-nginx",
"keyring": null,
"lint": false,
"manifest": null,
"max_history": 0,
"metadata": [
{
"app_version": "1.15.1",
"chart": "ingress-nginx",
"first_deployed": 1794522908,
"last_deployed": 1794522908,
"name": "ingress-nginx",
"namespace": "kube-system",
"notes": "The ingress-nginx controller has been installed.\nGet the application URL by running these commands:\n export POD_NAME=\"$(kubectl get pods --namespace kube-system --selector app.kubernetes.io/name=ingress-nginx,app.kubernetes.io/instance=ingress-nginx,app.kubernetes.io/component=controller --output jsonpath=\"{.items[0].metadata.name}\")\"\n kubectl port-forward --namespace kube-system \"${POD_NAME}\" 8080:80\n echo \"Visit http://127.0.0.1:8080 to access your application.\"\n\nAn example Ingress that makes use of the controller:\n apiVersion: networking.k8s.io/v1\n kind: Ingress\n metadata:\n name: example\n namespace: foo\n spec:\n ingressClassName: nginx\n rules:\n - host: www.example.com\n http:\n paths:\n - pathType: Prefix\n backend:\n service:\n name: exampleService\n port:\n number: 80\n path: /\n # This section is only required if TLS is to be enabled for the Ingress\n tls:\n - hosts:\n - www.example.com\n secretName: example-tls\n\nIf TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:\n\n apiVersion: v1\n kind: Secret\n metadata:\n name: example-tls\n namespace: foo\n data:\n tls.crt: \u003cbase64 encoded cert\u003e\n tls.key: \u003cbase64 encoded key\u003e\n type: kubernetes.io/tls\n",
"revision": 1,
"values": "{\"controller\":{\"hostNetwork\":true,\"service\":{\"type\":\"ClusterIP\"}}}",
"version": "4.15.1"
}
],
"name": "ingress-nginx",
"namespace": "kube-system",
"pass_credentials": false,
"postrender": [],
"recreate_pods": false,
"render_subchart_notes": true,
"replace": false,
"repository": "https://kubernetes.github.io/ingress-nginx",
"repository_ca_file": null,
"repository_cert_file": null,
"repository_key_file": null,
"repository_password": null,
"repository_username": null,
"reset_values": false,
"reuse_values": false,
"set": [
{
"name": "controller.hostNetwork",
"type": "",
"value": "true"
},
{
"name": "controller.service.type",
"type": "",
"value": "ClusterIP"
}
],
"set_list": [],
"set_sensitive": [],
"skip_crds": false,
"status": "deployed",
"timeout": 300,
"upgrade_install": null,
"values": null,
"verify": false,
"version": "4.15.1",
"wait": true,
"wait_for_jobs": false
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "repository_password"
}
]
],
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
},
{
"mode": "managed",
"type": "kubernetes_deployment",
"name": "webapp",
"provider": "provider[\"registry.terraform.io/hashicorp/kubernetes\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "default/webapp",
"metadata": [
{
"annotations": {},
"generate_name": "",
"generation": 1,
"labels": {
"app": "webapp"
},
"name": "webapp",
"namespace": "default",
"resource_version": "25006",
"uid": "5d5fc79f-ed16-4cd6-9acf-f1d8d4e2614e"
}
],
"spec": [
{
"min_ready_seconds": 0,
"paused": false,
"progress_deadline_seconds": 600,
"replicas": "1",
"revision_history_limit": 10,
"selector": [
{
"match_expressions": [],
"match_labels": {
"app": "webapp"
}
}
],
"strategy": [
{
"rolling_update": [
{
"max_surge": "25%",
"max_unavailable": "25%"
}
],
"type": "RollingUpdate"
}
],
"template": [
{
"metadata": [
{
"annotations": {},
"generate_name": "",
"generation": 0,
"labels": {
"app": "webapp"
},
"name": "",
"namespace": "",
"resource_version": "",
"uid": ""
}
],
"spec": [
{
"active_deadline_seconds": 0,
"affinity": [],
"automount_service_account_token": true,
"container": [
{
"args": [],
"command": [],
"env": [],
"env_from": [],
"image": "nginx:alpine",
"image_pull_policy": "IfNotPresent",
"lifecycle": [],
"liveness_probe": [],
"name": "web",
"port": [
{
"container_port": 80,
"host_ip": "",
"host_port": 0,
"name": "",
"protocol": "TCP"
}
],
"readiness_probe": [],
"resources": [
{
"limits": {},
"requests": {}
}
],
"security_context": [],
"startup_probe": [],
"stdin": false,
"stdin_once": false,
"termination_message_path": "/dev/termination-log",
"termination_message_policy": "File",
"tty": false,
"volume_device": [],
"volume_mount": [],
"working_dir": ""
}
],
"dns_config": [],
"dns_policy": "ClusterFirst",
"enable_service_links": true,
"host_aliases": [],
"host_ipc": false,
"host_network": false,
"host_pid": false,
"hostname": "",
"image_pull_secrets": [],
"init_container": [],
"node_name": "",
"node_selector": {},
"os": [],
"priority_class_name": "",
"readiness_gate": [],
"restart_policy": "Always",
"runtime_class_name": "",
"scheduler_name": "default-scheduler",
"security_context": [],
"service_account_name": "",
"share_process_namespace": false,
"subdomain": "",
"termination_grace_period_seconds": 30,
"toleration": [],
"topology_spread_constraint": [],
"volume": []
}
]
}
]
}
],
"timeouts": null,
"wait_for_rollout": true
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9"
}
]
},
{
"mode": "managed",
"type": "kubernetes_ingress_v1",
"name": "app_ingress",
"provider": "provider[\"registry.terraform.io/hashicorp/kubernetes\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "default/app-ingress",
"metadata": [
{
"annotations": {
"kubernetes.io/ingress.class": "nginx"
},
"generate_name": "",
"generation": 1,
"labels": null,
"name": "app-ingress",
"namespace": "default",
"resource_version": "25420",
"uid": "6e5e595a-2954-4977-aaba-74cf1afa90be"
}
],
"spec": [
{
"default_backend": [],
"ingress_class_name": "",
"rule": [
{
"host": "",
"http": [
{
"path": [
{
"backend": [
{
"resource": [],
"service": [
{
"name": "webapp-service",
"port": [
{
"name": "",
"number": 80
}
]
}
]
}
],
"path": "/",
"path_type": "Prefix"
}
]
}
]
}
],
"tls": []
}
],
"status": [
{
"load_balancer": [
{
"ingress": []
}
]
}
],
"timeouts": null,
"wait_for_load_balancer": null
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDB9fQ==",
"dependencies": [
"helm_release.nginx_ingress",
"kubernetes_deployment.webapp",
"kubernetes_service.webapp_service"
]
}
]
},
{
"mode": "managed",
"type": "kubernetes_service",
"name": "webapp_service",
"provider": "provider[\"registry.terraform.io/hashicorp/kubernetes\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "default/webapp-service",
"metadata": [
{
"annotations": null,
"generate_name": "",
"generation": 0,
"labels": null,
"name": "webapp-service",
"namespace": "default",
"resource_version": "25273",
"uid": "2b45b34c-7b27-4bc1-b0bc-970ddc0f0fb6"
}
],
"spec": [
{
"allocate_load_balancer_node_ports": true,
"cluster_ip": "10.43.255.164",
"cluster_ips": [
"10.43.255.164"
],
"external_ips": null,
"external_name": "",
"external_traffic_policy": "",
"health_check_node_port": 0,
"internal_traffic_policy": "Cluster",
"ip_families": [
"IPv4"
],
"ip_family_policy": "SingleStack",
"load_balancer_class": "",
"load_balancer_ip": "",
"load_balancer_source_ranges": null,
"port": [
{
"app_protocol": "",
"name": "",
"node_port": 0,
"port": 80,
"protocol": "TCP",
"target_port": "80"
}
],
"publish_not_ready_addresses": false,
"selector": {
"app": "webapp"
},
"session_affinity": "None",
"session_affinity_config": [],
"type": "ClusterIP"
}
],
"status": [
{
"load_balancer": [
{
"ingress": []
}
]
}
],
"timeouts": null,
"wait_for_load_balancer": true
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
"dependencies": [
"kubernetes_deployment.webapp"
]
}
]
}
],
"check_results": null
}