say.farewell.cloud admin

K8s Learning: Redeploy — Full Teardown and Rebuild

Redeploy: Full Teardown and Rebuild

Script: redeploy.sh · Start from zero

Runs all scripts in sequence — tear down, then rebuild everything from scratch.


The Script

./99_remove_from_vm.sh              # tear down existing cluster
./01_init_vm.sh                     # install k3s fresh
./02_validate_initialization.sh     # verify k3s is running
./03_get_config_to_localhost.sh     # get credentials to your laptop
./04_install_cert_manager.sh        # install cert-manager + ClusterIssuer
./05_build_and_push.sh              # build & transfer Docker image
./06_deploy.sh                      # deploy app with Service + Ingress

When to Use Full Redeploy vs. Partial Update

ScenarioWhat to run
Changed app code05 + 06 only
Changed deploy config06 only
Cluster is brokenredeploy.sh (everything)
Changed k3s versionredeploy.sh (everything)
Moved to a new VMredeploy.sh (everything)
Changed cert-manager config04 + 05 + 06
IP address changed01 (UFW) + 03 (kubeconfig)
⚠️ Note on certificates: Full redeploy destroys TLS secrets, triggering a new cert request. Let's Encrypt rate-limits to 50 certs per domain per week. For routine updates, prefer steps 05 + 06.

Typical Workflows

Day-to-day development

./05_build_and_push.sh    # rebuild with code changes
./06_deploy.sh            # redeploy — cert reused, no downtime

Something went wrong

./redeploy.sh    # nuclear: tear down and rebuild everything
← Back to homepage