Fields and annotations of the Service resource for the Gateway API
The Service
resource corresponds to the Kubernetes service. For the Gateway API, services are backends between which the incoming traffic is distributed within a Managed Service for Kubernetes cluster. Services representing Application Load Balancer backends are specified in the HTTPRoute resource.
Service
is a standard Kubernetes resource. Below, you can find the descriptions of the resource fields and annotations the Application Load Balancer tools for Managed Service for Kubernetes interface with. For a full description of the resource configuration, see the Kubernetes documentation
Service
apiVersion: v1
kind: Service
metadata:
name: <string>
spec: <ServiceSpec>
Field |
Value or type |
Description |
|
|
Required. Kubernetes API version. |
|
|
Resource type. |
|
|
Required. Resource metadata. |
|
|
Required. This name is not the balancer name in Application Load Balancer. |
|
|
Required. Resource specification. |
Example
apiVersion: v1
kind: Service
metadata:
name: alb-demo-1
spec:
selector:
app: alb-demo-1
type: NodePort
ports:
- name: http
port: 80
protocol: TCP
nodePort: 30081
ServiceSpec
type: NodePort
ports:
- <ServicePort>
-
Field |
Value or type |
Description |
|
|
Required. Service type. Warning The Kubernetes services used as backends (as specified in the |
|
|
Required. List of ports where the service is available. |
ServicePort
port: <int32>
name: <string>
protocol: <protocol>
nodePort: <int32>
Field |
Value or type |
Description |
|
|
Required. You can use this number if you designate a service as a backend:
|
|
|
Port name within the service. You can use this name if you designate a service as a backend:
|
|
|
Network protocol for the port. |
|
|
Number of the port opened on the cluster nodes on which the service is deployed. The load balancer sends traffic to this port, and Kubernetes forwards the traffic to the service on its port in the Corresponds to the backend port in the Application Load Balancer backend group. |