Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premature Kubectl Wait Return For Composite Resource Readiness #82

Open
humoflife opened this issue Jan 26, 2024 · 2 comments
Open

Premature Kubectl Wait Return For Composite Resource Readiness #82

humoflife opened this issue Jan 26, 2024 · 2 comments

Comments

@humoflife
Copy link

When waiting for a composite resource to assume the Ready state, kubectl wait may return prematurely. This could imply that the Ready state is briefly set and then revoked.

Example:
kubectl-v1.27.3 wait vault.sec.upbound.io configuration-vault --for=condition=Ready --timeout 5m

After kubectl wait returned, crossplane beta trace vault.sec.upbound.io configuration-vault shows that the resource is not yet ready.

NAME                                                                       SYNCED   READY   STATUS
Vault/configuration-vault (default)                                        True     False   Waiting: ...resource claim is waiting for composite resource to become Ready
└─ XVault/configuration-vault-mhtj5                                        True     False   Creating: Unready resources: xVaultAuth, xVaultPolicies, and xVaultSecrets
   ├─ XAuth/configuration-vault-mhtj5-g2cbg                                True     False   Creating: Unready resources: generic-endpoint, userpass-auth-backend
   │  ├─ Backend/configuration-vault-auth-backend-userpass                 True     True    Available
   │  └─ Endpoint/configuration-vault-auth-generic-endpoint                True     False   Creating
@humoflife humoflife changed the title Premature Composite Resource Readiness Premature Kubectl Wait Return For Composite Resource Readiness Jan 26, 2024
@humoflife
Copy link
Author

humoflife commented Jan 26, 2024

Below we can see how the condition was reported as met by kubectl wait and then Ready state was false when queried 3 seconds later with kubectl get.

vault.sec.upbound.io/configuration-vault created
s="False"; \
        while [ ${s} != "True" ] ; do \
	    /Users/markuss/upbound/dev/go/src/github.com/upbound/configuration-vault/.cache/tools/darwin_arm64/kubectl-v1.27.3 wait vault.sec.upbound.io configuration-vault --for=condition=Ready --timeout 20m ; \
	    sleep 3 ; \
	    s=`/Users/markuss/upbound/dev/go/src/github.com/upbound/configuration-vault/.cache/tools/darwin_arm64/kubectl-v1.27.3 get vault.sec.upbound.io configuration-vault -o jsonpath='{.status.conditions[1].status}'|awk '{print }'`; \
	    echo $s ; \
        done; \
        true
vault.sec.upbound.io/configuration-vault condition met
False

Note that an immediate kubectl get after the kubectl wait shows Ready state is True as seen below. And consecutively False when running a crossplane beta trace after it.

vault.sec.upbound.io/configuration-vault created
s="False"; \
        while [ ${s} != "True" ] ; do \
	    /Users/markuss/upbound/dev/go/src/github.com/upbound/configuration-vault/.cache/tools/darwin_arm64/kubectl-v1.27.3 wait vault.sec.upbound.io configuration-vault --for=condition=Ready --timeout 20m ; \
	    s=`/Users/markuss/upbound/dev/go/src/github.com/upbound/configuration-vault/.cache/tools/darwin_arm64/kubectl-v1.27.3 get vault.sec.upbound.io configuration-vault -o jsonpath='{.status.conditions[1].status}'|awk '{print }'`; \
	    echo $s ; \
        done; \
        true
vault.sec.upbound.io/configuration-vault condition met
True
crossplane beta trace vault.sec.upbound.io configuration-vault
NAME                                                                       SYNCED   READY   STATUS
Vault/configuration-vault (default)                                        True     False   Waiting: ...resource claim is waiting for composite resource to become Ready
...

@negz
Copy link
Member

negz commented Jan 27, 2024

Did you mean to open this issue against this specific function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants