Our goal is to make sure the deployment was successful and the service is available
We already encountered a situation where the Ingress
role was not correctly configured and the API's were down
We thought about deploying to a staging
namespace, do a readiness
call from outside the cluster and if everything checks out, move the deployment to its production namespace if not, delete the staging and declare the deployment as failed.
Is there a better way to handle this scenario?
Using kubernetes namespaces for staging and production is a nice idea.
Another way is to:
Move deployment to production cluster if everything is working fine as expected.
Use kubectl
's config
and context
to switch between staging cluster and production cluster:
apiVersion: v1
kind: Config
preferences: {}
clusters:
- cluster:
name: staging
- cluster:
name: production
...