diff --git a/.taskfiles/TerraformTasks.yml b/.taskfiles/TerraformTasks.yml index 1b944af731..716db0ce3e 100644 --- a/.taskfiles/TerraformTasks.yml +++ b/.taskfiles/TerraformTasks.yml @@ -20,21 +20,3 @@ tasks: dir: terraform/cloudflare cmds: - terraform apply {{.CLI_ARGS}} - - gc:init: - desc: Initialize terraform dependencies - dir: terraform/google-cloud - cmds: - - terraform init {{.CLI_ARGS}} - - gc:plan: - desc: Show the changes terraform will make - dir: terraform/google-cloud - cmds: - - terraform plan {{.CLI_ARGS}} - - gc:apply: - desc: Apply the changes to Google Cloud - dir: terraform/google-cloud - cmds: - - terraform apply {{.CLI_ARGS}} diff --git a/README.md b/README.md index b266d1a166..b767235407 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,6 @@
-[![Cluster](https://status.chestr.dev/api/badge/11/uptime/24?style=for-the-badge&color=blue)](https://status.chestr.dev "Uptime") - -
-
- [![Discord](https://img.shields.io/discord/673534664354430999?style=for-the-badge&label&logo=discord&logoColor=white&color=blue)](https://discord.gg/k8s-at-home) [![k8s](https://img.shields.io/badge/k8s-v1.30.2-blue?style=for-the-badge)](https://kubernetes.io/) [![Talos](https://img.shields.io/badge/Talos-v1.7.4-blue?style=for-the-badge)](https://talos.dev "Talos OS") @@ -65,7 +60,6 @@ This repository is my home Kubernetes cluster in a declarative state. [Flux](htt - [AWS SES](https://aws.amazon.com/ses/) for sending emails. - [Cloudflare](https://cloudflare.com) tunnels for exposing services & creating certificates & managing domains. - [Cloudflare R2](https://www.cloudflare.com/developer-platform/r2/) for daily backups. -- [Google Cloud](https://cloud.google.com) to deploy [uptime-kuma](https://github.com/louislam/uptime-kuma) for external cluster monitoring. - [Pushover](https://pushover.net/) for sending alerts. Total cloud costs yearly is approximately ~$150/year. diff --git a/ansible/playbooks/roles/config.router/tasks/dns.yml b/ansible/playbooks/roles/config.router/tasks/dns.yml index a8c0e1bf6b..62731b7c87 100644 --- a/ansible/playbooks/roles/config.router/tasks/dns.yml +++ b/ansible/playbooks/roles/config.router/tasks/dns.yml @@ -35,7 +35,6 @@ - "{{ prefix }} options enable-tftp" - "{{ prefix }} options tftp-root=/config/user-data/tftproot" - "{{ prefix }} options port=53" - - "{{ prefix }} options server=/status.{{ cluster_domain }}/1.1.1.1" - "{{ prefix }} options server=/{{ cluster_domain }}/192.168.100.111" - "{{ prefix }} options dhcp-match=set:bios,60,PXEClient:Arch:00000" - "{{ prefix }} options dhcp-boot=tag:bios,netboot.xyz.kpxe,,192.168.1.1" diff --git a/ansible/playbooks/roles/uptime-kuma-ping.router/tasks/main.yml b/ansible/playbooks/roles/uptime-kuma-ping.router/tasks/main.yml deleted file mode 100644 index 223ead065a..0000000000 --- a/ansible/playbooks/roles/uptime-kuma-ping.router/tasks/main.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: Create Uptime Kuma directories - ansible.builtin.file: - path: "{{ item }}" - state: directory - mode: 0755 - recurse: true - loop: - - /config/scripts - - /usr/local/etc/uptime-kuma - -- name: Copy Uptime Kuma ping script - ansible.builtin.template: - src: ping.sh.j2 - dest: /config/scripts/ping.sh - mode: 0755 - -- name: Copy Uptime Kuma wg ping script - ansible.builtin.template: - src: wg-ping.sh.j2 - dest: /config/scripts/wg-ping.sh - mode: 0755 - -- name: Configure Uptime Kuma Ping Scheduler - vars: - ansible_network_os: edgeos - ansible_connection: network_cli - block: - - name: Configure task scheduler - community.network.edgeos_config: - save: true - backup: true - lines: - - set system task-scheduler task uptime-kuma interval 1m - - set system task-scheduler task uptime-kuma executable path /config/scripts/ping.sh - - set system task-scheduler task uptime-kuma-wg interval 1m - - set system task-scheduler task uptime-kuma-wg executable path /config/scripts/wg-ping.sh diff --git a/ansible/playbooks/roles/uptime-kuma-ping.router/templates/ping.sh.j2 b/ansible/playbooks/roles/uptime-kuma-ping.router/templates/ping.sh.j2 deleted file mode 100644 index d02bff8e8b..0000000000 --- a/ansible/playbooks/roles/uptime-kuma-ping.router/templates/ping.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -curl --connect-timeout 10 --max-time 30 -I -s -o /dev/null -w '%{http_code}' {{ uptime_kuma_ping_url }} diff --git a/ansible/playbooks/roles/uptime-kuma-ping.router/templates/wg-ping.sh.j2 b/ansible/playbooks/roles/uptime-kuma-ping.router/templates/wg-ping.sh.j2 deleted file mode 100644 index 7e17ff610f..0000000000 --- a/ansible/playbooks/roles/uptime-kuma-ping.router/templates/wg-ping.sh.j2 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/vbash -source /opt/vyatta/etc/functions/script-template - -UP=$(run show interfaces wireguard | grep 'u/u' | wc -l) -if [[ "${UP}" -eq 1 ]]; then - curl --connect-timeout 10 --max-time 30 -I -s -o /dev/null -w '%{http_code}' {{ uptime_kuma_ping_wg_url }} -fi; -exit diff --git a/kubernetes/apps/default/homepage/app/configmap.yaml b/kubernetes/apps/default/homepage/app/configmap.yaml index e050acd484..9154fbc0f3 100644 --- a/kubernetes/apps/default/homepage/app/configmap.yaml +++ b/kubernetes/apps/default/homepage/app/configmap.yaml @@ -111,14 +111,6 @@ data: - PiKVM: href: https://pikvm.chestr.dev icon: pikvm.png - - Monitoring: - - Status: - href: https://status.chestr.dev - icon: uptime-kuma.png - widget: - type: uptimekuma - url: https://status.chestr.dev - slug: chesterlab - System: - Mainsail: href: https://mainsail.chestr.dev diff --git a/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/externalsecret.yaml b/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/externalsecret.yaml deleted file mode 100644 index 4f41bd353c..0000000000 --- a/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/externalsecret.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: &app terraform-google-cloud-vars -spec: - secretStoreRef: - kind: ClusterSecretStore - name: onepassword-connect - target: - name: *app - creationPolicy: Owner - template: - engineVersion: v2 - data: - cloudflare_api_token: "{{ .CLOUDFLARE_TERRAFORM_TOKEN }}" - cloudflared_tunnel_account_id: "{{ .CLOUDFLARE_ACCOUNT_ID }}" - cloudflared_tunnel_secret: "{{ .CLOUDFLARED_UPTIME_KUMA_TUNNEL_SECRET }}" - google_cloud_credentials: "{{ .GOOGLE_CLOUD_CREDENTIALS }}" - project_id: "{{ .GOOGLE_PROJECT_ID }}" - dataFrom: - - extract: - key: google-cloud - - extract: - key: cloudflare diff --git a/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/kustomization.yaml b/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/kustomization.yaml deleted file mode 100644 index c519e35cb0..0000000000 --- a/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - externalsecret.yaml - - terraform.yaml diff --git a/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/terraform.yaml b/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/terraform.yaml deleted file mode 100644 index 9c9eac5b4d..0000000000 --- a/kubernetes/apps/flux-system/tf-controller/terraforms/google-cloud/terraform.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: OCIRepository -metadata: - name: terraform-google-cloud-oci -spec: - interval: 30m - url: oci://ghcr.io/mchestr/terraform-google-cloud-oci - ref: - tag: main ---- -apiVersion: infra.contrib.fluxcd.io/v1alpha1 -kind: Terraform -metadata: - name: terraform-google-cloud -spec: - approvePlan: auto - interval: 12h - path: ./ - sourceRef: - kind: OCIRepository - name: terraform-google-cloud-oci - namespace: flux-system - backendConfig: - disable: true - cliConfigSecretRef: - name: tfe-cli-config - varsFrom: - - kind: Secret - name: terraform-google-cloud-vars - writeOutputsToSecret: - name: terraform-google-cloud-outputs diff --git a/kubernetes/apps/flux-system/tf-controller/terraforms/kustomization.yaml b/kubernetes/apps/flux-system/tf-controller/terraforms/kustomization.yaml index db58ecb6d4..259de4c52c 100644 --- a/kubernetes/apps/flux-system/tf-controller/terraforms/kustomization.yaml +++ b/kubernetes/apps/flux-system/tf-controller/terraforms/kustomization.yaml @@ -3,4 +3,3 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - cloudflare - - google-cloud diff --git a/kubernetes/apps/monitoring/gatus/app/config/config.yaml b/kubernetes/apps/monitoring/gatus/app/config/config.yaml index 6aa3168239..51a3cc8574 100644 --- a/kubernetes/apps/monitoring/gatus/app/config/config.yaml +++ b/kubernetes/apps/monitoring/gatus/app/config/config.yaml @@ -31,14 +31,4 @@ alerting: failure-threshold: 3 success-threshold: 3 -endpoints: - - name: status - group: external - url: https://status.chestr.dev - interval: 10m - client: - dns-resolver: tcp://1.1.1.1:53 - conditions: - - "[STATUS] == 200" - alerts: - - type: pushover +endpoints: [] diff --git a/kubernetes/apps/monitoring/gatus/app/endpoints/certificates.yaml b/kubernetes/apps/monitoring/gatus/app/endpoints/certificates.yaml index 1a77a243f6..8c08193b5a 100644 --- a/kubernetes/apps/monitoring/gatus/app/endpoints/certificates.yaml +++ b/kubernetes/apps/monitoring/gatus/app/endpoints/certificates.yaml @@ -8,18 +8,6 @@ metadata: data: config.yaml: | endpoints: - - name: status.chestr.dev - group: certificates - url: "tls://status.chestr.dev:443" - interval: 24h - client: - dns-resolver: tcp://1.1.1.1:53 - conditions: - - "[CONNECTED] == true" - - "[CERTIFICATE_EXPIRATION] > 336h" - alerts: - - type: pushover - - name: lochnas.chestr.dev group: certificates url: "tls://lochnas.chestr.dev:443" diff --git a/kubernetes/apps/monitoring/kube-prometheus-stack/app/helmrelease.yaml b/kubernetes/apps/monitoring/kube-prometheus-stack/app/helmrelease.yaml index a57f069bd6..8e3657b437 100644 --- a/kubernetes/apps/monitoring/kube-prometheus-stack/app/helmrelease.yaml +++ b/kubernetes/apps/monitoring/kube-prometheus-stack/app/helmrelease.yaml @@ -56,16 +56,6 @@ spec: replicas: 2 useExistingSecret: true configSecret: alertmanager-secret - containers: - - name: uptime-kuma-proxy - image: ghcr.io/mchestr/alertmanager-uptime-kuma-proxy:v0.1.6 - env: - - name: UPTIME_KUMA_BASE_URL - value: https://status.chestr.dev - ports: - - containerPort: 3000 - name: proxy - protocol: TCP storage: volumeClaimTemplate: spec: diff --git a/kubernetes/apps/monitoring/kube-prometheus-stack/app/resources/alertmanager.yaml b/kubernetes/apps/monitoring/kube-prometheus-stack/app/resources/alertmanager.yaml index 2ec63f95d7..7d58b25110 100644 --- a/kubernetes/apps/monitoring/kube-prometheus-stack/app/resources/alertmanager.yaml +++ b/kubernetes/apps/monitoring/kube-prometheus-stack/app/resources/alertmanager.yaml @@ -28,10 +28,6 @@ inhibit_rules: target_matchers: - severity = "warning" receivers: - - name: heartbeat - webhook_configs: - - url: http://localhost:3000/api/push/{{ .UPTIME_KUMA_ALERTMANAGER_TOKEN }}?status=up&msg=OK - send_resolved: true - name: "null" - name: pushover pushover_configs: diff --git a/terraform/google-cloud/.terraform.lock.hcl b/terraform/google-cloud/.terraform.lock.hcl deleted file mode 100644 index 49803eee96..0000000000 --- a/terraform/google-cloud/.terraform.lock.hcl +++ /dev/null @@ -1,97 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/cloudflare/cloudflare" { - version = "4.37.0" - constraints = "4.37.0" - hashes = [ - "h1:0gOI8arnh2CTcHfGH8iwAe6qz2BRSytmbOiNXZjnrHc=", - "h1:0h0qRJYPHL92Dx3NYZO2WJ21cxyZGEoldzw9aYhPnew=", - "h1:6ri7vZ1MLtQbooicIO4catyIuRq4LHAsIcgd3vGq3AE=", - "h1:7BwVaqxSD9VsmLzs6jDJBJvHPq0dz4I8rCeJAK63Dc4=", - "h1:8tVm+BJvzI14pRbEyt00AvH6oIyqiLRZQ9KxcBeSDhE=", - "h1:FTll1M9rPA7RxEyLB6etQqaqynWWl3WkiwJtHMjPr3Y=", - "h1:L7ysGftn0fstXMjCt3/XEz2giRdEwBsGrdvi4Zw8uzM=", - "h1:PsbAKy7LdSpwZMJZ7bO3lI04hLDTlXke/LCkrKXYwwE=", - "h1:Sjkpr8CKs0rXGcdis5q4Kbqmo5mmosgirnQi65G4sM8=", - "h1:YxJRQdVSzMZR5Ce5M3Gs1SPutXpednxuRwtSSiReHDY=", - "h1:bJrJeBKWEwt4hGQ+3VJR69dsqHORovE8LzuQt9+NTug=", - "h1:hPC7Vk0ZGXCDJ1y5dOepVo1c0PoUulnJUarrMv4gQIQ=", - "h1:joMURZCLUJ2eSlj645xqHWKYbRBYqvajCkhaz7qzi8g=", - "h1:uqo0WgG5lCcG8+gf99VnsKKbJMM1urNZq1FbAT6u3S0=", - "zh:012a6c3e8bf4aca0ebe0884e15bd42fd018659193f2159d5d2bf9948a9be1bc4", - "zh:079666c0a079237af46ed19ffc4143655ee0e8920a274868e44fbc3db88f346d", - "zh:08e7ff86f6848f3109d59ad46f8c0987178eff2f70c8ef03f2d44ae68e42dfb3", - "zh:1ce8a499fdf8f484f7d18ec91566bc0759b07d0ca710990cd60d32b222e416b1", - "zh:348e72338095bffccf7c46c7e6b9d0e063a22d9ae761061b0b31dea1aad22cd9", - "zh:47d39343dea1ef469a2c8e51c8d5993687af427a132da5379796fec27acb5710", - "zh:4cdf8e9579f9af3c72270088fc6e22208f0f91fd4382bc4a860d16040c86917b", - "zh:4fbebb21ecebc7e5ac0ea9e341c5dbea3094fc0579e4dc5b40bfe693164e022e", - "zh:778578dda7dd98576a3fe228132c8b60f646f4cf113638c94f1c40e2b11c027c", - "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", - "zh:894071f0f42571f820918d1a4316704923e29c5b2392704c1cbd063a04a641b8", - "zh:8d11dd73dd499c74d89f77a7e1b3d4a077ac88b0c9c3412e9a6a1b4efe17d107", - "zh:991e088be8381a73872cd33bb659e9dd69d7ab1f1f8d89b3cd17ffe59dffc65f", - "zh:9c0848b9c7e6799c9ffcf3afa70ad94a027f3e15a94679d56790714de0b072c5", - "zh:ad71ae800065ffc24b94d994250136ae8a9f6da704cf91b0dc9e14989e947369", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.85.0" - constraints = ">= 3.53.0, 4.85.0, < 5.0.0" - hashes = [ - "h1:0RHTkvKVPQ5NL0cZ/gJ+cajz6jVNY9wrcI4CgWzQl3o=", - "h1:7uhNGiN9+AJQaijNTDFJLpEEsy90p4uN5mPI8nSk6Xo=", - "h1:C6WqIyBVd7OlNCQjsNfMUzcLRFqfvjxzyQVTrnCXuGY=", - "h1:OVJ7KHmd+XnpxTIRwqwXKasUha9q1rxnq6m5iiETmTM=", - "h1:VvRE6mQoDFuVzc3J64Mnytgv7LbiJZjhxCtQLbVzPkY=", - "h1:WhyJqOtXR4Aa7QZfu5ugaMxXZx9TGo8ikFYzIW2Xo9Q=", - "h1:ZVDZuhYSIWhCkSuDkwFeSIJjn0/DcCxak2W/cHW4OQQ=", - "h1:aSRZcEKF2wOi/v24IA+k9J2Y7aKVV1cHi/R0V3EhxXQ=", - "h1:m7kuhL7My3RmiPOwTZzKLkO7vYREWILtWy8xUIy4Erw=", - "h1:sld/eTvevl/Af3upWX1TesnLLCCUMBQlczxo5lPzA48=", - "h1:ttfGvbBrugSAftA+ei22MUjXn5xj0O8HOhor44XlHXc=", - "zh:17d60a6a6c1741cf1e09ac6731433a30950285eac88236e623ab4cbf23832ca3", - "zh:1c70254c016439dbb75cab646b4beace6ceeff117c75d81f2cc27d41c312f752", - "zh:35e2aa2cc7ac84ce55e05bb4de7b461b169d3582e56d3262e249ff09d64fe008", - "zh:417afb08d7b2744429f6b76806f4134d62b0354acf98e8a6c00de3c24f2bb6ad", - "zh:622165d09d21d9a922c86f1fc7177a400507f2a8c4a4513114407ae04da2dd29", - "zh:7cdb8e39a8ea0939558d87d2cb6caceded9e21f21003d9e9f9ce648d5db0bc3a", - "zh:851e737dc551d6004a860a8907fda65118fc2c7ede9fa828f7be704a2a39e68f", - "zh:a331ad289a02a2c4473572a573dc389be0a604cdd9e03dd8dbc10297fb14f14d", - "zh:b67fd531251380decd8dd1f849460d60f329f89df3d15f5815849a1dd001f430", - "zh:be8785957acca4f97aa3e800b313b57d1fca07788761c8867c9bc701fbe0bdb5", - "zh:cb6579a259fe020e1f88217d8f6937b2d5ace15b6406370977a1966eb31b1ca5", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.6.2" - hashes = [ - "h1:5lstwe/L8AZS/CP0lil2nPvmbbjAu8kCaU/ogSGNbxk=", - "h1:Gd3WitYIzSYo/Suo+PMxpZpIGpRPrwl0JU0+DhxycFM=", - "h1:J9EOvuE7qCS/S0lqMX6DNqsh/wq2uhwxE2bOpSn0/hc=", - "h1:R5qdQjKzOU16TziCN1vR3Exr/B+8WGK80glLTT4ZCPk=", - "h1:UQlmHGddu39vVzG8kruMsde4GHlG+1S7OLqFApbJvtc=", - "h1:VYBb5/CQ1tPhV92eUsfxSZ4Ta2OCfNggYwE+Qo+yCD0=", - "h1:VavG5unYCa3SYISMKF9pzc3718M0bhPlcbUZZGl7wuo=", - "h1:jke+2u84Hrc7szJKevP1BKFn1o3pfxYhYtity2RPCS8=", - "h1:m/7/S7a6RzGgeRAJJCsDza2kbaNmFpQDDd849RxD2FE=", - "h1:uOP0uuF8PKF98YlLqgtjdHBELJLI4BMOOHYXQMYhdlI=", - "h1:wmG0QFjQ2OfyPy6BB7mQ57WtoZZGGV07uAPQeDmIrAE=", - "zh:0ef01a4f81147b32c1bea3429974d4d104bbc4be2ba3cfa667031a8183ef88ec", - "zh:1bcd2d8161e89e39886119965ef0f37fcce2da9c1aca34263dd3002ba05fcb53", - "zh:37c75d15e9514556a5f4ed02e1548aaa95c0ecd6ff9af1119ac905144c70c114", - "zh:4210550a767226976bc7e57d988b9ce48f4411fa8a60cd74a6b246baf7589dad", - "zh:562007382520cd4baa7320f35e1370ffe84e46ed4e2071fdc7e4b1a9b1f8ae9b", - "zh:5efb9da90f665e43f22c2e13e0ce48e86cae2d960aaf1abf721b497f32025916", - "zh:6f71257a6b1218d02a573fc9bff0657410404fb2ef23bc66ae8cd968f98d5ff6", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:9647e18f221380a85f2f0ab387c68fdafd58af6193a932417299cdcae4710150", - "zh:bb6297ce412c3c2fa9fec726114e5e0508dd2638cad6a0cb433194930c97a544", - "zh:f83e925ed73ff8a5ef6e3608ad9225baa5376446349572c2449c0c0b3cf184b7", - "zh:fbef0781cb64de76b1df1ca11078aecba7800d82fd4a956302734999cfd9a4af", - ] -} diff --git a/terraform/google-cloud/compute.tf b/terraform/google-cloud/compute.tf deleted file mode 100644 index c3020e8623..0000000000 --- a/terraform/google-cloud/compute.tf +++ /dev/null @@ -1,91 +0,0 @@ -locals { - envs = [ - { - name = "UPTIME_KUMA_CLOUDFLARED_TOKEN" - value = cloudflare_tunnel.uptime-kuma.tunnel_token - } - ] - - config_sha = sha1("${join("", local.envs.*.value)}-${local.image}") - image = "ghcr.io/mchestr/uptime-kuma:${var.tag}" - zone = var.zone -} - -module "uptime-kuma" { - source = "terraform-google-modules/container-vm/google" - version = "3.1.1" - - container = { - image = local.image - env = local.envs - volumeMounts = [{ - mountPath = "/app/data" - name = "data-disk-0" - readOnly = false - }] - } - - volumes = [{ - name = "data-disk-0" - gcePersistentDisk = { - pdName = "data-disk-0" - fsType = "ext4" - } - }] - - restart_policy = "Always" -} - -resource "google_service_account" "default" { - account_id = "uptimekuma-sa" - display_name = "Service Account" -} - -resource "google_compute_disk" "pd" { - project = var.project_id - name = "uptime-kuma-data-disk" - zone = local.zone - size = 10 -} - -resource "google_compute_instance" "uptime-kuma" { - project = var.project_id - name = "uptime-kuma" - machine_type = "e2-micro" - zone = local.zone - description = local.config_sha - - boot_disk { - initialize_params { - image = module.uptime-kuma.source_image - } - } - - attached_disk { - source = google_compute_disk.pd.self_link - device_name = "data-disk-0" - mode = "READ_WRITE" - } - - network_interface { - network = "default" - access_config {} - } - - metadata = { - gce-container-declaration = module.uptime-kuma.metadata_value - google-logging-enabled = "true" - google-monitoring-enabled = "true" - } - - labels = { - container-vm = module.uptime-kuma.vm_container_label - } - - service_account { - email = google_service_account.default.email - scopes = [ - "https://www.googleapis.com/auth/cloud-platform", - ] - } -} diff --git a/terraform/google-cloud/main.tf b/terraform/google-cloud/main.tf deleted file mode 100644 index 3a530842d3..0000000000 --- a/terraform/google-cloud/main.tf +++ /dev/null @@ -1,39 +0,0 @@ -terraform { - - required_version = ">= 1.3.0" - cloud { - hostname = "app.terraform.io" - organization = "mchestr" - - workspaces { - name = "home-google-cloud" - } - } - - required_providers { - google = { - source = "hashicorp/google" - version = "4.85.0" - } - cloudflare = { - source = "cloudflare/cloudflare" - version = "4.37.0" - } - random = { - source = "hashicorp/random" - version = "3.6.2" - } - } - -} - -provider "google" { - project = var.project_id - region = var.region - zone = var.zone - credentials = var.google_cloud_credentials -} - -provider "cloudflare" { - api_token = var.cloudflare_api_token -} diff --git a/terraform/google-cloud/tunnel.tf b/terraform/google-cloud/tunnel.tf deleted file mode 100644 index 34199b51e7..0000000000 --- a/terraform/google-cloud/tunnel.tf +++ /dev/null @@ -1,37 +0,0 @@ -resource "cloudflare_tunnel" "uptime-kuma" { - account_id = var.cloudflared_tunnel_account_id - name = "uptime-kuma" - secret = var.cloudflared_tunnel_secret -} - -resource "cloudflare_tunnel_config" "uptime-kuma-config" { - account_id = var.cloudflared_tunnel_account_id - tunnel_id = cloudflare_tunnel.uptime-kuma.id - - config { - origin_request { - connect_timeout = "1m0s" - tls_timeout = "1m0s" - tcp_keep_alive = "1m0s" - no_happy_eyeballs = false - keep_alive_connections = 1024 - keep_alive_timeout = "1m0s" - origin_server_name = "${var.subdomain}.${var.domain}" - } - ingress_rule { - service = "http://localhost:3001" - } - } -} - -data "cloudflare_zone" "domain" { - name = var.domain -} - -resource "cloudflare_record" "status" { - zone_id = data.cloudflare_zone.domain.id - name = var.subdomain - value = "${cloudflare_tunnel.uptime-kuma.id}.cfargotunnel.com" - type = "CNAME" - proxied = true -} diff --git a/terraform/google-cloud/variables.tf b/terraform/google-cloud/variables.tf deleted file mode 100644 index d19c19bfcf..0000000000 --- a/terraform/google-cloud/variables.tf +++ /dev/null @@ -1,46 +0,0 @@ -variable "project_id" { - type = string - description = "Google Project ID" -} -variable "cloudflare_api_token" { - type = string - description = "Cloudflare Account API Token" -} -variable "google_cloud_credentials" { - type = string - description = "Google Cloud Credentials in JSON string format" -} -variable "cloudflared_tunnel_account_id" { - type = string - description = "Cloudflared Tunnel Account ID" -} -variable "cloudflared_tunnel_secret" { - type = string - description = "Cloudflared Tunnel Secret" -} -variable "domain" { - type = string - description = "Domain name" - default = "chestr.dev" -} -variable "subdomain" { - type = string - description = "Subdomain of dashboard" - default = "status" -} -variable "tag" { - type = string - description = "Uptime Kuma Tag" - # renovate: datasource=github-releases depName=louislam/uptime-kuma - default = "1.23.13" -} -variable "zone" { - type = string - description = "GCloud Zone" - default = "us-west1-b" -} -variable "region" { - type = string - description = "GCloud region" - default = "us-west1" -}