WIP: Implement multi-port Services

This commit is contained in:
Tim Hockin 2015-03-13 08:16:41 -07:00
parent 543e65c0da
commit 03131af836
14 changed files with 69 additions and 40 deletions

View File

@ -5,7 +5,8 @@ metadata:
name: cassandra name: cassandra
name: cassandra name: cassandra
spec: spec:
ports:
- port: 9042
targetPort: 9042 targetPort: 9042
port: 9042
selector: selector:
name: cassandra name: cassandra

View File

@ -8,9 +8,13 @@
} }
}, },
"spec":{ "spec":{
"ports": [
{
"port":3000, "port":3000,
"containerPort":"http-server", "targetPort":"http-server",
"protocol":"TCP", "protocol":"TCP"
}
],
"selector":{ "selector":{
"name":"guestbook" "name":"guestbook"
} }

View File

@ -9,9 +9,13 @@
} }
}, },
"spec":{ "spec":{
"ports": [
{
"port":6379, "port":6379,
"containerPort":"redis-server", "targetPort":"redis-server",
"protocol":"TCP", "protocol":"TCP"
}
],
"selector":{ "selector":{
"name":"redis", "name":"redis",
"role":"master" "role":"master"

View File

@ -9,9 +9,13 @@
} }
}, },
"spec":{ "spec":{
"ports": [
{
"port":6379, "port":6379,
"containerPort":"redis-server", "targetPort":"redis-server",
"protocol":"TCP", "protocol":"TCP"
}
],
"selector":{ "selector":{
"name":"redis", "name":"redis",
"role":"slave" "role":"slave"

View File

@ -8,9 +8,13 @@
} }
}, },
"spec":{ "spec":{
"ports": [
{
"port":80, "port":80,
"containerPort":80, "targetPort":80,
"protocol":"TCP", "protocol":"TCP"
}
],
"selector":{ "selector":{
"name":"frontend" "name":"frontend"
} }

View File

@ -8,9 +8,13 @@
} }
}, },
"spec":{ "spec":{
"ports": [
{
"port":6379, "port":6379,
"containerPort":6379, "targetPort":6379,
"protocol":"TCP", "protocol":"TCP"
}
],
"selector":{ "selector":{
"name":"redis-master" "name":"redis-master"
} }

View File

@ -8,9 +8,13 @@
} }
}, },
"spec":{ "spec":{
"ports": [
{
"port":6379, "port":6379,
"containerPort":6379, "targetPort":6379,
"protocol":"TCP", "protocol":"TCP"
}
],
"selector":{ "selector":{
"name":"redis-slave" "name":"redis-slave"
} }

View File

@ -5,7 +5,8 @@ metadata:
name: hazelcast name: hazelcast
name: hazelcast name: hazelcast
spec: spec:
ports:
- port: 5701
targetPort: 5701 targetPort: 5701
port: 5701
selector: selector:
name: hazelcast name: hazelcast

View File

@ -5,8 +5,9 @@ metadata:
name: mysql name: mysql
name: mysql name: mysql
spec: spec:
ports:
- port: 3306
targetPort: 3306 targetPort: 3306
port: 3306
selector: selector:
name: mysql name: mysql

View File

@ -5,8 +5,9 @@ metadata:
name: wpfrontend name: wpfrontend
name: wpfrontend name: wpfrontend
spec: spec:
ports:
- port: 80
targetPort: 80 targetPort: 80
port: 80
selector: selector:
name: wpfrontend name: wpfrontend

View File

@ -6,7 +6,8 @@ metadata:
role: service role: service
name: redis-sentinel name: redis-sentinel
spec: spec:
ports:
- port: 26379
targetPort: 26379 targetPort: 26379
port: 26379
selector: selector:
redis-sentinel: "true" redis-sentinel: "true"

View File

@ -6,8 +6,9 @@ metadata:
name: rethinkdb-admin name: rethinkdb-admin
namespace: rethinkdb namespace: rethinkdb
spec: spec:
ports:
- port: 8080
targetPort: 8080 targetPort: 8080
port: 8080
selector: selector:
db: rethinkdb db: rethinkdb
role: admin role: admin

View File

@ -6,7 +6,8 @@ metadata:
name: rethinkdb-driver name: rethinkdb-driver
namespace: rethinkdb namespace: rethinkdb
spec: spec:
ports:
- port: 28015
targetPort: 28015 targetPort: 28015
port: 28015
selector: selector:
db: rethinkdb db: rethinkdb

View File

@ -3,16 +3,14 @@ kind: Service
metadata: metadata:
name: nginx-example name: nginx-example
spec: spec:
ports:
- port: 8000 # the port that this service should serve on
# the container on each pod to connect to, can be a name # the container on each pod to connect to, can be a name
# (e.g. 'www') or a number (e.g. 80) # (e.g. 'www') or a number (e.g. 80)
targetPort: 80 targetPort: 80
# the port that this service should serve on
port: 8000
protocol: TCP protocol: TCP
# just like the selector in the replication controller, # just like the selector in the replication controller,
# but this time it identifies the set of pods to load balance # but this time it identifies the set of pods to load balance
# traffic to. # traffic to.
selector: selector:
name: nginx name: nginx