k8s_pb/api/networking/v1/
mod.rs

1// This file is @generated by prost-build.
2/// HTTPIngressPath associates a path with a backend. Incoming urls matching the
3/// path are forwarded to the backend.
4#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct HttpIngressPath {
6    /// path is matched against the path of an incoming request. Currently it can
7    /// contain characters disallowed from the conventional "path" part of a URL
8    /// as defined by RFC 3986. Paths must begin with a '/' and must be present
9    /// when using PathType with value "Exact" or "Prefix".
10    /// +optional
11    #[prost(string, optional, tag = "1")]
12    pub path: ::core::option::Option<::prost::alloc::string::String>,
13    /// pathType determines the interpretation of the path matching. PathType can
14    /// be one of the following values:
15    /// * Exact: Matches the URL path exactly.
16    /// * Prefix: Matches based on a URL path prefix split by '/'. Matching is
17    ///    done on a path element by element basis. A path element refers is the
18    ///    list of labels in the path split by the '/' separator. A request is a
19    ///    match for path p if every p is an element-wise prefix of p of the
20    ///    request path. Note that if the last element of the path is a substring
21    ///    of the last element in request path, it is not a match (e.g. /foo/bar
22    ///    matches /foo/bar/baz, but does not match /foo/barbaz).
23    /// * ImplementationSpecific: Interpretation of the Path matching is up to
24    ///    the IngressClass. Implementations can treat this as a separate PathType
25    ///    or treat it identically to Prefix or Exact path types.
26    /// Implementations are required to support all path types.
27    #[prost(string, optional, tag = "3")]
28    pub path_type: ::core::option::Option<::prost::alloc::string::String>,
29    /// backend defines the referenced service endpoint to which the traffic
30    /// will be forwarded to.
31    #[prost(message, optional, tag = "2")]
32    pub backend: ::core::option::Option<IngressBackend>,
33}
34/// HTTPIngressRuleValue is a list of http selectors pointing to backends.
35/// In the example: <http://<host>/<path>?<searchpart>> -> backend where
36/// where parts of the url correspond to RFC 3986, this resource will be used
37/// to match against everything after the last '/' and before the first '?'
38/// or '#'.
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct HttpIngressRuleValue {
41    /// paths is a collection of paths that map requests to backends.
42    /// +listType=atomic
43    #[prost(message, repeated, tag = "1")]
44    pub paths: ::prost::alloc::vec::Vec<HttpIngressPath>,
45}
46/// IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs
47/// that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses.
48/// An IP address can be represented in different formats, to guarantee the uniqueness of the IP,
49/// the name of the object is the IP address in canonical format, four decimal digits separated
50/// by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6.
51/// Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1
52/// Invalid: 10.01.2.3 or 2001:db8:0:0:0::1
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct IPAddress {
55    /// Standard object's metadata.
56    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
57    /// +optional
58    #[prost(message, optional, tag = "1")]
59    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
60    /// spec is the desired state of the IPAddress.
61    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
62    /// +optional
63    #[prost(message, optional, tag = "2")]
64    pub spec: ::core::option::Option<IPAddressSpec>,
65}
66/// IPAddressList contains a list of IPAddress.
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct IPAddressList {
69    /// Standard object's metadata.
70    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
71    /// +optional
72    #[prost(message, optional, tag = "1")]
73    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
74    /// items is the list of IPAddresses.
75    #[prost(message, repeated, tag = "2")]
76    pub items: ::prost::alloc::vec::Vec<IPAddress>,
77}
78/// IPAddressSpec describe the attributes in an IP Address.
79#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
80pub struct IPAddressSpec {
81    /// ParentRef references the resource that an IPAddress is attached to.
82    /// An IPAddress must reference a parent object.
83    /// +required
84    #[prost(message, optional, tag = "1")]
85    pub parent_ref: ::core::option::Option<ParentReference>,
86}
87/// IPBlock describes a particular CIDR (Ex. "192.168.1.0/24","2001:db8::/64") that is allowed
88/// to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs
89/// that should not be included within this rule.
90#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
91pub struct IpBlock {
92    /// cidr is a string representing the IPBlock
93    /// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
94    #[prost(string, optional, tag = "1")]
95    pub cidr: ::core::option::Option<::prost::alloc::string::String>,
96    /// except is a slice of CIDRs that should not be included within an IPBlock
97    /// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
98    /// Except values will be rejected if they are outside the cidr range
99    /// +optional
100    /// +listType=atomic
101    #[prost(string, repeated, tag = "2")]
102    pub except: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
103}
104/// Ingress is a collection of rules that allow inbound connections to reach the
105/// endpoints defined by a backend. An Ingress can be configured to give services
106/// externally-reachable urls, load balance traffic, terminate SSL, offer name
107/// based virtual hosting etc.
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Ingress {
110    /// Standard object's metadata.
111    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
112    /// +optional
113    #[prost(message, optional, tag = "1")]
114    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
115    /// spec is the desired state of the Ingress.
116    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
117    /// +optional
118    #[prost(message, optional, tag = "2")]
119    pub spec: ::core::option::Option<IngressSpec>,
120    /// status is the current state of the Ingress.
121    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
122    /// +optional
123    #[prost(message, optional, tag = "3")]
124    pub status: ::core::option::Option<IngressStatus>,
125}
126/// IngressBackend describes all endpoints for a given service and port.
127#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
128pub struct IngressBackend {
129    /// service references a service as a backend.
130    /// This is a mutually exclusive setting with "Resource".
131    /// +optional
132    #[prost(message, optional, tag = "4")]
133    pub service: ::core::option::Option<IngressServiceBackend>,
134    /// resource is an ObjectRef to another Kubernetes resource in the namespace
135    /// of the Ingress object. If resource is specified, a service.Name and
136    /// service.Port must not be specified.
137    /// This is a mutually exclusive setting with "Service".
138    /// +optional
139    #[prost(message, optional, tag = "3")]
140    pub resource: ::core::option::Option<super::super::core::v1::TypedLocalObjectReference>,
141}
142/// IngressClass represents the class of the Ingress, referenced by the Ingress
143/// Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be
144/// used to indicate that an IngressClass should be considered default. When a
145/// single IngressClass resource has this annotation set to true, new Ingress
146/// resources without a class specified will be assigned this default class.
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct IngressClass {
149    /// Standard object's metadata.
150    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
151    /// +optional
152    #[prost(message, optional, tag = "1")]
153    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
154    /// spec is the desired state of the IngressClass.
155    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
156    /// +optional
157    #[prost(message, optional, tag = "2")]
158    pub spec: ::core::option::Option<IngressClassSpec>,
159}
160/// IngressClassList is a collection of IngressClasses.
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct IngressClassList {
163    /// Standard list metadata.
164    /// +optional
165    #[prost(message, optional, tag = "1")]
166    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
167    /// items is the list of IngressClasses.
168    #[prost(message, repeated, tag = "2")]
169    pub items: ::prost::alloc::vec::Vec<IngressClass>,
170}
171/// IngressClassParametersReference identifies an API object. This can be used
172/// to specify a cluster or namespace-scoped resource.
173#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
174pub struct IngressClassParametersReference {
175    /// apiGroup is the group for the resource being referenced. If APIGroup is
176    /// not specified, the specified Kind must be in the core API group. For any
177    /// other third-party types, APIGroup is required.
178    /// +optional
179    #[prost(string, optional, tag = "1")]
180    pub a_pi_group: ::core::option::Option<::prost::alloc::string::String>,
181    /// kind is the type of resource being referenced.
182    #[prost(string, optional, tag = "2")]
183    pub kind: ::core::option::Option<::prost::alloc::string::String>,
184    /// name is the name of resource being referenced.
185    #[prost(string, optional, tag = "3")]
186    pub name: ::core::option::Option<::prost::alloc::string::String>,
187    /// scope represents if this refers to a cluster or namespace scoped resource.
188    /// This may be set to "Cluster" (default) or "Namespace".
189    /// +optional
190    #[prost(string, optional, tag = "4")]
191    pub scope: ::core::option::Option<::prost::alloc::string::String>,
192    /// namespace is the namespace of the resource being referenced. This field is
193    /// required when scope is set to "Namespace" and must be unset when scope is set to
194    /// "Cluster".
195    /// +optional
196    #[prost(string, optional, tag = "5")]
197    pub namespace: ::core::option::Option<::prost::alloc::string::String>,
198}
199/// IngressClassSpec provides information about the class of an Ingress.
200#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
201pub struct IngressClassSpec {
202    /// controller refers to the name of the controller that should handle this
203    /// class. This allows for different "flavors" that are controlled by the
204    /// same controller. For example, you may have different parameters for the
205    /// same implementing controller. This should be specified as a
206    /// domain-prefixed path no more than 250 characters in length, e.g.
207    /// "acme.io/ingress-controller". This field is immutable.
208    #[prost(string, optional, tag = "1")]
209    pub controller: ::core::option::Option<::prost::alloc::string::String>,
210    /// parameters is a link to a custom resource containing additional
211    /// configuration for the controller. This is optional if the controller does
212    /// not require extra parameters.
213    /// +optional
214    #[prost(message, optional, tag = "2")]
215    pub parameters: ::core::option::Option<IngressClassParametersReference>,
216}
217/// IngressList is a collection of Ingress.
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct IngressList {
220    /// Standard object's metadata.
221    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
222    /// +optional
223    #[prost(message, optional, tag = "1")]
224    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
225    /// items is the list of Ingress.
226    #[prost(message, repeated, tag = "2")]
227    pub items: ::prost::alloc::vec::Vec<Ingress>,
228}
229/// IngressLoadBalancerIngress represents the status of a load-balancer ingress point.
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct IngressLoadBalancerIngress {
232    /// ip is set for load-balancer ingress points that are IP based.
233    /// +optional
234    #[prost(string, optional, tag = "1")]
235    pub ip: ::core::option::Option<::prost::alloc::string::String>,
236    /// hostname is set for load-balancer ingress points that are DNS based.
237    /// +optional
238    #[prost(string, optional, tag = "2")]
239    pub hostname: ::core::option::Option<::prost::alloc::string::String>,
240    /// ports provides information about the ports exposed by this LoadBalancer.
241    /// +listType=atomic
242    /// +optional
243    #[prost(message, repeated, tag = "4")]
244    pub ports: ::prost::alloc::vec::Vec<IngressPortStatus>,
245}
246/// IngressLoadBalancerStatus represents the status of a load-balancer.
247#[derive(Clone, PartialEq, ::prost::Message)]
248pub struct IngressLoadBalancerStatus {
249    /// ingress is a list containing ingress points for the load-balancer.
250    /// +optional
251    /// +listType=atomic
252    #[prost(message, repeated, tag = "1")]
253    pub ingress: ::prost::alloc::vec::Vec<IngressLoadBalancerIngress>,
254}
255/// IngressPortStatus represents the error condition of a service port
256#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
257pub struct IngressPortStatus {
258    /// port is the port number of the ingress port.
259    #[prost(int32, optional, tag = "1")]
260    pub port: ::core::option::Option<i32>,
261    /// protocol is the protocol of the ingress port.
262    /// The supported values are: "TCP", "UDP", "SCTP"
263    #[prost(string, optional, tag = "2")]
264    pub protocol: ::core::option::Option<::prost::alloc::string::String>,
265    /// error is to record the problem with the service port
266    /// The format of the error shall comply with the following rules:
267    /// - built-in error values shall be specified in this file and those shall use
268    ///    CamelCase names
269    /// - cloud provider specific error values must have names that comply with the
270    ///    format foo.example.com/CamelCase.
271    /// ---
272    /// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
273    /// +optional
274    /// +kubebuilder:validation:Required
275    /// +kubebuilder:validation: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\])$`
276    /// +kubebuilder:validation:MaxLength=316
277    #[prost(string, optional, tag = "3")]
278    pub error: ::core::option::Option<::prost::alloc::string::String>,
279}
280/// IngressRule represents the rules mapping the paths under a specified host to
281/// the related backend services. Incoming requests are first evaluated for a host
282/// match, then routed to the backend associated with the matching IngressRuleValue.
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct IngressRule {
285    /// host is the fully qualified domain name of a network host, as defined by RFC 3986.
286    /// Note the following deviations from the "host" part of the
287    /// URI as defined in RFC 3986:
288    /// 1. IPs are not allowed. Currently an IngressRuleValue can only apply to
289    ///     the IP in the Spec of the parent Ingress.
290    /// 2. The `:` delimiter is not respected because ports are not allowed.
291    /// 	  Currently the port of an Ingress is implicitly :80 for http and
292    /// 	  :443 for https.
293    /// Both these may change in the future.
294    /// Incoming requests are matched against the host before the
295    /// IngressRuleValue. If the host is unspecified, the Ingress routes all
296    /// traffic based on the specified IngressRuleValue.
297    ///
298    /// host can be "precise" which is a domain name without the terminating dot of
299    /// a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name
300    /// prefixed with a single wildcard label (e.g. "*.foo.com").
301    /// The wildcard character '*' must appear by itself as the first DNS label and
302    /// matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*").
303    /// Requests will be matched against the Host field in the following way:
304    /// 1. If host is precise, the request matches this rule if the http host header is equal to Host.
305    /// 2. If host is a wildcard, then the request matches this rule if the http host header
306    /// is to equal to the suffix (removing the first label) of the wildcard rule.
307    /// +optional
308    #[prost(string, optional, tag = "1")]
309    pub host: ::core::option::Option<::prost::alloc::string::String>,
310    /// IngressRuleValue represents a rule to route requests for this IngressRule.
311    /// If unspecified, the rule defaults to a http catch-all. Whether that sends
312    /// just traffic matching the host to the default backend or all traffic to the
313    /// default backend, is left to the controller fulfilling the Ingress. Http is
314    /// currently the only supported IngressRuleValue.
315    /// +optional
316    #[prost(message, optional, tag = "2")]
317    pub ingress_rule_value: ::core::option::Option<IngressRuleValue>,
318}
319/// IngressRuleValue represents a rule to apply against incoming requests. If the
320/// rule is satisfied, the request is routed to the specified backend. Currently
321/// mixing different types of rules in a single Ingress is disallowed, so exactly
322/// one of the following must be set.
323#[derive(Clone, PartialEq, ::prost::Message)]
324pub struct IngressRuleValue {
325    /// +optional
326    #[prost(message, optional, tag = "1")]
327    pub http: ::core::option::Option<HttpIngressRuleValue>,
328}
329/// IngressServiceBackend references a Kubernetes Service as a Backend.
330#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
331pub struct IngressServiceBackend {
332    /// name is the referenced service. The service must exist in
333    /// the same namespace as the Ingress object.
334    #[prost(string, optional, tag = "1")]
335    pub name: ::core::option::Option<::prost::alloc::string::String>,
336    /// port of the referenced service. A port name or port number
337    /// is required for a IngressServiceBackend.
338    #[prost(message, optional, tag = "2")]
339    pub port: ::core::option::Option<ServiceBackendPort>,
340}
341/// IngressSpec describes the Ingress the user wishes to exist.
342#[derive(Clone, PartialEq, ::prost::Message)]
343pub struct IngressSpec {
344    /// ingressClassName is the name of an IngressClass cluster resource. Ingress
345    /// controller implementations use this field to know whether they should be
346    /// serving this Ingress resource, by a transitive connection
347    /// (controller -> IngressClass -> Ingress resource). Although the
348    /// `kubernetes.io/ingress.class` annotation (simple constant name) was never
349    /// formally defined, it was widely supported by Ingress controllers to create
350    /// a direct binding between Ingress controller and Ingress resources. Newly
351    /// created Ingress resources should prefer using the field. However, even
352    /// though the annotation is officially deprecated, for backwards compatibility
353    /// reasons, ingress controllers should still honor that annotation if present.
354    /// +optional
355    #[prost(string, optional, tag = "4")]
356    pub ingress_class_name: ::core::option::Option<::prost::alloc::string::String>,
357    /// defaultBackend is the backend that should handle requests that don't
358    /// match any rule. If Rules are not specified, DefaultBackend must be specified.
359    /// If DefaultBackend is not set, the handling of requests that do not match any
360    /// of the rules will be up to the Ingress controller.
361    /// +optional
362    #[prost(message, optional, tag = "1")]
363    pub default_backend: ::core::option::Option<IngressBackend>,
364    /// tls represents the TLS configuration. Currently the Ingress only supports a
365    /// single TLS port, 443. If multiple members of this list specify different hosts,
366    /// they will be multiplexed on the same port according to the hostname specified
367    /// through the SNI TLS extension, if the ingress controller fulfilling the
368    /// ingress supports SNI.
369    /// +listType=atomic
370    /// +optional
371    #[prost(message, repeated, tag = "2")]
372    pub tls: ::prost::alloc::vec::Vec<IngressTls>,
373    /// rules is a list of host rules used to configure the Ingress. If unspecified,
374    /// or no rule matches, all traffic is sent to the default backend.
375    /// +listType=atomic
376    /// +optional
377    #[prost(message, repeated, tag = "3")]
378    pub rules: ::prost::alloc::vec::Vec<IngressRule>,
379}
380/// IngressStatus describe the current state of the Ingress.
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct IngressStatus {
383    /// loadBalancer contains the current status of the load-balancer.
384    /// +optional
385    #[prost(message, optional, tag = "1")]
386    pub load_balancer: ::core::option::Option<IngressLoadBalancerStatus>,
387}
388/// IngressTLS describes the transport layer security associated with an ingress.
389#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
390pub struct IngressTls {
391    /// hosts is a list of hosts included in the TLS certificate. The values in
392    /// this list must match the name/s used in the tlsSecret. Defaults to the
393    /// wildcard host setting for the loadbalancer controller fulfilling this
394    /// Ingress, if left unspecified.
395    /// +listType=atomic
396    /// +optional
397    #[prost(string, repeated, tag = "1")]
398    pub hosts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
399    /// secretName is the name of the secret used to terminate TLS traffic on
400    /// port 443. Field is left optional to allow TLS routing based on SNI
401    /// hostname alone. If the SNI host in a listener conflicts with the "Host"
402    /// header field used by an IngressRule, the SNI host is used for termination
403    /// and value of the "Host" header is used for routing.
404    /// +optional
405    #[prost(string, optional, tag = "2")]
406    pub secret_name: ::core::option::Option<::prost::alloc::string::String>,
407}
408/// NetworkPolicy describes what network traffic is allowed for a set of Pods
409#[derive(Clone, PartialEq, ::prost::Message)]
410pub struct NetworkPolicy {
411    /// Standard object's metadata.
412    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
413    /// +optional
414    #[prost(message, optional, tag = "1")]
415    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
416    /// spec represents the specification of the desired behavior for this NetworkPolicy.
417    /// +optional
418    #[prost(message, optional, tag = "2")]
419    pub spec: ::core::option::Option<NetworkPolicySpec>,
420}
421/// NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods
422/// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to.
423/// This type is beta-level in 1.8
424#[derive(Clone, PartialEq, ::prost::Message)]
425pub struct NetworkPolicyEgressRule {
426    /// ports is a list of destination ports for outgoing traffic.
427    /// Each item in this list is combined using a logical OR. If this field is
428    /// empty or missing, this rule matches all ports (traffic not restricted by port).
429    /// If this field is present and contains at least one item, then this rule allows
430    /// traffic only if the traffic matches at least one port in the list.
431    /// +optional
432    /// +listType=atomic
433    #[prost(message, repeated, tag = "1")]
434    pub ports: ::prost::alloc::vec::Vec<NetworkPolicyPort>,
435    /// to is a list of destinations for outgoing traffic of pods selected for this rule.
436    /// Items in this list are combined using a logical OR operation. If this field is
437    /// empty or missing, this rule matches all destinations (traffic not restricted by
438    /// destination). If this field is present and contains at least one item, this rule
439    /// allows traffic only if the traffic matches at least one item in the to list.
440    /// +optional
441    /// +listType=atomic
442    #[prost(message, repeated, tag = "2")]
443    pub to: ::prost::alloc::vec::Vec<NetworkPolicyPeer>,
444}
445/// NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
446/// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
447#[derive(Clone, PartialEq, ::prost::Message)]
448pub struct NetworkPolicyIngressRule {
449    /// ports is a list of ports which should be made accessible on the pods selected for
450    /// this rule. Each item in this list is combined using a logical OR. If this field is
451    /// empty or missing, this rule matches all ports (traffic not restricted by port).
452    /// If this field is present and contains at least one item, then this rule allows
453    /// traffic only if the traffic matches at least one port in the list.
454    /// +optional
455    /// +listType=atomic
456    #[prost(message, repeated, tag = "1")]
457    pub ports: ::prost::alloc::vec::Vec<NetworkPolicyPort>,
458    /// from is a list of sources which should be able to access the pods selected for this rule.
459    /// Items in this list are combined using a logical OR operation. If this field is
460    /// empty or missing, this rule matches all sources (traffic not restricted by
461    /// source). If this field is present and contains at least one item, this rule
462    /// allows traffic only if the traffic matches at least one item in the from list.
463    /// +optional
464    /// +listType=atomic
465    #[prost(message, repeated, tag = "2")]
466    pub from: ::prost::alloc::vec::Vec<NetworkPolicyPeer>,
467}
468/// NetworkPolicyList is a list of NetworkPolicy objects.
469#[derive(Clone, PartialEq, ::prost::Message)]
470pub struct NetworkPolicyList {
471    /// Standard list metadata.
472    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
473    /// +optional
474    #[prost(message, optional, tag = "1")]
475    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
476    /// items is a list of schema objects.
477    #[prost(message, repeated, tag = "2")]
478    pub items: ::prost::alloc::vec::Vec<NetworkPolicy>,
479}
480/// NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of
481/// fields are allowed
482#[derive(Clone, PartialEq, ::prost::Message)]
483pub struct NetworkPolicyPeer {
484    /// podSelector is a label selector which selects pods. This field follows standard label
485    /// selector semantics; if present but empty, it selects all pods.
486    ///
487    /// If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects
488    /// the pods matching podSelector in the Namespaces selected by NamespaceSelector.
489    /// Otherwise it selects the pods matching podSelector in the policy's own namespace.
490    /// +optional
491    #[prost(message, optional, tag = "1")]
492    pub pod_selector:
493        ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector>,
494    /// namespaceSelector selects namespaces using cluster-scoped labels. This field follows
495    /// standard label selector semantics; if present but empty, it selects all namespaces.
496    ///
497    /// If podSelector is also set, then the NetworkPolicyPeer as a whole selects
498    /// the pods matching podSelector in the namespaces selected by namespaceSelector.
499    /// Otherwise it selects all pods in the namespaces selected by namespaceSelector.
500    /// +optional
501    #[prost(message, optional, tag = "2")]
502    pub namespace_selector:
503        ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector>,
504    /// ipBlock defines policy on a particular IPBlock. If this field is set then
505    /// neither of the other fields can be.
506    /// +optional
507    #[prost(message, optional, tag = "3")]
508    pub ip_block: ::core::option::Option<IpBlock>,
509}
510/// NetworkPolicyPort describes a port to allow traffic on
511#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
512pub struct NetworkPolicyPort {
513    /// protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match.
514    /// If not specified, this field defaults to TCP.
515    /// +optional
516    #[prost(string, optional, tag = "1")]
517    pub protocol: ::core::option::Option<::prost::alloc::string::String>,
518    /// port represents the port on the given protocol. This can either be a numerical or named
519    /// port on a pod. If this field is not provided, this matches all port names and
520    /// numbers.
521    /// If present, only traffic on the specified protocol AND port will be matched.
522    /// +optional
523    #[prost(message, optional, tag = "2")]
524    pub port: ::core::option::Option<super::super::super::apimachinery::pkg::util::intstr::IntOrString>,
525    /// endPort indicates that the range of ports from port to endPort if set, inclusive,
526    /// should be allowed by the policy. This field cannot be defined if the port field
527    /// is not defined or if the port field is defined as a named (string) port.
528    /// The endPort must be equal or greater than port.
529    /// +optional
530    #[prost(int32, optional, tag = "3")]
531    pub end_port: ::core::option::Option<i32>,
532}
533/// NetworkPolicySpec provides the specification of a NetworkPolicy
534#[derive(Clone, PartialEq, ::prost::Message)]
535pub struct NetworkPolicySpec {
536    /// podSelector selects the pods to which this NetworkPolicy object applies.
537    /// The array of rules is applied to any pods selected by this field. An empty
538    /// selector matches all pods in the policy's namespace.
539    /// Multiple network policies can select the same set of pods. In this case,
540    /// the ingress rules for each are combined additively.
541    /// This field is optional. If it is not specified, it defaults to an empty selector.
542    /// +optional
543    #[prost(message, optional, tag = "1")]
544    pub pod_selector:
545        ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector>,
546    /// ingress is a list of ingress rules to be applied to the selected pods.
547    /// Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
548    /// (and cluster policy otherwise allows the traffic), OR if the traffic source is
549    /// the pod's local node, OR if the traffic matches at least one ingress rule
550    /// across all of the NetworkPolicy objects whose podSelector matches the pod. If
551    /// this field is empty then this NetworkPolicy does not allow any traffic (and serves
552    /// solely to ensure that the pods it selects are isolated by default)
553    /// +optional
554    /// +listType=atomic
555    #[prost(message, repeated, tag = "2")]
556    pub ingress: ::prost::alloc::vec::Vec<NetworkPolicyIngressRule>,
557    /// egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
558    /// is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
559    /// otherwise allows the traffic), OR if the traffic matches at least one egress rule
560    /// across all of the NetworkPolicy objects whose podSelector matches the pod. If
561    /// this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
562    /// solely to ensure that the pods it selects are isolated by default).
563    /// This field is beta-level in 1.8
564    /// +optional
565    /// +listType=atomic
566    #[prost(message, repeated, tag = "3")]
567    pub egress: ::prost::alloc::vec::Vec<NetworkPolicyEgressRule>,
568    /// policyTypes is a list of rule types that the NetworkPolicy relates to.
569    /// Valid options are \["Ingress"\], \["Egress"\], or \["Ingress", "Egress"\].
570    /// If this field is not specified, it will default based on the existence of ingress or egress rules;
571    /// policies that contain an egress section are assumed to affect egress, and all policies
572    /// (whether or not they contain an ingress section) are assumed to affect ingress.
573    /// If you want to write an egress-only policy, you must explicitly specify policyTypes \[ "Egress" \].
574    /// Likewise, if you want to write a policy that specifies that no egress is allowed,
575    /// you must specify a policyTypes value that include "Egress" (since such a policy would not include
576    /// an egress section and would otherwise default to just \[ "Ingress" \]).
577    /// This field is beta-level in 1.8
578    /// +optional
579    /// +listType=atomic
580    #[prost(string, repeated, tag = "4")]
581    pub policy_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
582}
583/// ParentReference describes a reference to a parent object.
584#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
585pub struct ParentReference {
586    /// Group is the group of the object being referenced.
587    /// +optional
588    #[prost(string, optional, tag = "1")]
589    pub group: ::core::option::Option<::prost::alloc::string::String>,
590    /// Resource is the resource of the object being referenced.
591    /// +required
592    #[prost(string, optional, tag = "2")]
593    pub resource: ::core::option::Option<::prost::alloc::string::String>,
594    /// Namespace is the namespace of the object being referenced.
595    /// +optional
596    #[prost(string, optional, tag = "3")]
597    pub namespace: ::core::option::Option<::prost::alloc::string::String>,
598    /// Name is the name of the object being referenced.
599    /// +required
600    #[prost(string, optional, tag = "4")]
601    pub name: ::core::option::Option<::prost::alloc::string::String>,
602}
603/// ServiceBackendPort is the service port being referenced.
604/// +structType=atomic
605#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
606pub struct ServiceBackendPort {
607    /// name is the name of the port on the Service.
608    /// This is a mutually exclusive setting with "Number".
609    /// +optional
610    #[prost(string, optional, tag = "1")]
611    pub name: ::core::option::Option<::prost::alloc::string::String>,
612    /// number is the numerical port number (e.g. 80) on the Service.
613    /// This is a mutually exclusive setting with "Name".
614    /// +optional
615    #[prost(int32, optional, tag = "2")]
616    pub number: ::core::option::Option<i32>,
617}
618/// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64).
619/// This range is used to allocate ClusterIPs to Service objects.
620#[derive(Clone, PartialEq, ::prost::Message)]
621pub struct ServiceCIDR {
622    /// Standard object's metadata.
623    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
624    /// +optional
625    #[prost(message, optional, tag = "1")]
626    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
627    /// spec is the desired state of the ServiceCIDR.
628    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
629    /// +optional
630    #[prost(message, optional, tag = "2")]
631    pub spec: ::core::option::Option<ServiceCIDRSpec>,
632    /// status represents the current state of the ServiceCIDR.
633    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
634    /// +optional
635    #[prost(message, optional, tag = "3")]
636    pub status: ::core::option::Option<ServiceCIDRStatus>,
637}
638/// ServiceCIDRList contains a list of ServiceCIDR objects.
639#[derive(Clone, PartialEq, ::prost::Message)]
640pub struct ServiceCIDRList {
641    /// Standard object's metadata.
642    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
643    /// +optional
644    #[prost(message, optional, tag = "1")]
645    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
646    /// items is the list of ServiceCIDRs.
647    #[prost(message, repeated, tag = "2")]
648    pub items: ::prost::alloc::vec::Vec<ServiceCIDR>,
649}
650/// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.
651#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
652pub struct ServiceCIDRSpec {
653    /// CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64")
654    /// from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family.
655    /// This field is immutable.
656    /// +optional
657    /// +listType=atomic
658    #[prost(string, repeated, tag = "1")]
659    pub cidrs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
660}
661/// ServiceCIDRStatus describes the current state of the ServiceCIDR.
662#[derive(Clone, PartialEq, ::prost::Message)]
663pub struct ServiceCIDRStatus {
664    /// conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR.
665    /// Current service state
666    /// +optional
667    /// +patchMergeKey=type
668    /// +patchStrategy=merge
669    /// +listType=map
670    /// +listMapKey=type
671    #[prost(message, repeated, tag = "1")]
672    pub conditions:
673        ::prost::alloc::vec::Vec<super::super::super::apimachinery::pkg::apis::meta::v1::Condition>,
674}
675
676impl crate::Resource for IPAddress {
677    const API_VERSION: &'static str = "networking.k8s.io/v1";
678    const GROUP: &'static str = "networking.k8s.io";
679    const VERSION: &'static str = "v1";
680    const KIND: &'static str = "IPAddress";
681    const URL_PATH_SEGMENT: &'static str = "ipaddresses";
682    type Scope = crate::ClusterResourceScope;
683}
684impl crate::Metadata for IPAddress {
685    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
686    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
687        self.metadata.as_ref()
688    }
689    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
690        self.metadata.as_mut()
691    }
692}
693impl crate::HasSpec for IPAddress {
694    type Spec = crate::api::networking::v1::IPAddressSpec;
695    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
696        self.spec.as_ref()
697    }
698    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
699        self.spec.as_mut()
700    }
701}
702
703impl crate::Resource for Ingress {
704    const API_VERSION: &'static str = "networking.k8s.io/v1";
705    const GROUP: &'static str = "networking.k8s.io";
706    const VERSION: &'static str = "v1";
707    const KIND: &'static str = "Ingress";
708    const URL_PATH_SEGMENT: &'static str = "ingresses";
709    type Scope = crate::NamespaceResourceScope;
710}
711impl crate::Metadata for Ingress {
712    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
713    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
714        self.metadata.as_ref()
715    }
716    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
717        self.metadata.as_mut()
718    }
719}
720impl crate::HasSpec for Ingress {
721    type Spec = crate::api::networking::v1::IngressSpec;
722    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
723        self.spec.as_ref()
724    }
725    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
726        self.spec.as_mut()
727    }
728}
729impl crate::HasStatus for Ingress {
730    type Status = crate::api::networking::v1::IngressStatus;
731    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
732        self.status.as_ref()
733    }
734    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
735        self.status.as_mut()
736    }
737}
738
739impl crate::Resource for IngressClass {
740    const API_VERSION: &'static str = "networking.k8s.io/v1";
741    const GROUP: &'static str = "networking.k8s.io";
742    const VERSION: &'static str = "v1";
743    const KIND: &'static str = "IngressClass";
744    const URL_PATH_SEGMENT: &'static str = "ingressclasses";
745    type Scope = crate::ClusterResourceScope;
746}
747impl crate::Metadata for IngressClass {
748    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
749    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
750        self.metadata.as_ref()
751    }
752    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
753        self.metadata.as_mut()
754    }
755}
756impl crate::HasSpec for IngressClass {
757    type Spec = crate::api::networking::v1::IngressClassSpec;
758    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
759        self.spec.as_ref()
760    }
761    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
762        self.spec.as_mut()
763    }
764}
765
766impl crate::Resource for NetworkPolicy {
767    const API_VERSION: &'static str = "networking.k8s.io/v1";
768    const GROUP: &'static str = "networking.k8s.io";
769    const VERSION: &'static str = "v1";
770    const KIND: &'static str = "NetworkPolicy";
771    const URL_PATH_SEGMENT: &'static str = "networkpolicies";
772    type Scope = crate::NamespaceResourceScope;
773}
774impl crate::Metadata for NetworkPolicy {
775    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
776    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
777        self.metadata.as_ref()
778    }
779    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
780        self.metadata.as_mut()
781    }
782}
783impl crate::HasSpec for NetworkPolicy {
784    type Spec = crate::api::networking::v1::NetworkPolicySpec;
785    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
786        self.spec.as_ref()
787    }
788    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
789        self.spec.as_mut()
790    }
791}
792
793impl crate::Resource for ServiceCIDR {
794    const API_VERSION: &'static str = "networking.k8s.io/v1";
795    const GROUP: &'static str = "networking.k8s.io";
796    const VERSION: &'static str = "v1";
797    const KIND: &'static str = "ServiceCIDR";
798    const URL_PATH_SEGMENT: &'static str = "servicecidrs";
799    type Scope = crate::ClusterResourceScope;
800}
801impl crate::Metadata for ServiceCIDR {
802    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
803    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
804        self.metadata.as_ref()
805    }
806    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
807        self.metadata.as_mut()
808    }
809}
810impl crate::HasSpec for ServiceCIDR {
811    type Spec = crate::api::networking::v1::ServiceCIDRSpec;
812    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
813        self.spec.as_ref()
814    }
815    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
816        self.spec.as_mut()
817    }
818}
819impl crate::HasStatus for ServiceCIDR {
820    type Status = crate::api::networking::v1::ServiceCIDRStatus;
821    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
822        self.status.as_ref()
823    }
824    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
825        self.status.as_mut()
826    }
827}
828impl crate::HasConditions for ServiceCIDR {
829    type Condition = crate::apimachinery::pkg::apis::meta::v1::Condition;
830    fn conditions(&self) -> Option<&[<Self as crate::HasConditions>::Condition]> {
831        self.status.as_ref().map(|s| s.conditions.as_slice())
832    }
833    fn conditions_mut(&mut self) -> Option<&mut Vec<<Self as crate::HasConditions>::Condition>> {
834        self.status.as_mut().and_then(|s| Some(s.conditions.as_mut()))
835    }
836}