How to externally check Kubernetes readiness on deployment?

8/26/2019

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?

-- SagiLow
azure-aks
continuous-deployment
deployment
kubernetes

1 Answer

8/26/2019

Using kubernetes namespaces for staging and production is a nice idea.

Another way is to:

  1. Create a staging kubernetes cluster and install the deployment, service and ingress in it.
  2. Test readiness of deployment, service and ingress in the staging cluster from outside the staging cluster.
  3. Move deployment to production cluster if everything is working fine as expected.

  4. 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
    ...
-- Vikram Hosakote
Source: StackOverflow