Skip to content

Commit 1d28358

Browse files
committed
api: add EnvoyProxy status
Signed-off-by: zirain <[email protected]>
1 parent aa2f693 commit 1d28358

File tree

7 files changed

+941
-11
lines changed

7 files changed

+941
-11
lines changed

api/v1alpha1/envoyproxy_types.go

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ const (
2121

2222
// EnvoyProxy is the schema for the envoyproxies API.
2323
type EnvoyProxy struct {
24-
metav1.TypeMeta `json:",inline"`
24+
metav1.TypeMeta `json:",inline"`
25+
// +optional
2526
metav1.ObjectMeta `json:"metadata,omitempty"`
2627

2728
// EnvoyProxySpec defines the desired state of EnvoyProxy.
28-
Spec EnvoyProxySpec `json:"spec,omitempty"`
29+
Spec EnvoyProxySpec `json:"spec"`
2930
// EnvoyProxyStatus defines the actual state of EnvoyProxy.
31+
// +optional
3032
Status EnvoyProxyStatus `json:"status,omitempty"`
3133
}
3234

@@ -539,13 +541,42 @@ const (
539541
BootstrapTypeJSONPatch BootstrapType = "JSONPatch"
540542
)
541543

542-
// EnvoyProxyStatus defines the observed state of EnvoyProxy. This type is not implemented
543-
// until https://github.com/envoyproxy/gateway/issues/1007 is fixed.
544+
// EnvoyProxyStatus defines the observed state of EnvoyProxy.
544545
type EnvoyProxyStatus struct {
545-
// INSERT ADDITIONAL STATUS FIELDS - define observed state of cluster.
546-
// Important: Run "make" to regenerate code after modifying this file.
546+
// Ancestors represent the status information for all the GatewayClass or Gateway
547+
// reference this EnvoyProxy with ParametersReference.
548+
//
549+
// +optional
550+
Ancestors []EnvoyProxyAncestorStatus `json:"ancestors,omitempty"`
551+
}
552+
553+
type EnvoyProxyAncestorStatus struct {
554+
// AncestorRef corresponds a GatewayClass or Gateway use this EnvoyProxy with ParametersReference.
555+
// +required
556+
AncestorRef gwapiv1.ParentReference `json:"ancestorRef"`
557+
558+
// Conditions describes the status of the Policy with respect to the given Ancestor.
559+
//
560+
// +required
561+
// +listType=map
562+
// +listMapKey=type
563+
Conditions []metav1.Condition `json:"conditions,omitempty"`
547564
}
548565

566+
type EnvoyProxyConditionType string
567+
568+
const (
569+
EnvoyProxyConditionAccepted EnvoyProxyConditionType = "Accepted"
570+
)
571+
572+
type EnvoyProxyConditionReason string
573+
574+
const (
575+
EnvoyProxyReasonAccepted EnvoyProxyConditionReason = "Accepted"
576+
577+
EnvoyProxyReasonInvalidParameters EnvoyProxyConditionReason = "InvalidParameters"
578+
)
579+
549580
// +kubebuilder:object:root=true
550581

551582
// EnvoyProxyList contains a list of EnvoyProxy

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15937,7 +15937,219 @@ spec:
1593715937
type: object
1593815938
status:
1593915939
description: EnvoyProxyStatus defines the actual state of EnvoyProxy.
15940+
properties:
15941+
ancestors:
15942+
description: |-
15943+
Ancestors represent the status information for all the GatewayClass or Gateway
15944+
reference this EnvoyProxy with ParametersReference.
15945+
items:
15946+
properties:
15947+
ancestorRef:
15948+
description: AncestorRef corresponds a GatewayClass or Gateway
15949+
use this EnvoyProxy with ParametersReference.
15950+
properties:
15951+
group:
15952+
default: gateway.networking.k8s.io
15953+
description: |-
15954+
Group is the group of the referent.
15955+
When unspecified, "gateway.networking.k8s.io" is inferred.
15956+
To set the core API group (such as for a "Service" kind referent),
15957+
Group must be explicitly set to "" (empty string).
15958+
15959+
Support: Core
15960+
maxLength: 253
15961+
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
15962+
type: string
15963+
kind:
15964+
default: Gateway
15965+
description: |-
15966+
Kind is kind of the referent.
15967+
15968+
There are two kinds of parent resources with "Core" support:
15969+
15970+
* Gateway (Gateway conformance profile)
15971+
* Service (Mesh conformance profile, ClusterIP Services only)
15972+
15973+
Support for other resources is Implementation-Specific.
15974+
maxLength: 63
15975+
minLength: 1
15976+
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
15977+
type: string
15978+
name:
15979+
description: |-
15980+
Name is the name of the referent.
15981+
15982+
Support: Core
15983+
maxLength: 253
15984+
minLength: 1
15985+
type: string
15986+
namespace:
15987+
description: |-
15988+
Namespace is the namespace of the referent. When unspecified, this refers
15989+
to the local namespace of the Route.
15990+
15991+
Note that there are specific rules for ParentRefs which cross namespace
15992+
boundaries. Cross-namespace references are only valid if they are explicitly
15993+
allowed by something in the namespace they are referring to. For example:
15994+
Gateway has the AllowedRoutes field, and ReferenceGrant provides a
15995+
generic way to enable any other kind of cross-namespace reference.
15996+
15997+
<gateway:experimental:description>
15998+
ParentRefs from a Route to a Service in the same namespace are "producer"
15999+
routes, which apply default routing rules to inbound connections from
16000+
any namespace to the Service.
16001+
16002+
ParentRefs from a Route to a Service in a different namespace are
16003+
"consumer" routes, and these routing rules are only applied to outbound
16004+
connections originating from the same namespace as the Route, for which
16005+
the intended destination of the connections are a Service targeted as a
16006+
ParentRef of the Route.
16007+
</gateway:experimental:description>
16008+
16009+
Support: Core
16010+
maxLength: 63
16011+
minLength: 1
16012+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
16013+
type: string
16014+
port:
16015+
description: |-
16016+
Port is the network port this Route targets. It can be interpreted
16017+
differently based on the type of parent resource.
16018+
16019+
When the parent resource is a Gateway, this targets all listeners
16020+
listening on the specified port that also support this kind of Route(and
16021+
select this Route). It's not recommended to set `Port` unless the
16022+
networking behaviors specified in a Route must apply to a specific port
16023+
as opposed to a listener(s) whose port(s) may be changed. When both Port
16024+
and SectionName are specified, the name and port of the selected listener
16025+
must match both specified values.
16026+
16027+
<gateway:experimental:description>
16028+
When the parent resource is a Service, this targets a specific port in the
16029+
Service spec. When both Port (experimental) and SectionName are specified,
16030+
the name and port of the selected port must match both specified values.
16031+
</gateway:experimental:description>
16032+
16033+
Implementations MAY choose to support other parent resources.
16034+
Implementations supporting other types of parent resources MUST clearly
16035+
document how/if Port is interpreted.
16036+
16037+
For the purpose of status, an attachment is considered successful as
16038+
long as the parent resource accepts it partially. For example, Gateway
16039+
listeners can restrict which Routes can attach to them by Route kind,
16040+
namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
16041+
from the referencing Route, the Route MUST be considered successfully
16042+
attached. If no Gateway listeners accept attachment from this Route,
16043+
the Route MUST be considered detached from the Gateway.
16044+
16045+
Support: Extended
16046+
format: int32
16047+
maximum: 65535
16048+
minimum: 1
16049+
type: integer
16050+
sectionName:
16051+
description: |-
16052+
SectionName is the name of a section within the target resource. In the
16053+
following resources, SectionName is interpreted as the following:
16054+
16055+
* Gateway: Listener name. When both Port (experimental) and SectionName
16056+
are specified, the name and port of the selected listener must match
16057+
both specified values.
16058+
* Service: Port name. When both Port (experimental) and SectionName
16059+
are specified, the name and port of the selected listener must match
16060+
both specified values.
16061+
16062+
Implementations MAY choose to support attaching Routes to other resources.
16063+
If that is the case, they MUST clearly document how SectionName is
16064+
interpreted.
16065+
16066+
When unspecified (empty string), this will reference the entire resource.
16067+
For the purpose of status, an attachment is considered successful if at
16068+
least one section in the parent resource accepts it. For example, Gateway
16069+
listeners can restrict which Routes can attach to them by Route kind,
16070+
namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from
16071+
the referencing Route, the Route MUST be considered successfully
16072+
attached. If no Gateway listeners accept attachment from this Route, the
16073+
Route MUST be considered detached from the Gateway.
16074+
16075+
Support: Core
16076+
maxLength: 253
16077+
minLength: 1
16078+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
16079+
type: string
16080+
required:
16081+
- name
16082+
type: object
16083+
conditions:
16084+
description: Conditions describes the status of the Policy with
16085+
respect to the given Ancestor.
16086+
items:
16087+
description: Condition contains details for one aspect of
16088+
the current state of this API Resource.
16089+
properties:
16090+
lastTransitionTime:
16091+
description: |-
16092+
lastTransitionTime is the last time the condition transitioned from one status to another.
16093+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
16094+
format: date-time
16095+
type: string
16096+
message:
16097+
description: |-
16098+
message is a human readable message indicating details about the transition.
16099+
This may be an empty string.
16100+
maxLength: 32768
16101+
type: string
16102+
observedGeneration:
16103+
description: |-
16104+
observedGeneration represents the .metadata.generation that the condition was set based upon.
16105+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
16106+
with respect to the current state of the instance.
16107+
format: int64
16108+
minimum: 0
16109+
type: integer
16110+
reason:
16111+
description: |-
16112+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
16113+
Producers of specific condition types may define expected values and meanings for this field,
16114+
and whether the values are considered a guaranteed API.
16115+
The value should be a CamelCase string.
16116+
This field may not be empty.
16117+
maxLength: 1024
16118+
minLength: 1
16119+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
16120+
type: string
16121+
status:
16122+
description: status of the condition, one of True, False,
16123+
Unknown.
16124+
enum:
16125+
- "True"
16126+
- "False"
16127+
- Unknown
16128+
type: string
16129+
type:
16130+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
16131+
maxLength: 316
16132+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
16133+
type: string
16134+
required:
16135+
- lastTransitionTime
16136+
- message
16137+
- reason
16138+
- status
16139+
- type
16140+
type: object
16141+
type: array
16142+
x-kubernetes-list-map-keys:
16143+
- type
16144+
x-kubernetes-list-type: map
16145+
required:
16146+
- ancestorRef
16147+
- conditions
16148+
type: object
16149+
type: array
1594016150
type: object
16151+
required:
16152+
- spec
1594116153
type: object
1594216154
served: true
1594316155
storage: true

0 commit comments

Comments
 (0)