-
Notifications
You must be signed in to change notification settings - Fork 1
/
ServicePort.go
37 lines (34 loc) · 1.43 KB
/
ServicePort.go
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
package cdk8splus29
// Definition of a service port.
type ServicePort struct {
// 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.
Name *string `field:"optional" json:"name" yaml:"name"`
// 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.
// See: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
//
// Default: - auto-allocate a port if the ServiceType of this Service requires one.
//
NodePort *float64 `field:"optional" json:"nodePort" yaml:"nodePort"`
// The IP protocol for this port.
//
// Supports "TCP", "UDP", and "SCTP". Default is TCP.
// Default: Protocol.TCP
//
Protocol Protocol `field:"optional" json:"protocol" yaml:"protocol"`
// The port number the service will redirect to.
// Default: - The value of `port` will be used.
//
TargetPort *float64 `field:"optional" json:"targetPort" yaml:"targetPort"`
// The port number the service will bind to.
Port *float64 `field:"required" json:"port" yaml:"port"`
}