Commit c51edede authored by vaikas-google's avatar vaikas-google

Merge pull request #90 from goltermann/ns

Put DM into its own namespace
parents 701f5945 6b4726d3
...@@ -55,7 +55,7 @@ install.yaml` ...@@ -55,7 +55,7 @@ install.yaml`
That's it. You can now use `kubectl` to see DM running in your cluster: That's it. You can now use `kubectl` to see DM running in your cluster:
``` ```
kubectl get pod,rc,service kubectl get pod,rc,service --namespace=dm
``` ```
If you see expandybird-service, manager-service, resourcifier-service, and If you see expandybird-service, manager-service, resourcifier-service, and
...@@ -70,9 +70,9 @@ The easiest way to interact with Deployment Manager is through the `dm` tool ...@@ -70,9 +70,9 @@ 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. To set that up:
1. Build the tool by running `make` in the deployment-manager repository. 1. Build the tool by running `make` in the deployment-manager repository.
1. Run `kubectl proxy --port=8001 &` to start a proxy that lets you interact 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 with the Kubernetes API server through port 8001 on localhost. `dm` uses
`http://localhost:8001/api/v1/proxy/namespaces/default/services/manager-service:manager` `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 DM.
### Using the client ### Using the client
......
...@@ -39,7 +39,7 @@ var ( ...@@ -39,7 +39,7 @@ var (
stdin = flag.Bool("stdin", false, "Reads a configuration from the standard input") stdin = flag.Bool("stdin", false, "Reads a configuration from the standard input")
properties = flag.String("properties", "", "Properties to use when deploying a template (e.g., --properties k1=v1,k2=v2)") properties = flag.String("properties", "", "Properties to use when deploying a template (e.g., --properties k1=v1,k2=v2)")
template_registry = flag.String("registry", "kubernetes/deployment-manager/templates", "Github based template registry (owner/repo[/path])") template_registry = flag.String("registry", "kubernetes/deployment-manager/templates", "Github based template registry (owner/repo[/path])")
service = flag.String("service", "http://localhost:8001/api/v1/proxy/namespaces/default/services/manager-service:manager", "URL for deployment manager") service = flag.String("service", "http://localhost:8001/api/v1/proxy/namespaces/dm/services/manager-service:manager", "URL for deployment manager")
binary = flag.String("binary", "../expandybird/expansion/expansion.py", "Path to template expansion binary") binary = flag.String("binary", "../expandybird/expansion/expansion.py", "Path to template expansion binary")
) )
......
...@@ -41,9 +41,13 @@ pkill -f $MANAGER ...@@ -41,9 +41,13 @@ pkill -f $MANAGER
$MANAGER > $LOGDIR/manager.log 2>&1 --port=8080 --expanderURL=http://localhost:8081 --deployerURL=http://localhost:8082 & $MANAGER > $LOGDIR/manager.log 2>&1 --port=8080 --expanderURL=http://localhost:8081 --deployerURL=http://localhost:8082 &
echo echo
echo "Creating dm namespace..."
$KUBECTL create -f dm-namespace.yaml
echo
echo "Starting kubectl proxy..." echo "Starting kubectl proxy..."
pkill -f "$KUBECTL proxy" pkill -f "$KUBECTL proxy"
$KUBECTL proxy --port=8001 & $KUBECTL proxy --port=8001 --namespace=dm &
sleep 1s sleep 1s
echo echo
......
...@@ -2,6 +2,7 @@ resources: ...@@ -2,6 +2,7 @@ resources:
- name: expandybird - name: expandybird
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v1/replicatedservice.py type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v1/replicatedservice.py
properties: properties:
namespace: dm
service_port: 8081 service_port: 8081
target_port: 8080 target_port: 8080
container_port: 8080 container_port: 8080
...@@ -13,6 +14,7 @@ resources: ...@@ -13,6 +14,7 @@ resources:
- name: resourcifier - name: resourcifier
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v1/replicatedservice.py type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v1/replicatedservice.py
properties: properties:
namespace: dm
service_port: 8082 service_port: 8082
target_port: 8080 target_port: 8080
container_port: 8080 container_port: 8080
...@@ -24,6 +26,7 @@ resources: ...@@ -24,6 +26,7 @@ resources:
- name: manager - name: manager
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v1/replicatedservice.py type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v1/replicatedservice.py
properties: properties:
namespace: dm
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
container_port: 8080 container_port: 8080
......
apiVersion: v1
kind: Namespace
metadata:
labels:
app: dm
name: dm-namespace
name: dm
...@@ -11,6 +11,14 @@ ...@@ -11,6 +11,14 @@
# limitations under the License. # limitations under the License.
###################################################################### ######################################################################
---
apiVersion: v1
kind: Namespace
metadata:
labels:
app: dm
name: dm-namespace
name: dm
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
...@@ -19,7 +27,7 @@ metadata: ...@@ -19,7 +27,7 @@ metadata:
app: dm app: dm
name: expandybird-service name: expandybird-service
name: expandybird-service name: expandybird-service
namespace: default namespace: dm
spec: spec:
ports: ports:
- name: expandybird - name: expandybird
...@@ -36,7 +44,7 @@ metadata: ...@@ -36,7 +44,7 @@ metadata:
app: dm app: dm
name: expandybird-rc name: expandybird-rc
name: expandybird-rc name: expandybird-rc
namespace: default namespace: dm
spec: spec:
replicas: 2 replicas: 2
selector: selector:
...@@ -63,7 +71,7 @@ metadata: ...@@ -63,7 +71,7 @@ metadata:
app: dm app: dm
name: resourcifier-service name: resourcifier-service
name: resourcifier-service name: resourcifier-service
namespace: default namespace: dm
spec: spec:
ports: ports:
- name: resourcifier - name: resourcifier
...@@ -80,7 +88,7 @@ metadata: ...@@ -80,7 +88,7 @@ metadata:
app: dm app: dm
name: resourcifier-rc name: resourcifier-rc
name: resourcifier-rc name: resourcifier-rc
namespace: default namespace: dm
spec: spec:
replicas: 2 replicas: 2
selector: selector:
...@@ -107,7 +115,7 @@ metadata: ...@@ -107,7 +115,7 @@ metadata:
app: dm app: dm
name: manager-service name: manager-service
name: manager-service name: manager-service
namespace: default namespace: dm
spec: spec:
ports: ports:
- name: manager - name: manager
...@@ -124,7 +132,7 @@ metadata: ...@@ -124,7 +132,7 @@ metadata:
app: dm app: dm
name: manager-rc name: manager-rc
name: manager-rc name: manager-rc
namespace: default namespace: dm
spec: spec:
replicas: 1 replicas: 1
selector: selector:
......
...@@ -37,7 +37,7 @@ resources: ...@@ -37,7 +37,7 @@ resources:
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: test-controller-v1 name: test-controller-v1
namespace: default namespace: dm
labels: labels:
k8s-app: test k8s-app: test
version: v1 version: v1
...@@ -66,7 +66,7 @@ resources: ...@@ -66,7 +66,7 @@ resources:
kind: Service kind: Service
metadata: metadata:
name: test name: test
namespace: default namespace: dm
labels: labels:
k8s-app: test k8s-app: test
version: v1 version: v1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment