Waits for Kubernetes workloads to become ready with automatic Argo Rollout delegation.
- β³ Universal workload support - Deployments, StatefulSets, DaemonSets, and Rollouts
- π Automatic Rollout delegation - Seamlessly handles Argo Rollouts via
wait-for-rollout - π Batch processing - Wait for multiple workloads from kustomize-inspect output
- π― Smart namespace handling - Automatic namespace resolution
- π Status reporting - Detailed workload status after waiting
- name: Wait for deployments
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: production
workloads_json: '[{"kind":"Deployment","name":"api"},{"kind":"StatefulSet","name":"db"}]'
timeout: 5m| Input | Description | Required | Default |
|---|---|---|---|
namespace |
Default namespace for workloads | β | - |
workloads_json |
JSON array of workloads: [{kind,name,namespace?}] |
β | - |
timeout |
Wait timeout (e.g., 300s, 5m) | β | 300s |
show_status |
Show kubectl status after waiting | β | true |
verify_only |
Pass-through for Rollout verification | β | false |
wait_for_deployment_id |
Wait for deployment-id annotation before checking rollout status |
β | false |
expected_deployment_id |
Expected deployment-id annotation value |
β | github.run_id |
annotation_timeout |
Timeout for annotation wait (e.g., 300s, 5m) | β | 300s |
- Deployment - Standard Kubernetes deployments
- StatefulSet - Stateful applications
- DaemonSet - Node-level workloads
- Rollout - Argo Rollouts (delegated to
wait-for-rollout@v1)
- name: Deploy and wait
run: kubectl apply -f manifests/
- name: Wait for deployment
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: production
workloads_json: '[{"kind":"Deployment","name":"frontend"}]'- name: Wait for all services
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: default
workloads_json: |
[
{"kind":"Deployment","name":"api"},
{"kind":"Deployment","name":"worker"},
{"kind":"StatefulSet","name":"database"}
]
timeout: 10m- name: Inspect manifests
id: inspect
uses: skyhook-io/kustomize-inspect@v1
with:
overlay_path: overlays/production
- name: Wait for workloads
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: production
workloads_json: ${{ steps.inspect.outputs.workloads }}- name: Wait for mixed workloads
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: production
workloads_json: |
[
{"kind":"Deployment","name":"frontend"},
{"kind":"Rollout","name":"api"},
{"kind":"StatefulSet","name":"cache"}
]- name: Wait across namespaces
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: default # Fallback for workloads without namespace
workloads_json: |
[
{"kind":"Deployment","name":"api","namespace":"backend"},
{"kind":"Deployment","name":"web","namespace":"frontend"},
{"kind":"StatefulSet","name":"db"}
]When deploying via ArgoCD (or other async GitOps tools), the workload may not be updated immediately after triggering a sync. Use wait_for_deployment_id to wait for the correct version before checking rollout status:
- name: Trigger ArgoCD sync
run: argocd app sync my-app --async
- name: Wait for deployment
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: production
workloads_json: ${{ steps.inspect.outputs.workloads }}
wait_for_deployment_id: 'true' # Waits for deployment-id annotation
# expected_deployment_id defaults to github.run_idThis requires your manifests to include a deployment-id annotation (typically set via kustomize):
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment-id: "12345678" # Set to github.run_id
spec:
template:
metadata:
annotations:
deployment-id: "12345678" # Also on pod template- Parses workload list - Processes the JSON array of workloads
- Separates by type - Identifies standard K8s workloads vs Argo Rollouts
- Waits for annotation (if enabled) - Polls until
deployment-idannotation matches expected value - Delegates Rollouts - Automatically uses
wait-for-rollout@v1for Rollout resources - Waits for standard workloads - Uses
kubectl rollout statusfor Deployments, StatefulSets, DaemonSets - Reports status - Shows final status for all workloads
When a Rollout is detected in the workload list:
- Automatically delegates to
skyhook-io/wait-for-rollout@v1 - Passes through timeout and verify_only parameters
- Supports only one Rollout per action invocation (use matrix for multiple)
The action will fail if:
- Any Deployment fails to become ready
- Timeout is exceeded
- Multiple Rollouts are provided (use matrix strategy instead)
- kubectl connection fails
Note: StatefulSet and DaemonSet failures are non-blocking by default.
jobs:
deploy:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup kubectl
uses: skyhook-io/cloud-login@v1
with:
provider: aws
region: us-east-1
cluster: production
- name: Build manifests
id: build
run: |
kustomize build overlays/production > manifests.yaml
kubectl apply -f manifests.yaml
- name: Get workloads
id: inspect
uses: skyhook-io/kustomize-inspect@v1
with:
overlay_path: overlays/production
- name: Wait for all workloads
uses: skyhook-io/wait-for-deployment@v1
with:
namespace: production
workloads_json: ${{ steps.inspect.outputs.workloads }}
timeout: 10m
- name: Run tests
if: success()
run: ./scripts/smoke-test.sh- Kubernetes cluster access (configured kubectl)
- For Rollouts: Argo Rollouts installed in cluster
- Appropriate RBAC permissions
- Requires kubectl context to be configured
- Use with
cloud-loginaction for authentication - For multiple Rollouts, use matrix strategy or sequential calls
- Timeout applies to each workload wait operation