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

Commit

Permalink
Merge pull request #102 from mesosphere/rebase_05x
Browse files Browse the repository at this point in the history
rebase to kubernetes v0.6.2
  • Loading branch information
jdef committed Jan 5, 2015
2 parents eeec0d6 + ca6b323 commit 604cdb6
Show file tree
Hide file tree
Showing 25 changed files with 1,362 additions and 415 deletions.
1 change: 1 addition & 0 deletions Godeps/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 83 additions & 65 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ KUBE_GO_PACKAGE ?= github.com/GoogleCloudPlatform/kubernetes

K8S_CMD := \
${KUBE_GO_PACKAGE}/cmd/kubecfg \
${KUBE_GO_PACKAGE}/cmd/proxy
${KUBE_GO_PACKAGE}/cmd/kubectl \
${KUBE_GO_PACKAGE}/cmd/kube-proxy
FRAMEWORK_CMD := \
github.com/mesosphere/kubernetes-mesos/controller-manager \
github.com/mesosphere/kubernetes-mesos/kubernetes-mesos \
Expand Down Expand Up @@ -57,6 +58,16 @@ WITH_MESOS_CGO_FLAGS := \

endif

FRAMEWORK_FLAGS := -v -x -tags '$(TAGS)'

ifneq ($(STATIC),)
FRAMEWORK_FLAGS += --ldflags '-extldflags "-static"'
endif

ifneq ($(WITH_RACE),)
FRAMEWORK_FLAGS += -race
endif

export SHELL
export KUBE_GO_PACKAGE

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

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

format: require-gopath
go fmt $(FRAMEWORK_CMD) $(FRAMEWORK_LIB)
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,18 @@ $ cd $GOPATH # If you don't have one, create directory and set GOPATH accordingl
$ mkdir -p src/github.com/mesosphere/kubernetes-mesos
$ git clone https://github.com/mesosphere/kubernetes-mesos.git src/github.com/mesosphere/kubernetes-mesos
$ cd src/github.com/mesosphere/kubernetes-mesos && godep restore
$ go install github.com/GoogleCloudPlatform/kubernetes/cmd/{proxy,kubecfg}
$ go install github.com/GoogleCloudPlatform/kubernetes/cmd/{kube-proxy,kubecfg,kubectl}
$ go install github.com/mesosphere/kubernetes-mesos/kubernetes-{mesos,executor}
$ go install github.com/mesosphere/kubernetes-mesos/controller-manager
```

### Start the framework

**NETWORKING:** Kubernetes v0.5 introduced "Services v2" which follows an IP-per-Service model.
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.
Please keep this in mind when reviewing (and attempting) the example below - the CIDR subnet may need to be adjusted for your network.
See the Kubernetes [release notes][9] for additional details regarding the new services model.

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}`.
If you are not running in a production setting then a single etcd instance will suffice.
To run etcd, see [github.com/coreos/etcd][6], or run it via docker:
Expand All @@ -84,7 +89,9 @@ $ ./bin/kubernetes-mesos \
-mesos_master=${servicehost}:5050 \
-etcd_servers=http://${servicehost}:4001 \
-executor_path=$(pwd)/bin/kubernetes-executor \
-proxy_path=$(pwd)/bin/proxy
-proxy_path=$(pwd)/bin/kube-proxy \
-portal_net=10.10.10.0/24 \
-mesos_user=root
```

For simpler execution of `kubecfg`:
Expand Down Expand Up @@ -372,3 +379,5 @@ $ go test github.com/mesosphere/kubernetes-mesos/kubernetes-mesos -v
[5]: https://github.com/tools/godep
[6]: https://github.com/coreos/etcd/releases/
[7]: DEVELOP.md#prerequisites
[8]: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
[9]: https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.5
6 changes: 3 additions & 3 deletions controller-manager/controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz"
masterPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/master"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
kendpoint "github.com/GoogleCloudPlatform/kubernetes/pkg/service"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
Expand All @@ -43,10 +43,10 @@ import (
)

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

func init() {
Expand Down
4 changes: 2 additions & 2 deletions examples/guestbook/php-redis/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if ($_GET['cmd'] == 'set') {
$client = new Predis\Client([
'scheme' => 'tcp',
'host' => getenv('SERVICE_HOST'),
'host' => getenv('REDISMASTER_SERVICE_HOST') ?: getenv('SERVICE_HOST'),
'port' => getenv('REDISMASTER_SERVICE_PORT'),
]);
$client->set($_GET['key'], $_GET['value']);
Expand All @@ -25,7 +25,7 @@
}
$client = new Predis\Client([
'scheme' => 'tcp',
'host' => getenv('SERVICE_HOST'),
'host' => getenv('REDISMASTER_SERVICE_HOST') ?: getenv('SERVICE_HOST'),
'port' => $read_port,
]);

Expand Down
Loading

0 comments on commit 604cdb6

Please sign in to comment.