⏱ Estimated time: 5 minutes
This guide covers cleaning up all resources deployed to your local Minikube cluster.
Before deleting Kubernetes resources, first remove the operator-managed CRDs. The operator creates and manages these resources, so they should be deleted before Helm releases. Make sure you have your ENVIRONMENT variable set (or load it from .env):
if [ -f .env ]; then
source .env
fi
ENVIRONMENT=${ENVIRONMENT:-dev}
RESOURCE_NAME="reference-architecture-${ENVIRONMENT}"Delete operator-managed CRDs:
kubectl delete supergraphs ${RESOURCE_NAME} -n apollo || true
kubectl delete supergraphschemas ${RESOURCE_NAME} -n apollo || true
kubectl delete subgraph --all --all-namespaces || trueThis removes all Subgraph CRDs, including the eight GraphQL subgraphs (checkout, discovery, inventory, orders, products, reviews, shipping, users) and the promotions Connector subgraph (schema-only, no deployment).
Note: The client's Ingress resource is managed by Helm and will be automatically deleted when you uninstall the Helm release in the next step.
Uninstall all Helm releases. This will automatically delete all resources created by Helm, including deployments, services, ConfigMaps, and Ingress resources:
helm uninstall client -n client || true
helm uninstall coprocessor -n apollo || true
for subgraph in checkout discovery inventory orders products reviews shipping users; do
helm uninstall $subgraph -n $subgraph || true
done
for service in promotions-api; do
helm uninstall $service -n $service || true
doneNote: The promotions subgraph is schema-only (Apollo Connector); it has no Helm deployment. Its Subgraph CRD is removed in the previous step when you run kubectl delete subgraph --all --all-namespaces. The promotions-api service is the REST API that the Connector calls and is uninstalled above.
After deleting CRDs and uninstalling Helm releases, delete all application namespaces. This will remove any remaining resources:
kubectl delete namespace checkout discovery inventory orders products reviews shipping users promotions promotions-api || true
kubectl delete namespace client || true
kubectl delete secret apollo-api-key -n apollo-operator || true
helm uninstall apollo-operator -n apollo-operator || true
kubectl delete namespace apollo-operator apollo || trueIf you want to clean up the Apollo GraphOS graph and variants you created:
- Go to Apollo GraphOS Studio
- Navigate to your graph
- Delete the graph or specific variants as needed
Note: The operator API key created during setup will remain in your Apollo GraphOS account. You can delete it from User Settings > API Keys if desired.
If you want to completely remove the Minikube cluster:
minikube stop
minikube deleteOr if you have multiple Minikube profiles and want to delete all:
minikube delete --allIf you want to remove the local Docker images built for this project:
eval $(minikube docker-env)
docker rmi checkout:local discovery:local inventory:local orders:local \
products:local reviews:local shipping:local users:local \
promotions-api:local coprocessor:local client:local || trueIf you want to remove the .env file created during setup:
rm .envNote: This will remove your Apollo GraphOS configuration. You'll need to run 02-setup-apollo-graph.sh again if you want to recreate the graph.