v1
·Service
Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.
Click on Property Name to show the description, and Pink Types to expand schema.
Required properties are marked with *
Change History
Kubernetes v1.34
Kubernetes v1.33
1 property has changed the description
- .spec.trafficDistribution
Kubernetes v1.32
1 property has changed the description
- .spec.trafficDistribution
Kubernetes v1.31
1 property has changed the description
- .spec.trafficDistribution
Kubernetes v1.30
1 property has been added on this version
- .spec.trafficDistribution
Kubernetes v1.29
1 property has been added on this version
- .status.loadBalancer.ingress.ipMode
1 property has changed the description
- .spec.ports.appProtocol
Kubernetes v1.28
2 properties have changed the description
- .spec.loadBalancerIP
- .spec.ports.appProtocol
Kubernetes v1.27
12 properties have changed the description
- .metadata.annotations
- .metadata.labels
- .metadata.name
- .metadata.namespace
- .metadata.ownerReferences.name
- .metadata.ownerReferences.uid
- .metadata.uid
- .spec.externalTrafficPolicy
- .spec.ports.protocol
- .spec.sessionAffinity
- .spec.type
- .status.loadBalancer.ingress.ports.protocol
Kubernetes v1.26
Kubernetes v1.25
1 property has been removed on this version
- .metadata.clusterName
3 properties have changed the description
- .spec.externalTrafficPolicy
- .spec.healthCheckNodePort
- .spec.internalTrafficPolicy
Kubernetes v1.24
13 properties have changed the description
- .metadata.clusterName
- .metadata.generateName
- .metadata.managedFields.time
- .metadata.ownerReferences.blockOwnerDeletion
- .metadata.selfLink
- .spec.allocateLoadBalancerNodePorts
- .spec.externalTrafficPolicy
- .spec.loadBalancerIP
- .spec.ports.appProtocol
- .spec.ports.protocol
- .spec.sessionAffinity
- .spec.type
- .status.loadBalancer.ingress.ports.protocol
Kubernetes v1.23
8 properties have changed the description
- .spec.clusterIPs
- .spec.externalTrafficPolicy
- .spec.ipFamilies
- .spec.ipFamilyPolicy
- .spec.ports.protocol
- .spec.sessionAffinity
- .spec.type
- .status.loadBalancer.ingress.ports.protocol
Kubernetes v1.22
1 property has been added on this version
- .metadata.managedFields.subresource
1 property has been removed on this version
- .spec.topologyKeys
3 properties have changed the description
- .spec.allocateLoadBalancerNodePorts
- .spec.loadBalancerSourceRanges
- .spec.ports.appProtocol
Kubernetes v1.21
2 properties have been added on this version
- .spec.internalTrafficPolicy
- .spec.loadBalancerClass
2 properties have changed the description
- .spec.externalName
- .spec.topologyKeys
Kubernetes v1.20
6 properties have been added on this version
- .spec.allocateLoadBalancerNodePorts
- .spec.clusterIPs
- .spec.ipFamilies
- .spec.ipFamilyPolicy
- .status.conditions
- .status.loadBalancer.ingress.ports
1 property has been removed on this version
- .spec.ipFamily
6 properties have changed the description
- .spec.clusterIP
- .spec.externalName
- .spec.healthCheckNodePort
- .spec.ports.nodePort
- .spec.topologyKeys
- .spec.type
Kubernetes v1.19
4 properties have changed the description
- .metadata.namespace
- .spec.ipFamily
- .spec.ports.appProtocol
- .spec.publishNotReadyAddresses
Kubernetes v1.18
1 property has been added on this version
- .spec.ports.appProtocol
Kubernetes v1.17
1 property has been added on this version
- .spec.topologyKeys
1 property has changed the description
- .metadata.finalizers
Kubernetes v1.16
3 properties have been added on this version
- .metadata.managedFields.fieldsType
- .metadata.managedFields.fieldsV1
- .spec.ipFamily
2 properties have been removed on this version
- .metadata.initializers
- .metadata.managedFields.fields
5 properties have changed the description
- .apiVersion
- .kind
- .metadata
- .spec
- .status
Kubernetes v1.15
1 property has been added on this version
- .metadata.initializers.result.metadata.remainingItemCount
Kubernetes v1.14
1 property has been added on this version
- .metadata.managedFields
2 properties have changed the description
- .metadata.initializers
- .spec.type
Kubernetes v1.13
Kubernetes v1.12
2 properties have changed the description
- .metadata.initializers.result.metadata.continue
- .spec.ports.protocol
Kubernetes v1.11
1 property has changed the description
- .spec.publishNotReadyAddresses
Examples
There are 3 examples of Service that you can use as a starting point to create your own.
- apiVersion: v1kind: Servicemetadata:name: my-loadbalancer-servicenamespace: default # Service is a namespaced resourcespec:type: LoadBalancerselector:app: my-appports:- port: 80 # port that will be externally exposed on the load balancertargetPort: 8080 # pod's port for internal routing- port: 443 # port that will be externally exposed on the load balancertargetPort: 8443 # pod's port for internal routing
apiVersion: v1kind: Servicemetadata: name: my-nodeport-service namespace: default # Service is a namespaced resourcespec: type: NodePort selector: app: my-app ports: - port: 80 # the internal port of the service that can be reached from inside the cluster nodePort: 30000 # port that will be externally exposed on each node targetPort: 8080 # pod's port for internal routingapiVersion: v1kind: Servicemetadata: name: my-clusterip-service namespace: default # Service is a namespaced resourcespec: type: ClusterIP # this is the default, but it's good to be explicit! selector: app: my-app ports: - port: 80 # the internal port of the service that can be reached from inside the cluster targetPort: 8080 # pod's port for internal routing