generated.proto 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  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 = "k8s.io/api/networking/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. // paths is a collection of paths that map requests to backends.
  58. // +listType=atomic
  59. repeated HTTPIngressPath paths = 1;
  60. }
  61. // IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs
  62. // that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses.
  63. // An IP address can be represented in different formats, to guarantee the uniqueness of the IP,
  64. // the name of the object is the IP address in canonical format, four decimal digits separated
  65. // by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6.
  66. // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1
  67. // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1
  68. message IPAddress {
  69. // Standard object's metadata.
  70. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  71. // +optional
  72. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  73. // spec is the desired state of the IPAddress.
  74. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  75. // +optional
  76. optional IPAddressSpec spec = 2;
  77. }
  78. // IPAddressList contains a list of IPAddress.
  79. message IPAddressList {
  80. // Standard object's metadata.
  81. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  82. // +optional
  83. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  84. // items is the list of IPAddresses.
  85. repeated IPAddress items = 2;
  86. }
  87. // IPAddressSpec describe the attributes in an IP Address.
  88. message IPAddressSpec {
  89. // ParentRef references the resource that an IPAddress is attached to.
  90. // An IPAddress must reference a parent object.
  91. // +required
  92. optional ParentReference parentRef = 1;
  93. }
  94. // IPBlock describes a particular CIDR (Ex. "192.168.1.0/24","2001:db8::/64") that is allowed
  95. // to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs
  96. // that should not be included within this rule.
  97. message IPBlock {
  98. // cidr is a string representing the IPBlock
  99. // Valid examples are "192.168.1.0/24" or "2001:db8::/64"
  100. optional string cidr = 1;
  101. // except is a slice of CIDRs that should not be included within an IPBlock
  102. // Valid examples are "192.168.1.0/24" or "2001:db8::/64"
  103. // Except values will be rejected if they are outside the cidr range
  104. // +optional
  105. // +listType=atomic
  106. repeated string except = 2;
  107. }
  108. // Ingress is a collection of rules that allow inbound connections to reach the
  109. // endpoints defined by a backend. An Ingress can be configured to give services
  110. // externally-reachable urls, load balance traffic, terminate SSL, offer name
  111. // based virtual hosting etc.
  112. message Ingress {
  113. // Standard object's metadata.
  114. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  115. // +optional
  116. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  117. // spec is the desired state of the Ingress.
  118. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  119. // +optional
  120. optional IngressSpec spec = 2;
  121. // status is the current state of the Ingress.
  122. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  123. // +optional
  124. optional IngressStatus status = 3;
  125. }
  126. // IngressBackend describes all endpoints for a given service and port.
  127. message IngressBackend {
  128. // service references a service as a backend.
  129. // This is a mutually exclusive setting with "Resource".
  130. // +optional
  131. optional IngressServiceBackend service = 4;
  132. // resource is an ObjectRef to another Kubernetes resource in the namespace
  133. // of the Ingress object. If resource is specified, a service.Name and
  134. // service.Port must not be specified.
  135. // This is a mutually exclusive setting with "Service".
  136. // +optional
  137. optional .k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
  138. }
  139. // IngressClass represents the class of the Ingress, referenced by the Ingress
  140. // Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be
  141. // used to indicate that an IngressClass should be considered default. When a
  142. // single IngressClass resource has this annotation set to true, new Ingress
  143. // resources without a class specified will be assigned this default class.
  144. message IngressClass {
  145. // Standard object's metadata.
  146. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  147. // +optional
  148. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  149. // spec is the desired state of the IngressClass.
  150. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  151. // +optional
  152. optional IngressClassSpec spec = 2;
  153. }
  154. // IngressClassList is a collection of IngressClasses.
  155. message IngressClassList {
  156. // Standard list metadata.
  157. // +optional
  158. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  159. // items is the list of IngressClasses.
  160. repeated IngressClass items = 2;
  161. }
  162. // IngressClassParametersReference identifies an API object. This can be used
  163. // to specify a cluster or namespace-scoped resource.
  164. message IngressClassParametersReference {
  165. // apiGroup is the group for the resource being referenced. If APIGroup is
  166. // not specified, the specified Kind must be in the core API group. For any
  167. // other third-party types, APIGroup is required.
  168. // +optional
  169. optional string aPIGroup = 1;
  170. // kind is the type of resource being referenced.
  171. optional string kind = 2;
  172. // name is the name of resource being referenced.
  173. optional string name = 3;
  174. // scope represents if this refers to a cluster or namespace scoped resource.
  175. // This may be set to "Cluster" (default) or "Namespace".
  176. // +optional
  177. optional string scope = 4;
  178. // namespace is the namespace of the resource being referenced. This field is
  179. // required when scope is set to "Namespace" and must be unset when scope is set to
  180. // "Cluster".
  181. // +optional
  182. optional string namespace = 5;
  183. }
  184. // IngressClassSpec provides information about the class of an Ingress.
  185. message IngressClassSpec {
  186. // controller refers to the name of the controller that should handle this
  187. // class. This allows for different "flavors" that are controlled by the
  188. // same controller. For example, you may have different parameters for the
  189. // same implementing controller. This should be specified as a
  190. // domain-prefixed path no more than 250 characters in length, e.g.
  191. // "acme.io/ingress-controller". This field is immutable.
  192. optional string controller = 1;
  193. // parameters is a link to a custom resource containing additional
  194. // configuration for the controller. This is optional if the controller does
  195. // not require extra parameters.
  196. // +optional
  197. optional IngressClassParametersReference parameters = 2;
  198. }
  199. // IngressList is a collection of Ingress.
  200. message IngressList {
  201. // Standard object's metadata.
  202. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  203. // +optional
  204. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  205. // items is the list of Ingress.
  206. repeated Ingress items = 2;
  207. }
  208. // IngressLoadBalancerIngress represents the status of a load-balancer ingress point.
  209. message IngressLoadBalancerIngress {
  210. // ip is set for load-balancer ingress points that are IP based.
  211. // +optional
  212. optional string ip = 1;
  213. // hostname is set for load-balancer ingress points that are DNS based.
  214. // +optional
  215. optional string hostname = 2;
  216. // ports provides information about the ports exposed by this LoadBalancer.
  217. // +listType=atomic
  218. // +optional
  219. repeated IngressPortStatus ports = 4;
  220. }
  221. // IngressLoadBalancerStatus represents the status of a load-balancer.
  222. message IngressLoadBalancerStatus {
  223. // ingress is a list containing ingress points for the load-balancer.
  224. // +optional
  225. // +listType=atomic
  226. repeated IngressLoadBalancerIngress ingress = 1;
  227. }
  228. // IngressPortStatus represents the error condition of a service port
  229. message IngressPortStatus {
  230. // port is the port number of the ingress port.
  231. optional int32 port = 1;
  232. // protocol is the protocol of the ingress port.
  233. // The supported values are: "TCP", "UDP", "SCTP"
  234. optional string protocol = 2;
  235. // error is to record the problem with the service port
  236. // The format of the error shall comply with the following rules:
  237. // - built-in error values shall be specified in this file and those shall use
  238. // CamelCase names
  239. // - cloud provider specific error values must have names that comply with the
  240. // format foo.example.com/CamelCase.
  241. // ---
  242. // The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  243. // +optional
  244. // +kubebuilder:validation:Required
  245. // +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])$`
  246. // +kubebuilder:validation:MaxLength=316
  247. optional string error = 3;
  248. }
  249. // IngressRule represents the rules mapping the paths under a specified host to
  250. // the related backend services. Incoming requests are first evaluated for a host
  251. // match, then routed to the backend associated with the matching IngressRuleValue.
  252. message IngressRule {
  253. // host is the fully qualified domain name of a network host, as defined by RFC 3986.
  254. // Note the following deviations from the "host" part of the
  255. // URI as defined in RFC 3986:
  256. // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to
  257. // the IP in the Spec of the parent Ingress.
  258. // 2. The `:` delimiter is not respected because ports are not allowed.
  259. // Currently the port of an Ingress is implicitly :80 for http and
  260. // :443 for https.
  261. // Both these may change in the future.
  262. // Incoming requests are matched against the host before the
  263. // IngressRuleValue. If the host is unspecified, the Ingress routes all
  264. // traffic based on the specified IngressRuleValue.
  265. //
  266. // host can be "precise" which is a domain name without the terminating dot of
  267. // a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name
  268. // prefixed with a single wildcard label (e.g. "*.foo.com").
  269. // The wildcard character '*' must appear by itself as the first DNS label and
  270. // matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*").
  271. // Requests will be matched against the Host field in the following way:
  272. // 1. If host is precise, the request matches this rule if the http host header is equal to Host.
  273. // 2. If host is a wildcard, then the request matches this rule if the http host header
  274. // is to equal to the suffix (removing the first label) of the wildcard rule.
  275. // +optional
  276. optional string host = 1;
  277. // IngressRuleValue represents a rule to route requests for this IngressRule.
  278. // If unspecified, the rule defaults to a http catch-all. Whether that sends
  279. // just traffic matching the host to the default backend or all traffic to the
  280. // default backend, is left to the controller fulfilling the Ingress. Http is
  281. // currently the only supported IngressRuleValue.
  282. // +optional
  283. optional IngressRuleValue ingressRuleValue = 2;
  284. }
  285. // IngressRuleValue represents a rule to apply against incoming requests. If the
  286. // rule is satisfied, the request is routed to the specified backend. Currently
  287. // mixing different types of rules in a single Ingress is disallowed, so exactly
  288. // one of the following must be set.
  289. message IngressRuleValue {
  290. // +optional
  291. optional HTTPIngressRuleValue http = 1;
  292. }
  293. // IngressServiceBackend references a Kubernetes Service as a Backend.
  294. message IngressServiceBackend {
  295. // name is the referenced service. The service must exist in
  296. // the same namespace as the Ingress object.
  297. optional string name = 1;
  298. // port of the referenced service. A port name or port number
  299. // is required for a IngressServiceBackend.
  300. optional ServiceBackendPort port = 2;
  301. }
  302. // IngressSpec describes the Ingress the user wishes to exist.
  303. message IngressSpec {
  304. // ingressClassName is the name of an IngressClass cluster resource. Ingress
  305. // controller implementations use this field to know whether they should be
  306. // serving this Ingress resource, by a transitive connection
  307. // (controller -> IngressClass -> Ingress resource). Although the
  308. // `kubernetes.io/ingress.class` annotation (simple constant name) was never
  309. // formally defined, it was widely supported by Ingress controllers to create
  310. // a direct binding between Ingress controller and Ingress resources. Newly
  311. // created Ingress resources should prefer using the field. However, even
  312. // though the annotation is officially deprecated, for backwards compatibility
  313. // reasons, ingress controllers should still honor that annotation if present.
  314. // +optional
  315. optional string ingressClassName = 4;
  316. // defaultBackend is the backend that should handle requests that don't
  317. // match any rule. If Rules are not specified, DefaultBackend must be specified.
  318. // If DefaultBackend is not set, the handling of requests that do not match any
  319. // of the rules will be up to the Ingress controller.
  320. // +optional
  321. optional IngressBackend defaultBackend = 1;
  322. // tls represents the TLS configuration. Currently the Ingress only supports a
  323. // single TLS port, 443. If multiple members of this list specify different hosts,
  324. // they will be multiplexed on the same port according to the hostname specified
  325. // through the SNI TLS extension, if the ingress controller fulfilling the
  326. // ingress supports SNI.
  327. // +listType=atomic
  328. // +optional
  329. repeated IngressTLS tls = 2;
  330. // rules is a list of host rules used to configure the Ingress. If unspecified,
  331. // or no rule matches, all traffic is sent to the default backend.
  332. // +listType=atomic
  333. // +optional
  334. repeated IngressRule rules = 3;
  335. }
  336. // IngressStatus describe the current state of the Ingress.
  337. message IngressStatus {
  338. // loadBalancer contains the current status of the load-balancer.
  339. // +optional
  340. optional IngressLoadBalancerStatus loadBalancer = 1;
  341. }
  342. // IngressTLS describes the transport layer security associated with an ingress.
  343. message IngressTLS {
  344. // hosts is a list of hosts included in the TLS certificate. The values in
  345. // this list must match the name/s used in the tlsSecret. Defaults to the
  346. // wildcard host setting for the loadbalancer controller fulfilling this
  347. // Ingress, if left unspecified.
  348. // +listType=atomic
  349. // +optional
  350. repeated string hosts = 1;
  351. // secretName is the name of the secret used to terminate TLS traffic on
  352. // port 443. Field is left optional to allow TLS routing based on SNI
  353. // hostname alone. If the SNI host in a listener conflicts with the "Host"
  354. // header field used by an IngressRule, the SNI host is used for termination
  355. // and value of the "Host" header is used for routing.
  356. // +optional
  357. optional string secretName = 2;
  358. }
  359. // NetworkPolicy describes what network traffic is allowed for a set of Pods
  360. message NetworkPolicy {
  361. // Standard object's metadata.
  362. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  363. // +optional
  364. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  365. // spec represents the specification of the desired behavior for this NetworkPolicy.
  366. // +optional
  367. optional NetworkPolicySpec spec = 2;
  368. }
  369. // NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods
  370. // matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to.
  371. // This type is beta-level in 1.8
  372. message NetworkPolicyEgressRule {
  373. // ports is a list of destination ports for outgoing traffic.
  374. // Each item in this list is combined using a logical OR. If this field is
  375. // empty or missing, this rule matches all ports (traffic not restricted by port).
  376. // If this field is present and contains at least one item, then this rule allows
  377. // traffic only if the traffic matches at least one port in the list.
  378. // +optional
  379. // +listType=atomic
  380. repeated NetworkPolicyPort ports = 1;
  381. // to is a list of destinations for outgoing traffic of pods selected for this rule.
  382. // Items in this list are combined using a logical OR operation. If this field is
  383. // empty or missing, this rule matches all destinations (traffic not restricted by
  384. // destination). If this field is present and contains at least one item, this rule
  385. // allows traffic only if the traffic matches at least one item in the to list.
  386. // +optional
  387. // +listType=atomic
  388. repeated NetworkPolicyPeer to = 2;
  389. }
  390. // NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
  391. // matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
  392. message NetworkPolicyIngressRule {
  393. // ports is a list of ports which should be made accessible on the pods selected for
  394. // this rule. Each item in this list is combined using a logical OR. If this field is
  395. // empty or missing, this rule matches all ports (traffic not restricted by port).
  396. // If this field is present and contains at least one item, then this rule allows
  397. // traffic only if the traffic matches at least one port in the list.
  398. // +optional
  399. // +listType=atomic
  400. repeated NetworkPolicyPort ports = 1;
  401. // from is a list of sources which should be able to access the pods selected for this rule.
  402. // Items in this list are combined using a logical OR operation. If this field is
  403. // empty or missing, this rule matches all sources (traffic not restricted by
  404. // source). If this field is present and contains at least one item, this rule
  405. // allows traffic only if the traffic matches at least one item in the from list.
  406. // +optional
  407. // +listType=atomic
  408. repeated NetworkPolicyPeer from = 2;
  409. }
  410. // NetworkPolicyList is a list of NetworkPolicy objects.
  411. message NetworkPolicyList {
  412. // Standard list metadata.
  413. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  414. // +optional
  415. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  416. // items is a list of schema objects.
  417. repeated NetworkPolicy items = 2;
  418. }
  419. // NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of
  420. // fields are allowed
  421. message NetworkPolicyPeer {
  422. // podSelector is a label selector which selects pods. This field follows standard label
  423. // selector semantics; if present but empty, it selects all pods.
  424. //
  425. // If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects
  426. // the pods matching podSelector in the Namespaces selected by NamespaceSelector.
  427. // Otherwise it selects the pods matching podSelector in the policy's own namespace.
  428. // +optional
  429. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
  430. // namespaceSelector selects namespaces using cluster-scoped labels. This field follows
  431. // standard label selector semantics; if present but empty, it selects all namespaces.
  432. //
  433. // If podSelector is also set, then the NetworkPolicyPeer as a whole selects
  434. // the pods matching podSelector in the namespaces selected by namespaceSelector.
  435. // Otherwise it selects all pods in the namespaces selected by namespaceSelector.
  436. // +optional
  437. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
  438. // ipBlock defines policy on a particular IPBlock. If this field is set then
  439. // neither of the other fields can be.
  440. // +optional
  441. optional IPBlock ipBlock = 3;
  442. }
  443. // NetworkPolicyPort describes a port to allow traffic on
  444. message NetworkPolicyPort {
  445. // protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match.
  446. // If not specified, this field defaults to TCP.
  447. // +optional
  448. optional string protocol = 1;
  449. // port represents the port on the given protocol. This can either be a numerical or named
  450. // port on a pod. If this field is not provided, this matches all port names and
  451. // numbers.
  452. // If present, only traffic on the specified protocol AND port will be matched.
  453. // +optional
  454. optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
  455. // endPort indicates that the range of ports from port to endPort if set, inclusive,
  456. // should be allowed by the policy. This field cannot be defined if the port field
  457. // is not defined or if the port field is defined as a named (string) port.
  458. // The endPort must be equal or greater than port.
  459. // +optional
  460. optional int32 endPort = 3;
  461. }
  462. // NetworkPolicySpec provides the specification of a NetworkPolicy
  463. message NetworkPolicySpec {
  464. // podSelector selects the pods to which this NetworkPolicy object applies.
  465. // The array of rules is applied to any pods selected by this field. An empty
  466. // selector matches all pods in the policy's namespace.
  467. // Multiple network policies can select the same set of pods. In this case,
  468. // the ingress rules for each are combined additively.
  469. // This field is optional. If it is not specified, it defaults to an empty selector.
  470. // +optional
  471. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
  472. // ingress is a list of ingress rules to be applied to the selected pods.
  473. // Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
  474. // (and cluster policy otherwise allows the traffic), OR if the traffic source is
  475. // the pod's local node, OR if the traffic matches at least one ingress rule
  476. // across all of the NetworkPolicy objects whose podSelector matches the pod. If
  477. // this field is empty then this NetworkPolicy does not allow any traffic (and serves
  478. // solely to ensure that the pods it selects are isolated by default)
  479. // +optional
  480. // +listType=atomic
  481. repeated NetworkPolicyIngressRule ingress = 2;
  482. // egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
  483. // is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
  484. // otherwise allows the traffic), OR if the traffic matches at least one egress rule
  485. // across all of the NetworkPolicy objects whose podSelector matches the pod. If
  486. // this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
  487. // solely to ensure that the pods it selects are isolated by default).
  488. // This field is beta-level in 1.8
  489. // +optional
  490. // +listType=atomic
  491. repeated NetworkPolicyEgressRule egress = 3;
  492. // policyTypes is a list of rule types that the NetworkPolicy relates to.
  493. // Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"].
  494. // If this field is not specified, it will default based on the existence of ingress or egress rules;
  495. // policies that contain an egress section are assumed to affect egress, and all policies
  496. // (whether or not they contain an ingress section) are assumed to affect ingress.
  497. // If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
  498. // Likewise, if you want to write a policy that specifies that no egress is allowed,
  499. // you must specify a policyTypes value that include "Egress" (since such a policy would not include
  500. // an egress section and would otherwise default to just [ "Ingress" ]).
  501. // This field is beta-level in 1.8
  502. // +optional
  503. // +listType=atomic
  504. repeated string policyTypes = 4;
  505. }
  506. // ParentReference describes a reference to a parent object.
  507. message ParentReference {
  508. // Group is the group of the object being referenced.
  509. // +optional
  510. optional string group = 1;
  511. // Resource is the resource of the object being referenced.
  512. // +required
  513. optional string resource = 2;
  514. // Namespace is the namespace of the object being referenced.
  515. // +optional
  516. optional string namespace = 3;
  517. // Name is the name of the object being referenced.
  518. // +required
  519. optional string name = 4;
  520. }
  521. // ServiceBackendPort is the service port being referenced.
  522. // +structType=atomic
  523. message ServiceBackendPort {
  524. // name is the name of the port on the Service.
  525. // This is a mutually exclusive setting with "Number".
  526. // +optional
  527. optional string name = 1;
  528. // number is the numerical port number (e.g. 80) on the Service.
  529. // This is a mutually exclusive setting with "Name".
  530. // +optional
  531. optional int32 number = 2;
  532. }
  533. // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64).
  534. // This range is used to allocate ClusterIPs to Service objects.
  535. message ServiceCIDR {
  536. // Standard object's metadata.
  537. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  538. // +optional
  539. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  540. // spec is the desired state of the ServiceCIDR.
  541. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  542. // +optional
  543. optional ServiceCIDRSpec spec = 2;
  544. // status represents the current state of the ServiceCIDR.
  545. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  546. // +optional
  547. optional ServiceCIDRStatus status = 3;
  548. }
  549. // ServiceCIDRList contains a list of ServiceCIDR objects.
  550. message ServiceCIDRList {
  551. // Standard object's metadata.
  552. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  553. // +optional
  554. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  555. // items is the list of ServiceCIDRs.
  556. repeated ServiceCIDR items = 2;
  557. }
  558. // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.
  559. message ServiceCIDRSpec {
  560. // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64")
  561. // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family.
  562. // This field is immutable.
  563. // +optional
  564. // +listType=atomic
  565. repeated string cidrs = 1;
  566. }
  567. // ServiceCIDRStatus describes the current state of the ServiceCIDR.
  568. message ServiceCIDRStatus {
  569. // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR.
  570. // Current service state
  571. // +optional
  572. // +patchMergeKey=type
  573. // +patchStrategy=merge
  574. // +listType=map
  575. // +listMapKey=type
  576. repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
  577. }