Service resource fields
The Service
resource defines the Kubernetes service. For the Application Load Balancer Ingress controller for Managed Service for Kubernetes, the services are backends the incoming traffic is distributed across.
For the Ingress controller, you can indicate the service to use as a backend:
- Directly in the
Ingress
resource. - As part of a backend group in the
HttpBackendGroup
resource.
Service
is a standard Kubernetes resource. This reference describes the fields and the annotations of the resource that the Application Load Balancer tools for Managed Service for Kubernetes interface with. For a complete reference on the resource, please see the Kubernetes documentation
Service
apiVersion: v1
kind: Service
metadata:
name: <string>
spec:
type: NodePort
ports:
- name: <string>
port: <int32>
protocol: TCP
nodePort: <int32>
- ...
Where:
-
apiVersion
:v1
-
kind
:Service
-
metadata
(ObjectMeta
, required)Resource metadata.
-
name
(string
, required)Resource name. For more information about format, please see the Kubernetes documentation
.
-
-
spec
(ServiceSpec
)Resource specification.
-
type
:NodePort
Warning
The Kubernetes services used as backends (as specified in the
Ingress
rules directly or inHttpBackendGroup
), must be ofNodePort
type. For more details on this type, please see the Kubernetes documentation . -
ports
([]ServicePort
)List of ports where the service is available.
-
port
(int32
, required)Number of port where the service is available.
You can use this number if you designate a service as a backend:
-
name
(string
)Port name internal to a service.
You can use this name if you designate a service as a backend:
-
protocol
:TCP
-
nodePort
(int32
)Number of port exposed on the cluster nodes where the service is deployed. The load balancer forwards traffic to this port, whereas Kubernetes redirects the traffic to the service to its
port
.Corresponds to the backend port in the Application Load Balancer backend group.
-
-