Skip to content
This repository was archived by the owner on Dec 5, 2017. It is now read-only.

Commit 604cdb6

Browse files
committed
Merge pull request #102 from mesosphere/rebase_05x
rebase to kubernetes v0.6.2
2 parents eeec0d6 + ca6b323 commit 604cdb6

25 files changed

+1362
-415
lines changed

Godeps/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Godeps/Godeps.json

Lines changed: 83 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ KUBE_GO_PACKAGE ?= github.com/GoogleCloudPlatform/kubernetes
1010

1111
K8S_CMD := \
1212
${KUBE_GO_PACKAGE}/cmd/kubecfg \
13-
${KUBE_GO_PACKAGE}/cmd/proxy
13+
${KUBE_GO_PACKAGE}/cmd/kubectl \
14+
${KUBE_GO_PACKAGE}/cmd/kube-proxy
1415
FRAMEWORK_CMD := \
1516
github.com/mesosphere/kubernetes-mesos/controller-manager \
1617
github.com/mesosphere/kubernetes-mesos/kubernetes-mesos \
@@ -57,6 +58,16 @@ WITH_MESOS_CGO_FLAGS := \
5758

5859
endif
5960

61+
FRAMEWORK_FLAGS := -v -x -tags '$(TAGS)'
62+
63+
ifneq ($(STATIC),)
64+
FRAMEWORK_FLAGS += --ldflags '-extldflags "-static"'
65+
endif
66+
67+
ifneq ($(WITH_RACE),)
68+
FRAMEWORK_FLAGS += -race
69+
endif
70+
6071
export SHELL
6172
export KUBE_GO_PACKAGE
6273

@@ -78,7 +89,7 @@ proxy: require-godep $(KUBE_GIT_VERSION_FILE)
7889
require-vendor:
7990

8091
framework: require-godep
81-
env $(WITH_MESOS_CGO_FLAGS) go install -v -x -tags '$(TAGS)' $${WITH_RACE:+-race} $(FRAMEWORK_CMD)
92+
env $(WITH_MESOS_CGO_FLAGS) go install $(FRAMEWORK_FLAGS) $(FRAMEWORK_CMD)
8293

8394
format: require-gopath
8495
go fmt $(FRAMEWORK_CMD) $(FRAMEWORK_LIB)

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,18 @@ $ cd $GOPATH # If you don't have one, create directory and set GOPATH accordingl
5555
$ mkdir -p src/github.com/mesosphere/kubernetes-mesos
5656
$ git clone https://github.com/mesosphere/kubernetes-mesos.git src/github.com/mesosphere/kubernetes-mesos
5757
$ cd src/github.com/mesosphere/kubernetes-mesos && godep restore
58-
$ go install github.com/GoogleCloudPlatform/kubernetes/cmd/{proxy,kubecfg}
58+
$ go install github.com/GoogleCloudPlatform/kubernetes/cmd/{kube-proxy,kubecfg,kubectl}
5959
$ go install github.com/mesosphere/kubernetes-mesos/kubernetes-{mesos,executor}
6060
$ go install github.com/mesosphere/kubernetes-mesos/controller-manager
6161
```
6262

6363
### Start the framework
6464

65+
**NETWORKING:** Kubernetes v0.5 introduced "Services v2" which follows an IP-per-Service model.
66+
A consequence of this is that you must provide the Kubernetes-Mesos framework with a [CIDR][8] subnet that will be used for the allocation of IP addresses for Kubernetes services: the `-portal_net` parameter.
67+
Please keep this in mind when reviewing (and attempting) the example below - the CIDR subnet may need to be adjusted for your network.
68+
See the Kubernetes [release notes][9] for additional details regarding the new services model.
69+
6570
The examples that follow assume that you are running the mesos-master, etcd, and the kubernetes-mesos framework on the same host, exposed on an IP address referred to hereafter as `${servicehost}`.
6671
If you are not running in a production setting then a single etcd instance will suffice.
6772
To run etcd, see [github.com/coreos/etcd][6], or run it via docker:
@@ -84,7 +89,9 @@ $ ./bin/kubernetes-mesos \
8489
-mesos_master=${servicehost}:5050 \
8590
-etcd_servers=http://${servicehost}:4001 \
8691
-executor_path=$(pwd)/bin/kubernetes-executor \
87-
-proxy_path=$(pwd)/bin/proxy
92+
-proxy_path=$(pwd)/bin/kube-proxy \
93+
-portal_net=10.10.10.0/24 \
94+
-mesos_user=root
8895
```
8996

9097
For simpler execution of `kubecfg`:
@@ -372,3 +379,5 @@ $ go test github.com/mesosphere/kubernetes-mesos/kubernetes-mesos -v
372379
[5]: https://github.com/tools/godep
373380
[6]: https://github.com/coreos/etcd/releases/
374381
[7]: DEVELOP.md#prerequisites
382+
[8]: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
383+
[9]: https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.5

controller-manager/controller-manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
3434
"github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
3535
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz"
36-
masterPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/master"
36+
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
3737
kendpoint "github.com/GoogleCloudPlatform/kubernetes/pkg/service"
3838
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
3939
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
@@ -43,10 +43,10 @@ import (
4343
)
4444

4545
var (
46-
port = flag.Int("port", masterPkg.ControllerManagerPort, "The port that the controller-manager's http service runs on")
46+
port = flag.Int("port", ports.ControllerManagerPort, "The port that the controller-manager's http service runs on")
4747
address = util.IP(net.ParseIP("127.0.0.1"))
48-
useHostPortEndpoints = flag.Bool("host_port_endpoints", true, "Map service endpoints to hostIP:hostPort instead of podIP:containerPort. Default true.")
4948
clientConfig = &client.Config{}
49+
useHostPortEndpoints = flag.Bool("host_port_endpoints", true, "Map service endpoints to hostIP:hostPort instead of podIP:containerPort. Default true.")
5050
)
5151

5252
func init() {

examples/guestbook/php-redis/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if ($_GET['cmd'] == 'set') {
1313
$client = new Predis\Client([
1414
'scheme' => 'tcp',
15-
'host' => getenv('SERVICE_HOST'),
15+
'host' => getenv('REDISMASTER_SERVICE_HOST') ?: getenv('SERVICE_HOST'),
1616
'port' => getenv('REDISMASTER_SERVICE_PORT'),
1717
]);
1818
$client->set($_GET['key'], $_GET['value']);
@@ -25,7 +25,7 @@
2525
}
2626
$client = new Predis\Client([
2727
'scheme' => 'tcp',
28-
'host' => getenv('SERVICE_HOST'),
28+
'host' => getenv('REDISMASTER_SERVICE_HOST') ?: getenv('SERVICE_HOST'),
2929
'port' => $read_port,
3030
]);
3131

0 commit comments

Comments
 (0)