-
Notifications
You must be signed in to change notification settings - Fork 0
/
service_port.cr
49 lines (41 loc) · 3.16 KB
/
service_port.cr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# THIS FILE WAS AUTO GENERATED FROM THE K8S SWAGGER SPEC
require "yaml"
require "json"
module K8S
# ServicePort contains information on service's port.
@[::K8S::Properties(
name: {type: String, nilable: true, key: "name", getter: false, setter: false},
node_port: {type: Int32, nilable: true, key: "nodePort", getter: false, setter: false},
port: {type: Int32, nilable: false, key: "port", getter: false, setter: false},
protocol: {type: String, nilable: true, key: "protocol", getter: false, setter: false},
target_port: {type: Int32 | String, nilable: true, key: "targetPort", getter: false, setter: false},
)]
class Api::Core::V1::ServicePort
include ::JSON::Serializable
include ::JSON::Serializable::Unmapped
include ::YAML::Serializable
include ::YAML::Serializable::Unmapped
# The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.
@[::JSON::Field(key: "name", emit_null: false)]
@[::YAML::Field(key: "name", emit_null: false)]
property name : String | Nil
# The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: [https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport)
@[::JSON::Field(key: "nodePort", emit_null: false)]
@[::YAML::Field(key: "nodePort", emit_null: false)]
property node_port : Int32 | Nil
# The port that will be exposed by this service.
@[::JSON::Field(key: "port", emit_null: true)]
@[::YAML::Field(key: "port", emit_null: true)]
property port : Int32
# The IP protocol for this port. Supports "TCP" and "UDP". Default is TCP.
@[::JSON::Field(key: "protocol", emit_null: false)]
@[::YAML::Field(key: "protocol", emit_null: false)]
property protocol : String | Nil
# Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: [https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service)
@[::JSON::Field(key: "targetPort", emit_null: false)]
@[::YAML::Field(key: "targetPort", emit_null: false)]
property target_port : Int32 | String | Nil
def initialize(*, @port : Int32, @name : String | Nil = nil, @node_port : Int32 | Nil = nil, @protocol : String | Nil = nil, @target_port : Int32 | String | Nil = nil)
end
end
end