Fix spec for addons

For some reasons kubectl apply -f -l doesn't want to spin up
contrail-network-controller.
* This patch corrects metadata for addons so kube-addons.sh can spin
  them up correctly.
* Rename directory from contrail_network_controller to
  contrail-network-controller for unified view

Change-Id: I55e62dc52778f06e29b6d797336de19360c6b153
Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
diff --git a/kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-configmap.yml b/kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-configmap.yml
similarity index 100%
rename from kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-configmap.yml
rename to kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-configmap.yml
diff --git a/kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-deploy.yml b/kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-deploy.yml
similarity index 91%
rename from kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-deploy.yml
rename to kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-deploy.yml
index 17e314f..18ddc78 100644
--- a/kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-deploy.yml
+++ b/kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-deploy.yml
@@ -1,10 +1,13 @@
 {%- from "kubernetes/map.jinja" import common with context -%}
-apiVersion: apps/v1beta1
+apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
   name: contrail-network-controller
   namespace: {{ common.addons.contrail_network_controller.get('namespace', 'kube-system') }}
+  labels:
+    addonmanager.kubernetes.io/mode: Reconcile
 spec:
+  replicas: 1
   template:
     metadata:
       labels:
diff --git a/kubernetes/files/kube-addons/netchecker/netchecker-agent.yml b/kubernetes/files/kube-addons/netchecker/netchecker-agent.yml
index 37e40d9..5ee722b 100644
--- a/kubernetes/files/kube-addons/netchecker/netchecker-agent.yml
+++ b/kubernetes/files/kube-addons/netchecker/netchecker-agent.yml
@@ -2,11 +2,11 @@
 apiVersion: extensions/v1beta1
 kind: DaemonSet
 metadata:
+  name: netchecker-agent
+  namespace: {{ common.addons.netchecker.namespace }}
   labels:
     app: netchecker-agent
     addonmanager.kubernetes.io/mode: Reconcile
-  name: netchecker-agent
-  namespace: {{ common.addons.netchecker.namespace }}
 spec:
   template:
     metadata:
diff --git a/kubernetes/files/kube-addons/netchecker/netchecker-server.yml b/kubernetes/files/kube-addons/netchecker/netchecker-server.yml
index bd1fa80..81acb95 100644
--- a/kubernetes/files/kube-addons/netchecker/netchecker-server.yml
+++ b/kubernetes/files/kube-addons/netchecker/netchecker-server.yml
@@ -4,6 +4,9 @@
 metadata:
   name: netchecker-server
   namespace: {{ common.addons.netchecker.namespace }}
+  labels:
+    app: netchecker-agent
+    addonmanager.kubernetes.io/mode: Reconcile
 spec:
   replicas: 1
   template:
diff --git a/kubernetes/master/kube-addons.sls b/kubernetes/master/kube-addons.sls
index 04f54ab..80dd2ff 100644
--- a/kubernetes/master/kube-addons.sls
+++ b/kubernetes/master/kube-addons.sls
@@ -10,17 +10,17 @@
     - mode: 0755
 
 {%- if master.network.engine == "opencontrail" and master.network.get('version', 3.0) < 4.0 %}
-/etc/kubernetes/addons/contrail_network_controller/contrail-network-controller-configmap.yml:
+/etc/kubernetes/addons/contrail-network-controller/contrail-network-controller-configmap.yml:
   file.managed:
-    - source: salt://kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-configmap.yml
+    - source: salt://kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-configmap.yml
     - template: jinja
     - group: root
     - dir_mode: 755
     - makedirs: True
 
-/etc/kubernetes/addons/contrail_network_controller/contrail-network-controller-deploy.yml:
+/etc/kubernetes/addons/contrail-network-controller/contrail-network-controller-deploy.yml:
   file.managed:
-    - source: salt://kubernetes/files/kube-addons/contrail_network_controller/contrail-network-controller-deploy.yml
+    - source: salt://kubernetes/files/kube-addons/contrail-network-controller/contrail-network-controller-deploy.yml
     - template: jinja
     - group: root
     - dir_mode: 755