-
Notifications
You must be signed in to change notification settings - Fork 6
feat: show NodePool status in kubectl output #78
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -406,6 +406,12 @@ Responsibilities: | |
| - compute `status.placed` from Bound NodeClaims per provider; | ||
| - watch NodeClaims so placement counts update as instances come and go. | ||
|
|
||
| The default `kubectl get nodepools` table exposes the `Ready` condition's value | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this part please. |
||
| as `STATUS`, followed by strategy, providers, and age. The CRD printer column | ||
| reads the condition directly, so `status.conditions` remains the source of truth. | ||
| See the [printer-column design](design/nodepool-status-column.md) for the empty | ||
| condition and compatibility behavior. | ||
|
|
||
| Static spec rules are admission-time CEL validations. Examples: `Weighted` | ||
| requires a weight on every provider entry, and AWS provider entries require at | ||
| least one region. | ||
|
|
@@ -502,6 +508,7 @@ spec: | |
| failover: | ||
| blocklistTTL: 30s | ||
| status: | ||
| providers: modal,aws | ||
| placed: | ||
| modal: 2 | ||
| aws: 1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # NodePool status printer column | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this please, it's very straightforward. |
||
|
|
||
| ## Context | ||
|
|
||
| `NodePool.status.conditions` already reports whether a pool can be used. The | ||
| controller owns a standard `Ready` condition and sets it to `True` for a valid | ||
| pool or `False` when an environment-dependent validation, such as provider | ||
| registration, fails. However, the default `kubectl get nodepools` table does not | ||
| show that signal, so operators must request the full object or write a JSONPath. | ||
|
|
||
| ## Decision | ||
|
|
||
| Add a `Status` CRD printer column whose JSONPath selects the status of the | ||
| `Ready` condition: | ||
|
|
||
| ```text | ||
| .status.conditions[?(@.type=="Ready")].status | ||
| ``` | ||
|
|
||
| The column is derived directly by the Kubernetes API server when it renders the | ||
| table. No duplicate status field or controller change is introduced. This keeps | ||
| the condition as the single source of truth and uses the standard condition | ||
| values `True`, `False`, and `Unknown`. | ||
|
|
||
| The column appears before policy details so pool health is visible immediately: | ||
|
|
||
| ```text | ||
| NAME STATUS STRATEGY PROVIDERS AGE | ||
| gpu-pool True Ordered modal,runpod 2m | ||
| ``` | ||
|
|
||
| Before the controller has written the `Ready` condition, the table cell has no | ||
| value. This is preferable to manufacturing a fourth status value because absence | ||
| already means the controller has not observed the object. | ||
|
|
||
| ## Compatibility and rollout | ||
|
|
||
| This is an additive change to `additionalPrinterColumns`; the stored and served | ||
| resource schema is unchanged. Existing clients that read `NodePool` objects are | ||
| unaffected. Installing the regenerated CRD is sufficient to enable the column | ||
| for existing pools, and the next `kubectl get` uses their existing conditions. | ||
|
|
||
| ## Verification | ||
|
|
||
| Generation is checked into `config/crd/bases`. Regenerating the manifests keeps | ||
| the CRD printer column aligned with the marker in `nodepool_types.go`. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this.