generated.proto 23 KB

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