blob: a98ef94c860f5c49f6618e01ab36651b3e45e19d [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.api.networking.v1;
23
24import "k8s.io/api/core/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
26import "k8s.io/apimachinery/pkg/runtime/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
29
30// Package-wide variables from generator "generated".
31option go_package = "v1";
32
33// HTTPIngressPath associates a path with a backend. Incoming urls matching the
34// path are forwarded to the backend.
35message HTTPIngressPath {
36 // Path is matched against the path of an incoming request. Currently it can
37 // contain characters disallowed from the conventional "path" part of a URL
38 // as defined by RFC 3986. Paths must begin with a '/'. When unspecified,
39 // all paths from incoming requests are matched.
40 // +optional
41 optional string path = 1;
42
43 // PathType determines the interpretation of the Path matching. PathType can
44 // be one of the following values:
45 // * Exact: Matches the URL path exactly.
46 // * Prefix: Matches based on a URL path prefix split by '/'. Matching is
47 // done on a path element by element basis. A path element refers is the
48 // list of labels in the path split by the '/' separator. A request is a
49 // match for path p if every p is an element-wise prefix of p of the
50 // request path. Note that if the last element of the path is a substring
51 // of the last element in request path, it is not a match (e.g. /foo/bar
52 // matches /foo/bar/baz, but does not match /foo/barbaz).
53 // * ImplementationSpecific: Interpretation of the Path matching is up to
54 // the IngressClass. Implementations can treat this as a separate PathType
55 // or treat it identically to Prefix or Exact path types.
56 // Implementations are required to support all path types.
57 optional string pathType = 3;
58
59 // Backend defines the referenced service endpoint to which the traffic
60 // will be forwarded to.
61 optional IngressBackend backend = 2;
62}
63
64// HTTPIngressRuleValue is a list of http selectors pointing to backends.
65// In the example: http://<host>/<path>?<searchpart> -> backend where
66// where parts of the url correspond to RFC 3986, this resource will be used
67// to match against everything after the last '/' and before the first '?'
68// or '#'.
69message HTTPIngressRuleValue {
70 // A collection of paths that map requests to backends.
71 // +listType=atomic
72 repeated HTTPIngressPath paths = 1;
73}
74
75// IPBlock describes a particular CIDR (Ex. "192.168.1.1/24","2001:db9::/64") that is allowed
76// to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs
77// that should not be included within this rule.
78message IPBlock {
79 // CIDR is a string representing the IP Block
80 // Valid examples are "192.168.1.1/24" or "2001:db9::/64"
81 optional string cidr = 1;
82
83 // Except is a slice of CIDRs that should not be included within an IP Block
84 // Valid examples are "192.168.1.1/24" or "2001:db9::/64"
85 // Except values will be rejected if they are outside the CIDR range
86 // +optional
87 repeated string except = 2;
88}
89
90// Ingress is a collection of rules that allow inbound connections to reach the
91// endpoints defined by a backend. An Ingress can be configured to give services
92// externally-reachable urls, load balance traffic, terminate SSL, offer name
93// based virtual hosting etc.
94message Ingress {
95 // Standard object's metadata.
96 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
97 // +optional
98 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
99
100 // Spec is the desired state of the Ingress.
101 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
102 // +optional
103 optional IngressSpec spec = 2;
104
105 // Status is the current state of the Ingress.
106 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
107 // +optional
108 optional IngressStatus status = 3;
109}
110
111// IngressBackend describes all endpoints for a given service and port.
112message IngressBackend {
113 // Service references a Service as a Backend.
114 // This is a mutually exclusive setting with "Resource".
115 // +optional
116 optional IngressServiceBackend service = 4;
117
118 // Resource is an ObjectRef to another Kubernetes resource in the namespace
119 // of the Ingress object. If resource is specified, a service.Name and
120 // service.Port must not be specified.
121 // This is a mutually exclusive setting with "Service".
122 // +optional
123 optional k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
124}
125
126// IngressClass represents the class of the Ingress, referenced by the Ingress
127// Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be
128// used to indicate that an IngressClass should be considered default. When a
129// single IngressClass resource has this annotation set to true, new Ingress
130// resources without a class specified will be assigned this default class.
131message IngressClass {
132 // Standard object's metadata.
133 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
134 // +optional
135 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
136
137 // Spec is the desired state of the IngressClass.
138 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
139 // +optional
140 optional IngressClassSpec spec = 2;
141}
142
143// IngressClassList is a collection of IngressClasses.
144message IngressClassList {
145 // Standard list metadata.
146 // +optional
147 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
148
149 // Items is the list of IngressClasses.
150 repeated IngressClass items = 2;
151}
152
153// IngressClassSpec provides information about the class of an Ingress.
154message IngressClassSpec {
155 // Controller refers to the name of the controller that should handle this
156 // class. This allows for different "flavors" that are controlled by the
157 // same controller. For example, you may have different Parameters for the
158 // same implementing controller. This should be specified as a
159 // domain-prefixed path no more than 250 characters in length, e.g.
160 // "acme.io/ingress-controller". This field is immutable.
161 optional string controller = 1;
162
163 // Parameters is a link to a custom resource containing additional
164 // configuration for the controller. This is optional if the controller does
165 // not require extra parameters.
166 // +optional
167 optional k8s.io.api.core.v1.TypedLocalObjectReference parameters = 2;
168}
169
170// IngressList is a collection of Ingress.
171message IngressList {
172 // Standard object's metadata.
173 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
174 // +optional
175 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
176
177 // Items is the list of Ingress.
178 repeated Ingress items = 2;
179}
180
181// IngressRule represents the rules mapping the paths under a specified host to
182// the related backend services. Incoming requests are first evaluated for a host
183// match, then routed to the backend associated with the matching IngressRuleValue.
184message IngressRule {
185 // Host is the fully qualified domain name of a network host, as defined by RFC 3986.
186 // Note the following deviations from the "host" part of the
187 // URI as defined in RFC 3986:
188 // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to
189 // the IP in the Spec of the parent Ingress.
190 // 2. The `:` delimiter is not respected because ports are not allowed.
191 // Currently the port of an Ingress is implicitly :80 for http and
192 // :443 for https.
193 // Both these may change in the future.
194 // Incoming requests are matched against the host before the
195 // IngressRuleValue. If the host is unspecified, the Ingress routes all
196 // traffic based on the specified IngressRuleValue.
197 //
198 // Host can be "precise" which is a domain name without the terminating dot of
199 // a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name
200 // prefixed with a single wildcard label (e.g. "*.foo.com").
201 // The wildcard character '*' must appear by itself as the first DNS label and
202 // matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*").
203 // Requests will be matched against the Host field in the following way:
204 // 1. If Host is precise, the request matches this rule if the http host header is equal to Host.
205 // 2. If Host is a wildcard, then the request matches this rule if the http host header
206 // is to equal to the suffix (removing the first label) of the wildcard rule.
207 // +optional
208 optional string host = 1;
209
210 // IngressRuleValue represents a rule to route requests for this IngressRule.
211 // If unspecified, the rule defaults to a http catch-all. Whether that sends
212 // just traffic matching the host to the default backend or all traffic to the
213 // default backend, is left to the controller fulfilling the Ingress. Http is
214 // currently the only supported IngressRuleValue.
215 // +optional
216 optional IngressRuleValue ingressRuleValue = 2;
217}
218
219// IngressRuleValue represents a rule to apply against incoming requests. If the
220// rule is satisfied, the request is routed to the specified backend. Currently
221// mixing different types of rules in a single Ingress is disallowed, so exactly
222// one of the following must be set.
223message IngressRuleValue {
224 // +optional
225 optional HTTPIngressRuleValue http = 1;
226}
227
228// IngressServiceBackend references a Kubernetes Service as a Backend.
229message IngressServiceBackend {
230 // Name is the referenced service. The service must exist in
231 // the same namespace as the Ingress object.
232 optional string name = 1;
233
234 // Port of the referenced service. A port name or port number
235 // is required for a IngressServiceBackend.
236 optional ServiceBackendPort port = 2;
237}
238
239// IngressSpec describes the Ingress the user wishes to exist.
240message IngressSpec {
241 // IngressClassName is the name of the IngressClass cluster resource. The
242 // associated IngressClass defines which controller will implement the
243 // resource. This replaces the deprecated `kubernetes.io/ingress.class`
244 // annotation. For backwards compatibility, when that annotation is set, it
245 // must be given precedence over this field. The controller may emit a
246 // warning if the field and annotation have different values.
247 // Implementations of this API should ignore Ingresses without a class
248 // specified. An IngressClass resource may be marked as default, which can
249 // be used to set a default value for this field. For more information,
250 // refer to the IngressClass documentation.
251 // +optional
252 optional string ingressClassName = 4;
253
254 // DefaultBackend is the backend that should handle requests that don't
255 // match any rule. If Rules are not specified, DefaultBackend must be specified.
256 // If DefaultBackend is not set, the handling of requests that do not match any
257 // of the rules will be up to the Ingress controller.
258 // +optional
259 optional IngressBackend defaultBackend = 1;
260
261 // TLS configuration. Currently the Ingress only supports a single TLS
262 // port, 443. If multiple members of this list specify different hosts, they
263 // will be multiplexed on the same port according to the hostname specified
264 // through the SNI TLS extension, if the ingress controller fulfilling the
265 // ingress supports SNI.
266 // +listType=atomic
267 // +optional
268 repeated IngressTLS tls = 2;
269
270 // A list of host rules used to configure the Ingress. If unspecified, or
271 // no rule matches, all traffic is sent to the default backend.
272 // +listType=atomic
273 // +optional
274 repeated IngressRule rules = 3;
275}
276
277// IngressStatus describe the current state of the Ingress.
278message IngressStatus {
279 // LoadBalancer contains the current status of the load-balancer.
280 // +optional
281 optional k8s.io.api.core.v1.LoadBalancerStatus loadBalancer = 1;
282}
283
284// IngressTLS describes the transport layer security associated with an Ingress.
285message IngressTLS {
286 // Hosts are a list of hosts included in the TLS certificate. The values in
287 // this list must match the name/s used in the tlsSecret. Defaults to the
288 // wildcard host setting for the loadbalancer controller fulfilling this
289 // Ingress, if left unspecified.
290 // +listType=atomic
291 // +optional
292 repeated string hosts = 1;
293
294 // SecretName is the name of the secret used to terminate TLS traffic on
295 // port 443. Field is left optional to allow TLS routing based on SNI
296 // hostname alone. If the SNI host in a listener conflicts with the "Host"
297 // header field used by an IngressRule, the SNI host is used for termination
298 // and value of the Host header is used for routing.
299 // +optional
300 optional string secretName = 2;
301}
302
303// NetworkPolicy describes what network traffic is allowed for a set of Pods
304message NetworkPolicy {
305 // Standard object's metadata.
306 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
307 // +optional
308 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
309
310 // Specification of the desired behavior for this NetworkPolicy.
311 // +optional
312 optional NetworkPolicySpec spec = 2;
313}
314
315// NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods
316// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to.
317// This type is beta-level in 1.8
318message NetworkPolicyEgressRule {
319 // List of destination ports for outgoing traffic.
320 // Each item in this list is combined using a logical OR. If this field is
321 // empty or missing, this rule matches all ports (traffic not restricted by port).
322 // If this field is present and contains at least one item, then this rule allows
323 // traffic only if the traffic matches at least one port in the list.
324 // +optional
325 repeated NetworkPolicyPort ports = 1;
326
327 // List of destinations for outgoing traffic of pods selected for this rule.
328 // Items in this list are combined using a logical OR operation. If this field is
329 // empty or missing, this rule matches all destinations (traffic not restricted by
330 // destination). If this field is present and contains at least one item, this rule
331 // allows traffic only if the traffic matches at least one item in the to list.
332 // +optional
333 repeated NetworkPolicyPeer to = 2;
334}
335
336// NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
337// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
338message NetworkPolicyIngressRule {
339 // List of ports which should be made accessible on the pods selected for this
340 // rule. Each item in this list is combined using a logical OR. If this field is
341 // empty or missing, this rule matches all ports (traffic not restricted by port).
342 // If this field is present and contains at least one item, then this rule allows
343 // traffic only if the traffic matches at least one port in the list.
344 // +optional
345 repeated NetworkPolicyPort ports = 1;
346
347 // List of sources which should be able to access the pods selected for this rule.
348 // Items in this list are combined using a logical OR operation. If this field is
349 // empty or missing, this rule matches all sources (traffic not restricted by
350 // source). If this field is present and contains at least one item, this rule
351 // allows traffic only if the traffic matches at least one item in the from list.
352 // +optional
353 repeated NetworkPolicyPeer from = 2;
354}
355
356// NetworkPolicyList is a list of NetworkPolicy objects.
357message NetworkPolicyList {
358 // Standard list metadata.
359 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
360 // +optional
361 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
362
363 // Items is a list of schema objects.
364 repeated NetworkPolicy items = 2;
365}
366
367// NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of
368// fields are allowed
369message NetworkPolicyPeer {
370 // This is a label selector which selects Pods. This field follows standard label
371 // selector semantics; if present but empty, it selects all pods.
372 //
373 // If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects
374 // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
375 // Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
376 // +optional
377 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
378
379 // Selects Namespaces using cluster-scoped labels. This field follows standard label
380 // selector semantics; if present but empty, it selects all namespaces.
381 //
382 // If PodSelector is also set, then the NetworkPolicyPeer as a whole selects
383 // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
384 // Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
385 // +optional
386 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
387
388 // IPBlock defines policy on a particular IPBlock. If this field is set then
389 // neither of the other fields can be.
390 // +optional
391 optional IPBlock ipBlock = 3;
392}
393
394// NetworkPolicyPort describes a port to allow traffic on
395message NetworkPolicyPort {
396 // The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this
397 // field defaults to TCP.
398 // +optional
399 optional string protocol = 1;
400
401 // The port on the given protocol. This can either be a numerical or named port on
402 // a pod. If this field is not provided, this matches all port names and numbers.
403 // +optional
404 optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
405}
406
407// NetworkPolicySpec provides the specification of a NetworkPolicy
408message NetworkPolicySpec {
409 // Selects the pods to which this NetworkPolicy object applies. The array of
410 // ingress rules is applied to any pods selected by this field. Multiple network
411 // policies can select the same set of pods. In this case, the ingress rules for
412 // each are combined additively. This field is NOT optional and follows standard
413 // label selector semantics. An empty podSelector matches all pods in this
414 // namespace.
415 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
416
417 // List of ingress rules to be applied to the selected pods. Traffic is allowed to
418 // a pod if there are no NetworkPolicies selecting the pod
419 // (and cluster policy otherwise allows the traffic), OR if the traffic source is
420 // the pod's local node, OR if the traffic matches at least one ingress rule
421 // across all of the NetworkPolicy objects whose podSelector matches the pod. If
422 // this field is empty then this NetworkPolicy does not allow any traffic (and serves
423 // solely to ensure that the pods it selects are isolated by default)
424 // +optional
425 repeated NetworkPolicyIngressRule ingress = 2;
426
427 // List of egress rules to be applied to the selected pods. Outgoing traffic is
428 // allowed if there are no NetworkPolicies selecting the pod (and cluster policy
429 // otherwise allows the traffic), OR if the traffic matches at least one egress rule
430 // across all of the NetworkPolicy objects whose podSelector matches the pod. If
431 // this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
432 // solely to ensure that the pods it selects are isolated by default).
433 // This field is beta-level in 1.8
434 // +optional
435 repeated NetworkPolicyEgressRule egress = 3;
436
437 // List of rule types that the NetworkPolicy relates to.
438 // Valid options are "Ingress", "Egress", or "Ingress,Egress".
439 // If this field is not specified, it will default based on the existence of Ingress or Egress rules;
440 // policies that contain an Egress section are assumed to affect Egress, and all policies
441 // (whether or not they contain an Ingress section) are assumed to affect Ingress.
442 // If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
443 // Likewise, if you want to write a policy that specifies that no egress is allowed,
444 // you must specify a policyTypes value that include "Egress" (since such a policy would not include
445 // an Egress section and would otherwise default to just [ "Ingress" ]).
446 // This field is beta-level in 1.8
447 // +optional
448 repeated string policyTypes = 4;
449}
450
451// ServiceBackendPort is the service port being referenced.
452message ServiceBackendPort {
453 // Name is the name of the port on the Service.
454 // This is a mutually exclusive setting with "Number".
455 // +optional
456 optional string name = 1;
457
458 // Number is the numerical port number (e.g. 80) on the Service.
459 // This is a mutually exclusive setting with "Name".
460 // +optional
461 optional int32 number = 2;
462}
463