diff --git a/Makefile b/Makefile index 50f46197a..e5b013d72 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS := expandybird/. resourcifier/. manager/. +SUBDIRS := expandybird/. resourcifier/. manager/. dm/. TARGETS := all build test push container clean SUBDIRS_TARGETS := \ diff --git a/README.md b/README.md index 2a1c3e5c5..287b7cd0c 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,41 @@ is up and running! ### Setting up the client The easiest way to interact with Deployment Manager is through the `dm` tool -hitting a `kubectl` proxy. To set that up: +hitting a `kubectl` proxy. -1. Build the tool by running `make` in the deployment-manager repository. -1. Run `kubectl proxy --port=8001 --namespace=dm &` to start a proxy that lets you interact -with the Kubernetes API server through port 8001 on localhost. `dm` uses +#### Creating a proxy + +You can run the following to start a proxy that lets you interact with the +Kubernetes API server through port 8001 on `localhost` + +``` +kubectl proxy --port=8001 --namespace=dm & +``` + +`dm` will use `http://localhost:8001/api/v1/proxy/namespaces/dm/services/manager-service:manager` -as the default service address for DM. +as the default service address for the DM service. + +#### Getting the client +You can get access to the client in one of two ways: + +1. Build the client by running `make` in the deployment-manager repository. +1. Use the client from the container `gcr.io/dm-k8s-testing/dm`. + +**NOTE**: If you are using the client from the docker container, you will need +to substitute the following docker command in place of `dm` in all of the +examples below, or alias the command appropriately. + +``` +alias dm="docker run --net=host gcr.io/dm-k8s-testing/dm" +``` + +If you are running the docker container on a Mac, you'll also need to substitute +your machine IP to access the Kubernetes proxy running locally: + +``` +alias dm="docker run gcr.io/dm-k8s-testing/dm --service http://:8001/api/v1/proxy/namespaces/dm/services/manager-service:manager" +``` ### Using the client diff --git a/dm/Dockerfile b/dm/Dockerfile new file mode 100644 index 000000000..ef00ad98a --- /dev/null +++ b/dm/Dockerfile @@ -0,0 +1,25 @@ +# Copyright 2015 Google, Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.4 +MAINTAINER Jack Greenfield + +RUN mkdir -p "$GOPATH/src/github.com" && chmod 777 "$GOPATH/src/github.com" + +WORKDIR "$GOPATH" + +RUN go-wrapper download github.com/kubernetes/deployment-manager/dm/... +RUN go-wrapper install github.com/kubernetes/deployment-manager/dm/... + +ENTRYPOINT ["bin/dm"] diff --git a/dm/Makefile b/dm/Makefile new file mode 100644 index 000000000..7f2fc5312 --- /dev/null +++ b/dm/Makefile @@ -0,0 +1,27 @@ +# Makefile for the Docker image $(DOCKER_REGISTRY)/$(PROJECT)/dm +# MAINTAINER: Jack Greenfield +# If you update this image please check the tag value before pushing. + +.PHONY : all build test push container clean .project + +DOCKER_REGISTRY := gcr.io +PREFIX := $(DOCKER_REGISTRY)/$(PROJECT) +IMAGE := dm +TAG := latest + +ROOT_DIR := $(abspath ./..) +DIR = $(ROOT_DIR) + +push: container +ifeq ($(DOCKER_REGISTRY),gcr.io) + gcloud docker push $(PREFIX)/$(IMAGE):$(TAG) +else + docker push $(PREFIX)/$(IMAGE):$(TAG) +endif + +container: + docker build -t $(PREFIX)/$(IMAGE):$(TAG) -f Dockerfile $(DIR) + +clean: + -docker rmi $(PREFIX)/$(IMAGE):$(TAG) +