You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `ClusterIP`: Exposes the Service on a cluster-internal IP. Choosing this value
485
-
makes the Service only reachable from within the cluster. This is the
486
-
default `ServiceType`.
487
-
* [`NodePort`](#nodeport): Exposes the Service on each Node's IP at a static port
488
-
(the `NodePort`). A `ClusterIP` Service, to which the `NodePort` Service
489
-
routes, is automatically created. You'll be able to contact the `NodePort` Service,
490
-
from outside the cluster,
491
-
by requesting `<NodeIP>:<NodePort>`.
492
-
* [`LoadBalancer`](#loadbalancer): Exposes the Service externally using a cloud
493
-
provider's load balancer. `NodePort` and `ClusterIP` Services, to which the external
494
-
load balancer routes, are automatically created.
495
-
* [`ExternalName`](#externalname): Maps the Service to the contents of the
496
-
`externalName`field (e.g. `foo.bar.example.com`), by returning a `CNAME` record
497
-
498
-
with its value. No proxying of any kind is set up.
499
-
{{< note >}}
500
-
You need either kube-dns version 1.7 or CoreDNS version 0.0.8 or higher to use the `ExternalName` type.
501
-
{{< /note >}}
502
-
503
-
You can also use [Ingress](/docs/concepts/services-networking/ingress/) to expose your Service. Ingress is not a Service type, but it acts as the entry point for your cluster. It lets you consolidate your routing rules into a single resource as it can expose multiple services under the same IP address.
483
+
* `ClusterIP`: Exposes the Service on a cluster-internal IP. Choosing this value
484
+
makes the Service only reachable from within the cluster. This is the
485
+
default `ServiceType`.
486
+
* [`NodePort`](#nodeport): Exposes the Service on each Node's IP at a static port
487
+
(the `NodePort`). A `ClusterIP` Service, to which the `NodePort` Service
488
+
routes, is automatically created. You'll be able to contact the `NodePort` Service,
489
+
from outside the cluster,
490
+
by requesting `<NodeIP>:<NodePort>`.
491
+
* [`LoadBalancer`](#loadbalancer): Exposes the Service externally using a cloud
492
+
provider's load balancer. `NodePort` and `ClusterIP` Services, to which the external
493
+
load balancer routes, are automatically created.
494
+
* [`ExternalName`](#externalname): Maps the Service to the contents of the
495
+
`externalName`field (e.g. `foo.bar.example.com`), by returning a `CNAME` record
496
+
with its value. No proxying of any kind is set up.
497
+
{{< note >}}You need either `kube-dns` version 1.7 or CoreDNS version 0.0.8 or higher
498
+
to use the `ExternalName` type.
499
+
{{< /note >}}
500
+
501
+
You can also use [Ingress](/docs/concepts/services-networking/ingress/) to expose your Service. Ingress is not a Service type, but it acts as the entry point for your cluster. It lets you consolidate your routing rules
502
+
into a single resource as it can expose multiple services under the same IP address.
504
503
505
504
### Type NodePort {#nodeport}
506
505
@@ -509,7 +508,6 @@ allocates a port from a range specified by `--service-node-port-range` flag (def
509
508
Each node proxies that port (the same port number on every Node) into your Service.
510
509
Your Service reports the allocated port in its `.spec.ports[*].nodePort` field.
511
510
512
-
513
511
If you want to specify particular IP(s) to proxy the port, you can set the `--nodeport-addresses` flag in kube-proxy to particular IP block(s); this is supported since Kubernetes v1.10.
514
512
This flag takes a comma-delimited list of IP blocks (e.g. 10.0.0.0/8, 192.0.2.0/25) to specify IP address ranges that kube-proxy should consider as local to this node.
515
513
@@ -530,6 +528,7 @@ Note that this Service is visible as `<NodeIP>:spec.ports[*].nodePort`
530
528
and `.spec.clusterIP:spec.ports[*].port`. (If the `--nodeport-addresses` flag in kube-proxy is set, <NodeIP> would be filtered NodeIP(s).)
531
529
532
530
For example:
531
+
533
532
```yaml
534
533
apiVersion: v1
535
534
kind: Service
@@ -606,19 +605,21 @@ Specify the assigned IP address as loadBalancerIP. Ensure that you have updated
606
605
{{< /note >}}
607
606
608
607
#### Internal load balancer
608
+
609
609
In a mixed environment it is sometimes necessary to route traffic from Services inside the same
610
610
(virtual) network address block.
611
611
612
612
In a split-horizon DNS environment you would need two Services to be able to route both external and internal traffic to your endpoints.
613
613
614
-
You can achieve this by adding one the following annotations to a Service.
615
-
The annotation to add depends on the cloud Service provider you're using.
614
+
To set an internal load balancer, add one of the following annotations to your Service
615
+
depending on the cloud Service provider you're using.
For partial TLS / SSL support on clusters running on AWS, you can add three
@@ -823,7 +838,6 @@ to the value of `"true"`. The annotation
823
838
`service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout` can
824
839
also be used to set maximum time, in seconds, to keep the existing connections open before deregistering the instances.
825
840
826
-
827
841
```yaml
828
842
metadata:
829
843
name: my-service
@@ -991,6 +1005,7 @@ spec:
991
1005
type: ExternalName
992
1006
externalName: my.database.example.com
993
1007
```
1008
+
994
1009
{{< note >}}
995
1010
ExternalName accepts an IPv4 address string, but as a DNS names comprised of digits, not as an IP address. ExternalNames that resemble IPv4 addresses are not resolved by CoreDNS or ingress-nginx because ExternalName
996
1011
is intended to specify a canonical DNS name. To hardcode an IP address, consider using
@@ -1173,7 +1188,7 @@ of the Service.
1173
1188
1174
1189
{{< note >}}
1175
1190
You can also use {{< glossary_tooltip term_id="ingress" >}} in place of Service
1176
-
to expose HTTP / HTTPS Services.
1191
+
to expose HTTP/HTTPS Services.
1177
1192
{{< /note >}}
1178
1193
1179
1194
### PROXY protocol
@@ -1189,6 +1204,7 @@ incoming connection, similar to this example
1189
1204
```
1190
1205
PROXY TCP4 192.0.2.202 10.0.42.7 12345 7\r\n
1191
1206
```
1207
+
1192
1208
followed by the data from the client.
1193
1209
1194
1210
### SCTP
@@ -1227,13 +1243,8 @@ SCTP is not supported on Windows based nodes.
1227
1243
The kube-proxy does not support the management of SCTP associations when it is in userspace mode.
1228
1244
{{< /warning >}}
1229
1245
1230
-
1231
-
1232
1246
## {{% heading "whatsnext" %}}
1233
1247
1234
-
1235
1248
* Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/)
1236
1249
* Read about [Ingress](/docs/concepts/services-networking/ingress/)
1237
1250
* Read about [EndpointSlices](/docs/concepts/services-networking/endpoint-slices/)
0 commit comments