generated.proto 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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 '/' and must be present
  29. // when using PathType with value "Exact" or "Prefix".
  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. // +optional
  143. optional string scope = 4;
  144. // Namespace is the namespace of the resource being referenced. This field is
  145. // required when scope is set to "Namespace" and must be unset when scope is set to
  146. // "Cluster".
  147. // +optional
  148. optional string namespace = 5;
  149. }
  150. // IngressClassSpec provides information about the class of an Ingress.
  151. message IngressClassSpec {
  152. // Controller refers to the name of the controller that should handle this
  153. // class. This allows for different "flavors" that are controlled by the
  154. // same controller. For example, you may have different Parameters for the
  155. // same implementing controller. This should be specified as a
  156. // domain-prefixed path no more than 250 characters in length, e.g.
  157. // "acme.io/ingress-controller". This field is immutable.
  158. optional string controller = 1;
  159. // Parameters is a link to a custom resource containing additional
  160. // configuration for the controller. This is optional if the controller does
  161. // not require extra parameters.
  162. // +optional
  163. optional IngressClassParametersReference parameters = 2;
  164. }
  165. // IngressList is a collection of Ingress.
  166. message IngressList {
  167. // Standard object's metadata.
  168. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  169. // +optional
  170. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  171. // Items is the list of Ingress.
  172. repeated Ingress items = 2;
  173. }
  174. // IngressRule represents the rules mapping the paths under a specified host to
  175. // the related backend services. Incoming requests are first evaluated for a host
  176. // match, then routed to the backend associated with the matching IngressRuleValue.
  177. message IngressRule {
  178. // Host is the fully qualified domain name of a network host, as defined by RFC 3986.
  179. // Note the following deviations from the "host" part of the
  180. // URI as defined in RFC 3986:
  181. // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to
  182. // the IP in the Spec of the parent Ingress.
  183. // 2. The `:` delimiter is not respected because ports are not allowed.
  184. // Currently the port of an Ingress is implicitly :80 for http and
  185. // :443 for https.
  186. // Both these may change in the future.
  187. // Incoming requests are matched against the host before the
  188. // IngressRuleValue. If the host is unspecified, the Ingress routes all
  189. // traffic based on the specified IngressRuleValue.
  190. //
  191. // Host can be "precise" which is a domain name without the terminating dot of
  192. // a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name
  193. // prefixed with a single wildcard label (e.g. "*.foo.com").
  194. // The wildcard character '*' must appear by itself as the first DNS label and
  195. // matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*").
  196. // Requests will be matched against the Host field in the following way:
  197. // 1. If Host is precise, the request matches this rule if the http host header is equal to Host.
  198. // 2. If Host is a wildcard, then the request matches this rule if the http host header
  199. // is to equal to the suffix (removing the first label) of the wildcard rule.
  200. // +optional
  201. optional string host = 1;
  202. // IngressRuleValue represents a rule to route requests for this IngressRule.
  203. // If unspecified, the rule defaults to a http catch-all. Whether that sends
  204. // just traffic matching the host to the default backend or all traffic to the
  205. // default backend, is left to the controller fulfilling the Ingress. Http is
  206. // currently the only supported IngressRuleValue.
  207. // +optional
  208. optional IngressRuleValue ingressRuleValue = 2;
  209. }
  210. // IngressRuleValue represents a rule to apply against incoming requests. If the
  211. // rule is satisfied, the request is routed to the specified backend. Currently
  212. // mixing different types of rules in a single Ingress is disallowed, so exactly
  213. // one of the following must be set.
  214. message IngressRuleValue {
  215. // +optional
  216. optional HTTPIngressRuleValue http = 1;
  217. }
  218. // IngressServiceBackend references a Kubernetes Service as a Backend.
  219. message IngressServiceBackend {
  220. // Name is the referenced service. The service must exist in
  221. // the same namespace as the Ingress object.
  222. optional string name = 1;
  223. // Port of the referenced service. A port name or port number
  224. // is required for a IngressServiceBackend.
  225. optional ServiceBackendPort port = 2;
  226. }
  227. // IngressSpec describes the Ingress the user wishes to exist.
  228. message IngressSpec {
  229. // IngressClassName is the name of the IngressClass cluster resource. The
  230. // associated IngressClass defines which controller will implement the
  231. // resource. This replaces the deprecated `kubernetes.io/ingress.class`
  232. // annotation. For backwards compatibility, when that annotation is set, it
  233. // must be given precedence over this field. The controller may emit a
  234. // warning if the field and annotation have different values.
  235. // Implementations of this API should ignore Ingresses without a class
  236. // specified. An IngressClass resource may be marked as default, which can
  237. // be used to set a default value for this field. For more information,
  238. // refer to the IngressClass documentation.
  239. // +optional
  240. optional string ingressClassName = 4;
  241. // DefaultBackend is the backend that should handle requests that don't
  242. // match any rule. If Rules are not specified, DefaultBackend must be specified.
  243. // If DefaultBackend is not set, the handling of requests that do not match any
  244. // of the rules will be up to the Ingress controller.
  245. // +optional
  246. optional IngressBackend defaultBackend = 1;
  247. // TLS configuration. Currently the Ingress only supports a single TLS
  248. // port, 443. If multiple members of this list specify different hosts, they
  249. // will be multiplexed on the same port according to the hostname specified
  250. // through the SNI TLS extension, if the ingress controller fulfilling the
  251. // ingress supports SNI.
  252. // +listType=atomic
  253. // +optional
  254. repeated IngressTLS tls = 2;
  255. // A list of host rules used to configure the Ingress. If unspecified, or
  256. // no rule matches, all traffic is sent to the default backend.
  257. // +listType=atomic
  258. // +optional
  259. repeated IngressRule rules = 3;
  260. }
  261. // IngressStatus describe the current state of the Ingress.
  262. message IngressStatus {
  263. // LoadBalancer contains the current status of the load-balancer.
  264. // +optional
  265. optional k8s.io.api.core.v1.LoadBalancerStatus loadBalancer = 1;
  266. }
  267. // IngressTLS describes the transport layer security associated with an Ingress.
  268. message IngressTLS {
  269. // Hosts are a list of hosts included in the TLS certificate. The values in
  270. // this list must match the name/s used in the tlsSecret. Defaults to the
  271. // wildcard host setting for the loadbalancer controller fulfilling this
  272. // Ingress, if left unspecified.
  273. // +listType=atomic
  274. // +optional
  275. repeated string hosts = 1;
  276. // SecretName is the name of the secret used to terminate TLS traffic on
  277. // port 443. Field is left optional to allow TLS routing based on SNI
  278. // hostname alone. If the SNI host in a listener conflicts with the "Host"
  279. // header field used by an IngressRule, the SNI host is used for termination
  280. // and value of the Host header is used for routing.
  281. // +optional
  282. optional string secretName = 2;
  283. }
  284. // NetworkPolicy describes what network traffic is allowed for a set of Pods
  285. message NetworkPolicy {
  286. // Standard object's metadata.
  287. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  288. // +optional
  289. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  290. // Specification of the desired behavior for this NetworkPolicy.
  291. // +optional
  292. optional NetworkPolicySpec spec = 2;
  293. }
  294. // NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods
  295. // matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to.
  296. // This type is beta-level in 1.8
  297. message NetworkPolicyEgressRule {
  298. // List of destination ports for outgoing traffic.
  299. // Each item in this list is combined using a logical OR. If this field is
  300. // empty or missing, this rule matches all ports (traffic not restricted by port).
  301. // If this field is present and contains at least one item, then this rule allows
  302. // traffic only if the traffic matches at least one port in the list.
  303. // +optional
  304. repeated NetworkPolicyPort ports = 1;
  305. // List of destinations for outgoing traffic of pods selected for this rule.
  306. // Items in this list are combined using a logical OR operation. If this field is
  307. // empty or missing, this rule matches all destinations (traffic not restricted by
  308. // destination). If this field is present and contains at least one item, this rule
  309. // allows traffic only if the traffic matches at least one item in the to list.
  310. // +optional
  311. repeated NetworkPolicyPeer to = 2;
  312. }
  313. // NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
  314. // matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
  315. message NetworkPolicyIngressRule {
  316. // List of ports which should be made accessible on the pods selected for this
  317. // rule. Each item in this list is combined using a logical OR. If this field is
  318. // empty or missing, this rule matches all ports (traffic not restricted by port).
  319. // If this field is present and contains at least one item, then this rule allows
  320. // traffic only if the traffic matches at least one port in the list.
  321. // +optional
  322. repeated NetworkPolicyPort ports = 1;
  323. // List of sources which should be able to access the pods selected for this rule.
  324. // Items in this list are combined using a logical OR operation. If this field is
  325. // empty or missing, this rule matches all sources (traffic not restricted by
  326. // source). If this field is present and contains at least one item, this rule
  327. // allows traffic only if the traffic matches at least one item in the from list.
  328. // +optional
  329. repeated NetworkPolicyPeer from = 2;
  330. }
  331. // NetworkPolicyList is a list of NetworkPolicy objects.
  332. message NetworkPolicyList {
  333. // Standard list metadata.
  334. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  335. // +optional
  336. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  337. // Items is a list of schema objects.
  338. repeated NetworkPolicy items = 2;
  339. }
  340. // NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of
  341. // fields are allowed
  342. message NetworkPolicyPeer {
  343. // This is a label selector which selects Pods. This field follows standard label
  344. // selector semantics; if present but empty, it selects all pods.
  345. //
  346. // If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects
  347. // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
  348. // Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
  349. // +optional
  350. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
  351. // Selects Namespaces using cluster-scoped labels. This field follows standard label
  352. // selector semantics; if present but empty, it selects all namespaces.
  353. //
  354. // If PodSelector is also set, then the NetworkPolicyPeer as a whole selects
  355. // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
  356. // Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
  357. // +optional
  358. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
  359. // IPBlock defines policy on a particular IPBlock. If this field is set then
  360. // neither of the other fields can be.
  361. // +optional
  362. optional IPBlock ipBlock = 3;
  363. }
  364. // NetworkPolicyPort describes a port to allow traffic on
  365. message NetworkPolicyPort {
  366. // The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this
  367. // field defaults to TCP.
  368. // +optional
  369. optional string protocol = 1;
  370. // The port on the given protocol. This can either be a numerical or named
  371. // port on a pod. If this field is not provided, this matches all port names and
  372. // numbers.
  373. // If present, only traffic on the specified protocol AND port will be matched.
  374. // +optional
  375. optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
  376. // If set, indicates that the range of ports from port to endPort, inclusive,
  377. // should be allowed by the policy. This field cannot be defined if the port field
  378. // is not defined or if the port field is defined as a named (string) port.
  379. // The endPort must be equal or greater than port.
  380. // This feature is in Beta state and is enabled by default.
  381. // It can be disabled using the Feature Gate "NetworkPolicyEndPort".
  382. // +optional
  383. optional int32 endPort = 3;
  384. }
  385. // NetworkPolicySpec provides the specification of a NetworkPolicy
  386. message NetworkPolicySpec {
  387. // Selects the pods to which this NetworkPolicy object applies. The array of
  388. // ingress rules is applied to any pods selected by this field. Multiple network
  389. // policies can select the same set of pods. In this case, the ingress rules for
  390. // each are combined additively. This field is NOT optional and follows standard
  391. // label selector semantics. An empty podSelector matches all pods in this
  392. // namespace.
  393. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
  394. // List of ingress rules to be applied to the selected pods. Traffic is allowed to
  395. // a pod if there are no NetworkPolicies selecting the pod
  396. // (and cluster policy otherwise allows the traffic), OR if the traffic source is
  397. // the pod's local node, OR if the traffic matches at least one ingress rule
  398. // across all of the NetworkPolicy objects whose podSelector matches the pod. If
  399. // this field is empty then this NetworkPolicy does not allow any traffic (and serves
  400. // solely to ensure that the pods it selects are isolated by default)
  401. // +optional
  402. repeated NetworkPolicyIngressRule ingress = 2;
  403. // List of egress rules to be applied to the selected pods. Outgoing traffic is
  404. // allowed if there are no NetworkPolicies selecting the pod (and cluster policy
  405. // otherwise allows the traffic), OR if the traffic matches at least one egress rule
  406. // across all of the NetworkPolicy objects whose podSelector matches the pod. If
  407. // this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
  408. // solely to ensure that the pods it selects are isolated by default).
  409. // This field is beta-level in 1.8
  410. // +optional
  411. repeated NetworkPolicyEgressRule egress = 3;
  412. // List of rule types that the NetworkPolicy relates to.
  413. // Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"].
  414. // If this field is not specified, it will default based on the existence of Ingress or Egress rules;
  415. // policies that contain an Egress section are assumed to affect Egress, and all policies
  416. // (whether or not they contain an Ingress section) are assumed to affect Ingress.
  417. // If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
  418. // Likewise, if you want to write a policy that specifies that no egress is allowed,
  419. // you must specify a policyTypes value that include "Egress" (since such a policy would not include
  420. // an Egress section and would otherwise default to just [ "Ingress" ]).
  421. // This field is beta-level in 1.8
  422. // +optional
  423. repeated string policyTypes = 4;
  424. }
  425. // ServiceBackendPort is the service port being referenced.
  426. message ServiceBackendPort {
  427. // Name is the name of the port on the Service.
  428. // This is a mutually exclusive setting with "Number".
  429. // +optional
  430. optional string name = 1;
  431. // Number is the numerical port number (e.g. 80) on the Service.
  432. // This is a mutually exclusive setting with "Name".
  433. // +optional
  434. optional int32 number = 2;
  435. }