Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apis/projectcontour/v1/detailedconditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ type SubCondition struct {
//
// Remember that Conditions have a type, a status, and a reason.
//
// The type is the type of the condition, the most important one in this CRD set is `Valid`.
// The type is the type of the condition, the most important ones in this CRD set are `Valid` and `Stalled`.
//
// `Valid` is a positive-polarity condition: when it is `status: true` there are no problems.
//
// In more detail, `status: true` means that the object is has been ingested into Contour with no errors.
Expand All @@ -110,6 +111,9 @@ type SubCondition struct {
// The details of the errors will be present under the `errors` field. There must be at least one error in the `errors`
// slice if `status` is `false`.
//
// `Stalled` is true when Contour cannot reconcile the resource. Clients that use the kstatus library read this condition
// together with `observedGeneration` to determine whether Contour has finished reconciling a resource after an apply operation.
//
// For DetailedConditions of types other than `Valid`, the Condition must be in the negative polarity.
// When they have `status` `true`, there is an error. There must be at least one entry in the `errors` Subcondition slice.
// When they have `status` `false`, there are no serious errors, and there must be zero entries in the `errors` slice.
Expand Down Expand Up @@ -138,6 +142,9 @@ const (
// ValidConditionType describes an valid condition.
ValidConditionType = "Valid"

// StalledConditionType is true when Contour cannot reconcile the resource.
StalledConditionType = "Stalled"

// ConditionTypeAuthError describes an error condition related to Auth.
ConditionTypeAuthError = "AuthError"

Expand Down
11 changes: 8 additions & 3 deletions apis/projectcontour/v1/httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1531,16 +1531,21 @@ type HTTPProxyStatus struct {
CurrentStatus string `json:"currentStatus,omitempty"`
// +optional
Description string `json:"description,omitempty"`
// ObservedGeneration is the generation that Contour reconciled last.
// A value that differs from `metadata.generation` means that Contour did not act on the latest spec yet.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// +optional
// LoadBalancer contains the current status of the load balancer.
LoadBalancer core_v1.LoadBalancerStatus `json:"loadBalancer,omitempty"`
// +optional
// Conditions contains information about the current status of the HTTPProxy,
// in an upstream-friendly container.
//
// Contour will update a single condition, `Valid`, that is in normal-true polarity.
// That is, when `currentStatus` is `valid`, the `Valid` condition will be `status: true`,
// and vice versa.
// Contour will update the `Valid` and `Stalled` conditions.
// `Valid` is in normal-true polarity, that is, when `currentStatus` is `valid`, the `Valid` condition will be `status: true`, and vice versa.
// `Stalled` is true when Contour cannot reconcile the resource.
//
// Contour will leave untouched any other Conditions set in this block,
// in case some other controller wants to add a Condition.
Expand Down
10 changes: 9 additions & 1 deletion apis/projectcontour/v1alpha1/extensionservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,17 @@ type ExtensionServiceSpec struct {
// ExtensionServiceStatus defines the observed state of an
// ExtensionService resource.
type ExtensionServiceStatus struct {
// ObservedGeneration is the generation that Contour reconciled last.
// A value that differs from `metadata.generation` means that Contour did not act on the latest spec yet.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// Conditions contains the current status of the ExtensionService resource.
//
// Contour will update a single condition, `Valid`, that is in normal-true polarity.
// Contour will update the `Valid` and `Stalled` conditions.
// `Valid` is in normal-true polarity, that is, when `currentStatus` is `valid`, the `Valid` condition will be `status: true`, and vice versa.
// `Stalled` is true when Contour cannot reconcile the resource.
//
// Contour will not modify any other Conditions set in this block,
// in case some other controller wants to add a Condition.
Expand Down
10 changes: 10 additions & 0 deletions changelogs/unreleased/7664-tsaarni-minor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## kstatus support for HTTPProxy and ExtensionService

Clients that use [kstatus](https://github.com/kubernetes-sigs/cli-utils/tree/master/pkg/kstatus) can now check if `HTTPProxy` and `ExtensionService` are reconciled.
This includes [Helm](https://helm.sh/community/hips/hip-0022/), [Argo CD](https://argo-cd.readthedocs.io/en/stable/operator-manual/health/#using-kstatus), and [Flux](https://fluxcd.io/flux/components/kustomize/kustomizations/#health-checks).

For both resources, Contour now writes:
- `Stalled` in `.status.conditions`
- `observedGeneration` in `.status`

Downgrade note: older Contour releases do not support the `Stalled` status condition and cannot remove condition set by newer Contour version after a downgrade. This condition must be removed manually to prevent incorrect status reporting by kstatus clients.
40 changes: 32 additions & 8 deletions examples/contour/01-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1333,14 +1333,16 @@ spec:
`errors` holds information about sub-conditions which are fatal to that condition and render its state False.
`warnings` holds information about sub-conditions which are not fatal to that condition and do not force the state to be False.
Remember that Conditions have a type, a status, and a reason.
The type is the type of the condition, the most important one in this CRD set is `Valid`.
The type is the type of the condition, the most important ones in this CRD set are `Valid` and `Stalled`.
`Valid` is a positive-polarity condition: when it is `status: true` there are no problems.
In more detail, `status: true` means that the object is has been ingested into Contour with no errors.
`warnings` may still be present, and will be indicated in the Reason field. There must be zero entries in the `errors`
slice in this case.
`Valid`, `status: false` means that the object has had one or more fatal errors during processing into Contour.
The details of the errors will be present under the `errors` field. There must be at least one error in the `errors`
slice if `status` is `false`.
`Stalled` is true when Contour cannot reconcile the resource. Clients that use the kstatus library read this condition
together with `observedGeneration` to determine whether Contour has finished reconciling a resource after an apply operation.
For DetailedConditions of types other than `Valid`, the Condition must be in the negative polarity.
When they have `status` `true`, there is an error. There must be at least one entry in the `errors` Subcondition slice.
When they have `status` `false`, there are no serious errors, and there must be zero entries in the `errors` slice.
Expand Down Expand Up @@ -5761,7 +5763,9 @@ spec:
conditions:
description: |-
Conditions contains the current status of the ExtensionService resource.
Contour will update a single condition, `Valid`, that is in normal-true polarity.
Contour will update the `Valid` and `Stalled` conditions.
`Valid` is in normal-true polarity, that is, when `currentStatus` is `valid`, the `Valid` condition will be `status: true`, and vice versa.
`Stalled` is true when Contour cannot reconcile the resource.
Contour will not modify any other Conditions set in this block,
in case some other controller wants to add a Condition.
items:
Expand All @@ -5772,14 +5776,16 @@ spec:
`errors` holds information about sub-conditions which are fatal to that condition and render its state False.
`warnings` holds information about sub-conditions which are not fatal to that condition and do not force the state to be False.
Remember that Conditions have a type, a status, and a reason.
The type is the type of the condition, the most important one in this CRD set is `Valid`.
The type is the type of the condition, the most important ones in this CRD set are `Valid` and `Stalled`.
`Valid` is a positive-polarity condition: when it is `status: true` there are no problems.
In more detail, `status: true` means that the object is has been ingested into Contour with no errors.
`warnings` may still be present, and will be indicated in the Reason field. There must be zero entries in the `errors`
slice in this case.
`Valid`, `status: false` means that the object has had one or more fatal errors during processing into Contour.
The details of the errors will be present under the `errors` field. There must be at least one error in the `errors`
slice if `status` is `false`.
`Stalled` is true when Contour cannot reconcile the resource. Clients that use the kstatus library read this condition
together with `observedGeneration` to determine whether Contour has finished reconciling a resource after an apply operation.
For DetailedConditions of types other than `Valid`, the Condition must be in the negative polarity.
When they have `status` `true`, there is an error. There must be at least one entry in the `errors` Subcondition slice.
When they have `status` `false`, there are no serious errors, and there must be zero entries in the `errors` slice.
Expand Down Expand Up @@ -5950,6 +5956,13 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
observedGeneration:
description: |-
ObservedGeneration is the generation that Contour reconciled last.
A value that differs from `metadata.generation` means that Contour did not act on the latest spec yet.
format: int64
minimum: 0
type: integer
type: object
type: object
served: true
Expand Down Expand Up @@ -8698,9 +8711,9 @@ spec:
description: |-
Conditions contains information about the current status of the HTTPProxy,
in an upstream-friendly container.
Contour will update a single condition, `Valid`, that is in normal-true polarity.
That is, when `currentStatus` is `valid`, the `Valid` condition will be `status: true`,
and vice versa.
Contour will update the `Valid` and `Stalled` conditions.
`Valid` is in normal-true polarity, that is, when `currentStatus` is `valid`, the `Valid` condition will be `status: true`, and vice versa.
`Stalled` is true when Contour cannot reconcile the resource.
Contour will leave untouched any other Conditions set in this block,
in case some other controller wants to add a Condition.
If you are another controller owner and wish to add a condition, you *should*
Expand All @@ -8713,14 +8726,16 @@ spec:
`errors` holds information about sub-conditions which are fatal to that condition and render its state False.
`warnings` holds information about sub-conditions which are not fatal to that condition and do not force the state to be False.
Remember that Conditions have a type, a status, and a reason.
The type is the type of the condition, the most important one in this CRD set is `Valid`.
The type is the type of the condition, the most important ones in this CRD set are `Valid` and `Stalled`.
`Valid` is a positive-polarity condition: when it is `status: true` there are no problems.
In more detail, `status: true` means that the object is has been ingested into Contour with no errors.
`warnings` may still be present, and will be indicated in the Reason field. There must be zero entries in the `errors`
slice in this case.
`Valid`, `status: false` means that the object has had one or more fatal errors during processing into Contour.
The details of the errors will be present under the `errors` field. There must be at least one error in the `errors`
slice if `status` is `false`.
`Stalled` is true when Contour cannot reconcile the resource. Clients that use the kstatus library read this condition
together with `observedGeneration` to determine whether Contour has finished reconciling a resource after an apply operation.
For DetailedConditions of types other than `Valid`, the Condition must be in the negative polarity.
When they have `status` `true`, there is an error. There must be at least one entry in the `errors` Subcondition slice.
When they have `status` `false`, there are no serious errors, and there must be zero entries in the `errors` slice.
Expand Down Expand Up @@ -8966,6 +8981,13 @@ spec:
type: array
x-kubernetes-list-type: atomic
type: object
observedGeneration:
description: |-
ObservedGeneration is the generation that Contour reconciled last.
A value that differs from `metadata.generation` means that Contour did not act on the latest spec yet.
format: int64
minimum: 0
type: integer
type: object
required:
- metadata
Expand Down Expand Up @@ -9071,14 +9093,16 @@ spec:
`errors` holds information about sub-conditions which are fatal to that condition and render its state False.
`warnings` holds information about sub-conditions which are not fatal to that condition and do not force the state to be False.
Remember that Conditions have a type, a status, and a reason.
The type is the type of the condition, the most important one in this CRD set is `Valid`.
The type is the type of the condition, the most important ones in this CRD set are `Valid` and `Stalled`.
`Valid` is a positive-polarity condition: when it is `status: true` there are no problems.
In more detail, `status: true` means that the object is has been ingested into Contour with no errors.
`warnings` may still be present, and will be indicated in the Reason field. There must be zero entries in the `errors`
slice in this case.
`Valid`, `status: false` means that the object has had one or more fatal errors during processing into Contour.
The details of the errors will be present under the `errors` field. There must be at least one error in the `errors`
slice if `status` is `false`.
`Stalled` is true when Contour cannot reconcile the resource. Clients that use the kstatus library read this condition
together with `observedGeneration` to determine whether Contour has finished reconciling a resource after an apply operation.
For DetailedConditions of types other than `Valid`, the Condition must be in the negative polarity.
When they have `status` `true`, there is an error. There must be at least one entry in the `errors` Subcondition slice.
When they have `status` `false`, there are no serious errors, and there must be zero entries in the `errors` slice.
Expand Down
Loading
Loading