Skip to content

tw/commands: add a new functionality or tool to expect a particular Pods to spin up in a certain period #30

Description

@Dentrax

Some Kubernetes Operators spins up Pods after we apply Custom Resource. But it usually took a while during reconciliation and get healthy status. So the Pods don’t exist yet for a certain period.

Example:

wait_for_existence -n foo 'app.kubernetes.io/name=bar' --timeout=5m

This command would execute the followings in order:

  1. Set timeout to N seconds and interval to M seconds
  2. Loop until timeout is reached
  3. Brute-force get pod status with kubectl get pods with selection filter
  4. If no pods exist yet, print waiting message
  5. If pods exist (on matching), check for Running status with kubectl wait
  6. If a match is found, and healthy, print success message and exit
  7. Otherwise, print waiting message
  8. Sleep for the interval and increment elapsed time
  9. timeout is reached, print failure message and exit

cc @joshrwolf

Fun fact: This is the FIRST ISSUE!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions