You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Justfile contains several recipes for managing Kubernetes clusters using Kops:
cluster-setup : Sets up a Kubernetes cluster with Kops version v1.27.1. This recipe includes steps to install Kops, create and validate the cluster, and run the workload recipe.
workload : This recipe is currently a work-in-progress. It creates a Kubernetes Deployment, a Secret, and a ConfigMap. An external request to validate the workload is pending.
cleanup : Deletes the resources created by the workload recipe.
upgrade : Upgrades Kops to higher versions incrementally. For each version, it updates and validates the cluster, then runs the workload and cleanup recipes.
How to Use
To set up a cluster, run just cluster-setup. To upgrade your cluster, run just upgrade.
Known Issues
While upgrading Kops from v1.27.1 to v1.28.7 works without issues, upgrading to v1.29.0 has known problems which are still under diagnosis. I will detail what I know about the issue in a following comment.
For a more detailed and technical explanation, refer to the Justfile code below:
# Justfileset shell := ["zsh", "-cu"]
cluster-setup:
@echo "Setting up cluster"
asdf install kops v1.27.1
asdf local kops v1.27.1
if kops get cluster;then \
kops delete cluster --yes; \
fi; \
kops create cluster --zones us-central1-a --yes
kops export kubeconfig --admin
kops validate cluster --wait 10m
just workload
workload:
@echo "Running workload..."if! kubectl apply -f ../configmaps/dictycr-configuration.yml 2>>{{LOG_FILE}};then \
echo"Error encountered while running workload"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kubectl apply -f ../secrets/dictycr-secret-dev.yml 2>>{{LOG_FILE}};then \
echo"Error encountered while running workload"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kubectl apply -f ../deployments/stockcenter-api-server.yml 2>>{{LOG_FILE}};then \
echo"Error encountered while running workload"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
cleanup:
@echo "Running clean up..."if! kubectl delete configmap dictycr-configuration 2>>{{LOG_FILE}};then \
echo"Error encountered while running workload"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kubectl delete secret dictycr-secret-dev 2>>{{LOG_FILE}};then \
echo"Error encountered while running workload"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kubectl delete deployment stockcenter-api-server 2>>{{LOG_FILE}};then \
echo"Error encountered while running workload"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
# Define the path to the versions file
LOG_FILE := "kops_upgrade_log.txt"
VERSIONS := "v1.27.2 v1.27.3 v1.28.0 v1.28.1 v1.28.2 v1.28.3 v1.28.4 v1.28.5 v1.28.7 v1.29.0 v1.29.2"# Load the versions into a variable# Task to upgrade kops versions
upgrade:
@echo "Starting kops upgrade process..."
@rm -f {{LOG_FILE}}
@echo "Log file wiped"
@for version in {{VERSIONS}};do \
echo"Upgrading to kops version $version..."| tee -a {{LOG_FILE}}; \
if! asdf install kops $version2>>{{LOG_FILE}};then \
echo"Error encountered during kops version $version installation"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! asdf local kops $version2>>{{LOG_FILE}};then \
echo"Error encountered using kops version $version"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kops update cluster --yes 2>>{{LOG_FILE}};then \
echo"Error encountered during kops update with version $version"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kops export kubeconfig --admin 2>>{{LOG_FILE}};then \
echo"Error encountered during kubeconfig export with version $version"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
if! kops validate cluster --wait 10m 2>>{{LOG_FILE}};then \
echo"Error encountered during cluster validation with version $version"| tee -a {{LOG_FILE}}; \
exit 1; \
fi; \
just workload; \
just cleanup; \
echo"Successfully upgraded to kops version $version"| tee -a {{LOG_FILE}}; \
done
@echo "Kops upgrade process completed."| tee -a {{LOG_FILE}}
The text was updated successfully, but these errors were encountered:
Justfile Recipes for Cluster Operations
This Justfile contains several recipes for managing Kubernetes clusters using Kops:
cluster-setup
: Sets up a Kubernetes cluster with Kops version v1.27.1. This recipe includes steps to install Kops, create and validate the cluster, and run theworkload
recipe.workload
: This recipe is currently a work-in-progress. It creates a Kubernetes Deployment, a Secret, and a ConfigMap. An external request to validate the workload is pending.cleanup
: Deletes the resources created by theworkload
recipe.upgrade
: Upgrades Kops to higher versions incrementally. For each version, it updates and validates the cluster, then runs theworkload
andcleanup
recipes.How to Use
To set up a cluster, run
just cluster-setup
. To upgrade your cluster, runjust upgrade
.Known Issues
While upgrading Kops from v1.27.1 to v1.28.7 works without issues, upgrading to v1.29.0 has known problems which are still under diagnosis. I will detail what I know about the issue in a following comment.
For a more detailed and technical explanation, refer to the Justfile code below:
The text was updated successfully, but these errors were encountered: