mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Add Type to ServiceSpec: ClusterIP or LoadBalancer
This commit is contained in:
@@ -1011,6 +1011,20 @@ const (
|
||||
ServiceAffinityNone ServiceAffinity = "None"
|
||||
)
|
||||
|
||||
// Service Type string describes ingress methods for a service
|
||||
type ServiceType string
|
||||
|
||||
const (
|
||||
// ServiceTypeClusterIP means a service will only be accessible inside the
|
||||
// cluster, via the portal IP.
|
||||
ServiceTypeClusterIP ServiceType = "ClusterIP"
|
||||
|
||||
// ServiceTypeLoadBalancer means a service will be exposed via an
|
||||
// external load balancer (if the cloud provider supports it), in addition
|
||||
// to 'NodePort' type.
|
||||
ServiceTypeLoadBalancer ServiceType = "LoadBalancer"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service
|
||||
type ServiceStatus struct {
|
||||
// LoadBalancer contains the current status of the load-balancer,
|
||||
@@ -1054,8 +1068,9 @@ type ServiceSpec struct {
|
||||
// None can be specified for headless services when proxying is not required
|
||||
PortalIP string `json:"portalIP,omitempty"`
|
||||
|
||||
// CreateExternalLoadBalancer indicates whether a load balancer should be created for this service.
|
||||
CreateExternalLoadBalancer bool `json:"createExternalLoadBalancer,omitempty"`
|
||||
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
|
||||
Type ServiceType `json:"type,omitempty"`
|
||||
|
||||
// PublicIPs are used by external load balancers, or can be set by
|
||||
// users to handle external traffic that arrives at a node.
|
||||
// For load balancers, the publicIP will usually be the IP address of the load balancer,
|
||||
|
||||
Reference in New Issue
Block a user