Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
60e17a54
Commit
60e17a54
authored
Aug 17, 2015
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12141 from gmarek/service_doc
Small changes to Services doc
parents
736945fa
acf788b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
services.md
docs/user-guide/services.md
+25
-14
No files found.
docs/user-guide/services.md
View file @
60e17a54
...
@@ -48,7 +48,7 @@ Documentation for other releases can be found at
...
@@ -48,7 +48,7 @@ Documentation for other releases can be found at
-
[
Environment variables
](
#environment-variables
)
-
[
Environment variables
](
#environment-variables
)
-
[
DNS
](
#dns
)
-
[
DNS
](
#dns
)
-
[
Headless services
](
#headless-services
)
-
[
Headless services
](
#headless-services
)
-
[
External services
](
#external-servic
es
)
-
[
Publishing services - service types
](
#publishing-services---service-typ
es
)
-
[
Type NodePort
](
#type-nodeport
)
-
[
Type NodePort
](
#type-nodeport
)
-
[
Type LoadBalancer
](
#type-loadbalancer
)
-
[
Type LoadBalancer
](
#type-loadbalancer
)
-
[
Shortcomings
](
#shortcomings
)
-
[
Shortcomings
](
#shortcomings
)
...
@@ -355,22 +355,30 @@ they desire, but leaves them freedom to do discovery in their own way.
...
@@ -355,22 +355,30 @@ they desire, but leaves them freedom to do discovery in their own way.
Applications can still use a self-registration pattern and adapters for other
Applications can still use a self-registration pattern and adapters for other
discovery systems could easily be built upon this API.
discovery systems could easily be built upon this API.
##
External servic
es
##
Publishing services - service typ
es
For some parts of your application (e.g. frontends) you may want to expose a
For some parts of your application (e.g. frontends) you may want to expose a
Service onto an external (outside of your cluster, maybe public internet) IP
Service onto an external (outside of your cluster, maybe public internet) IP
address. Kubernetes supports two ways of doing this:
`NodePort`
s and
address, other services should be visible only from inside of the cluster.
`LoadBalancer`
s.
Every
`Service`
has a
`type`
field which defines how the
`Service`
can be
accessed. Valid values for this field are:
Kubernetes
`ServiceTypes`
allow you to specify what kind of service you want.
The default and base type is
`ClusterIP`
, which exposes a service to connection
from inside the cluster.
`NodePort`
and
`LoadBalancer`
are two types that expose
services to external trafic.
Valid values for the
`ServiceType`
field are:
*
`ClusterIP`
: use a cluster-internal IP only - this is the default and is
*
`ClusterIP`
: use a cluster-internal IP only - this is the default and is
discussed above
discussed above. Choosing this value means that you want this service to be
*
`NodePort`
: use a cluster IP, but also expose the service on a port on each
reachable only from inside of the cluster.
node of the cluster (the same port on each node)
*
`NodePort`
: on top of having a cluster-internal IP, expose the service on a
*
`LoadBalancer`
: use a ClusterIP and a NodePort, but also ask the cloud
port on each node of the cluster (the same port on each node). You'll be able
provider for a load balancer which forwards to the
`Service`
to contact the service on any
`<NodeIP>:NodePort`
address.
*
`LoadBalancer`
: on top of having a cluster-internal IP and exposing service
on a NodePort also, ask the cloud provider for a load balancer
which forwards to the
`Service`
exposed as a
`<NodeIP>:NodePort`
for each Node.
Note that while
`NodePort`
s can be TCP or UDP,
`LoadBalancer`
s only support TCP
Note that while
`NodePort`
s can be TCP or UDP,
`LoadBalancer`
s only support TCP
as of Kubernetes 1.0.
as of Kubernetes 1.0.
...
@@ -379,18 +387,21 @@ as of Kubernetes 1.0.
...
@@ -379,18 +387,21 @@ as of Kubernetes 1.0.
If you set the
`type`
field to
`"NodePort"`
, the Kubernetes master will
If you set the
`type`
field to
`"NodePort"`
, the Kubernetes master will
allocate a port from a flag-configured range (default: 30000-32767), and each
allocate a port from a flag-configured range (default: 30000-32767), and each
node will proxy that port (the same port number on every n
ode) into your
`Service`
.
Node will proxy that port (the same port number on every N
ode) into your
`Service`
.
That port will be reported in your
`Service`
's
`spec.ports[*].nodePort`
field.
That port will be reported in your
`Service`
's
`spec.ports[*].nodePort`
field.
If you want a specific port number, you can specify a value in the
`nodePort`
If you want a specific port number, you can specify a value in the
`nodePort`
field, and the system will allocate you that port or else the API transaction
field, and the system will allocate you that port or else the API transaction
will fail
. The value you specify must be in the configured range for node
will fail
(i.e. you need to take care about possible port collisions yourself).
ports.
The value you specify must be in the configured range for node
ports.
This gives developers the freedom to set up their own load balancers, to
This gives developers the freedom to set up their own load balancers, to
configure cloud environments that are not fully supported by Kubernetes, or
configure cloud environments that are not fully supported by Kubernetes, or
even to just expose one or more nodes' IPs directly.
even to just expose one or more nodes' IPs directly.
Note that this Service will be visible as both
`<NodeIP>:spec.ports[*].nodePort`
and
`spec.clusterIp:spec.ports[*].port`
.
### Type LoadBalancer
### Type LoadBalancer
On cloud providers which support external load balancers, setting the
`type`
On cloud providers which support external load balancers, setting the
`type`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment