From f2c3719506e6ec0174fe7671ae5610faccedbcb9 Mon Sep 17 00:00:00 2001
From: Steven Dake <sdake@redhat.com>
Date: Sun, 19 Oct 2014 13:26:27 -0700
Subject: [PATCH] Use hostPort to lock 1 nova-compute/nova-network per node

Kubernetes does not have a horizontal scaling feature that works per
node.  A workaround is to use hostPort to cause the scheduler not to schedule
several replicationController replicas to each node.  By doing so, only one
nova-compute is launched per node up to a total of 6 nodes which is the most
we can generate in testing.

Change-Id: I1621f15cf1ec502418b454300645b46bc796dc8b
---
 k8s/replication/nova-compute-replication.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/k8s/replication/nova-compute-replication.yaml b/k8s/replication/nova-compute-replication.yaml
index 4c3060c633..a690fca491 100644
--- a/k8s/replication/nova-compute-replication.yaml
+++ b/k8s/replication/nova-compute-replication.yaml
@@ -6,6 +6,9 @@ desiredState:
         containers:
         - name: nova-compute
           image: kollaglue/fedora-rdo-nova-compute
+          ports:
+          - containerPort: 12000
+            hostPort: 12000
           env:
           - name: DB_ROOT_PASSWORD
             value: password
@@ -14,9 +17,10 @@ desiredState:
           - name: KEYSTONE_ADMIN_TOKEN
             value: ADMINTOKEN
         - name: nova-libvirt
-          image: kollaglue/fedora-rdo-nova-libvirt
+          image: kollaglue/fedora-rdo-nova-network
           ports:
-          - containerPort: 16509
+          - containerPort: 12001
+            hostPort: 12001
           env:
           - name: DB_ROOT_PASSWORD
             value: password
@@ -30,7 +34,7 @@ desiredState:
       name: nova-compute
   replicaSelector:
     name: nova-compute
-  replicas: 1
+  replicas: 6
 id: nova-compute-controller
 kind: ReplicationController
 labels: