feat: Add HA Kubernetes cluster with Terraform + Ansible
- 3x CX23 control plane nodes (HA) - 4x CX33 worker nodes - k3s with embedded etcd - Hetzner CCM for load balancers - Gitea CI/CD workflows - Backblaze B2 for Terraform state
This commit is contained in:
49
.gitea/workflows/destroy.yml
Normal file
49
.gitea/workflows/destroy.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Destroy
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
confirm:
|
||||
description: 'Type "destroy" to confirm'
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
env:
|
||||
TF_VERSION: "1.7.0"
|
||||
|
||||
jobs:
|
||||
destroy:
|
||||
name: Destroy Cluster
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.inputs.confirm == 'destroy'
|
||||
environment: destroy
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
terraform_version: ${{ env.TF_VERSION }}
|
||||
|
||||
- name: Terraform Init
|
||||
working-directory: terraform
|
||||
run: |
|
||||
terraform init \
|
||||
-backend-config="endpoint=${{ secrets.S3_ENDPOINT }}" \
|
||||
-backend-config="bucket=${{ secrets.S3_BUCKET }}" \
|
||||
-backend-config="region=auto" \
|
||||
-backend-config="access_key=${{ secrets.S3_ACCESS_KEY }}" \
|
||||
-backend-config="secret_key=${{ secrets.S3_SECRET_KEY }}"
|
||||
|
||||
- name: Terraform Destroy
|
||||
working-directory: terraform
|
||||
run: |
|
||||
terraform destroy \
|
||||
-var="hcloud_token=${{ secrets.HCLOUD_TOKEN }}" \
|
||||
-var="ssh_public_key=${{ secrets.SSH_PUBLIC_KEY }}" \
|
||||
-var="ssh_private_key=${{ secrets.SSH_PRIVATE_KEY }}" \
|
||||
-var="s3_access_key=${{ secrets.S3_ACCESS_KEY }}" \
|
||||
-var="s3_secret_key=${{ secrets.S3_SECRET_KEY }}" \
|
||||
-var="s3_endpoint=${{ secrets.S3_ENDPOINT }}" \
|
||||
-auto-approve
|
||||
Reference in New Issue
Block a user