Browse Source

Add kube dashboard and remove kube ui

kube-ui [2] is deprecated and not actively maintained since long time.
Instead kubernetes dashboard [1] has lot of features and is actively
managed.
With this patch kube-ui is removed and kubernetes dashboard is added
and enabled in k8s cluster by default.

The kubernetes dashboard is enabled by default. To disable it, set the
label 'kube_dashboard_enabled' to False

Reference:
[1] https://github.com/kubernetes/dashboard
[2] https://github.com/kubernetes/kube-ui

(cherry-pick from 44d102a65e)

Change-Id: Ib4a6fcd08606dea70aae5b018c5e3c2dedcd2c6e
tags/4.1.4
yatinkarel 2 years ago
parent
commit
a422f53410

+ 149
- 0
magnum/drivers/common/templates/kubernetes/fragments/kube-dashboard-service.sh View File

@@ -0,0 +1,149 @@
1
+#!/bin/sh
2
+
3
+# this service is required because docker will start only after cloud init was finished
4
+# due to the service dependencies in Fedora Atomic (docker <- docker-storage-setup <- cloud-final)
5
+
6
+
7
+. /etc/sysconfig/heat-params
8
+
9
+if [ "$(echo $KUBE_DASHBOARD_ENABLED | tr '[:upper:]' '[:lower:]')" == "false" ]; then
10
+    exit 0
11
+fi
12
+
13
+if [ -n "${INSECURE_REGISTRY_URL}" ]; then
14
+    KUBE_DASH_IMAGE="${INSECURE_REGISTRY_URL}/google_containers/kubernetes-dashboard-amd64:${KUBE_DASHBOARD_VERSION}"
15
+else
16
+    KUBE_DASH_IMAGE="gcr.io/google_containers/kubernetes-dashboard-amd64:${KUBE_DASHBOARD_VERSION}"
17
+fi
18
+
19
+KUBE_DASH_DEPLOY=/srv/kubernetes/manifests/kube-dash-deploy.yaml
20
+
21
+[ -f ${KUBE_DASH_DEPLOY} ] || {
22
+    echo "Writing File: $KUBE_DASH_DEPLOY"
23
+    mkdir -p $(dirname ${KUBE_DASH_DEPLOY})
24
+    cat << EOF > ${KUBE_DASH_DEPLOY}
25
+kind: Deployment
26
+apiVersion: extensions/v1beta1
27
+metadata:
28
+  labels:
29
+    app: kubernetes-dashboard
30
+  name: kubernetes-dashboard
31
+  namespace: kube-system
32
+spec:
33
+  replicas: 1
34
+  revisionHistoryLimit: 10
35
+  selector:
36
+    matchLabels:
37
+      app: kubernetes-dashboard
38
+  template:
39
+    metadata:
40
+      labels:
41
+        app: kubernetes-dashboard
42
+      # Comment the following annotation if Dashboard must not be deployed on master
43
+      annotations:
44
+        scheduler.alpha.kubernetes.io/tolerations: |
45
+          [
46
+            {
47
+              "key": "dedicated",
48
+              "operator": "Equal",
49
+              "value": "master",
50
+              "effect": "NoSchedule"
51
+            }
52
+          ]
53
+    spec:
54
+      containers:
55
+      - name: kubernetes-dashboard
56
+        image: ${KUBE_DASH_IMAGE}
57
+        imagePullPolicy: Always
58
+        ports:
59
+        - containerPort: 9090
60
+          protocol: TCP
61
+        args:
62
+        livenessProbe:
63
+          httpGet:
64
+            path: /
65
+            port: 9090
66
+          initialDelaySeconds: 30
67
+          timeoutSeconds: 30
68
+EOF
69
+}
70
+
71
+KUBE_DASH_SVC=/srv/kubernetes/manifests/kube-dash-svc.yaml
72
+[ -f ${KUBE_DASH_SVC} ] || {
73
+    echo "Writing File: $KUBE_DASH_SVC"
74
+    mkdir -p $(dirname ${KUBE_DASH_SVC})
75
+    cat << EOF > ${KUBE_DASH_SVC}
76
+kind: Service
77
+apiVersion: v1
78
+metadata:
79
+  labels:
80
+    app: kubernetes-dashboard
81
+  name: kubernetes-dashboard
82
+  namespace: kube-system
83
+spec:
84
+  type: NodePort
85
+  ports:
86
+  - port: 80
87
+    targetPort: 9090
88
+  selector:
89
+    app: kubernetes-dashboard
90
+EOF
91
+}
92
+
93
+KUBE_DASH_BIN=/usr/local/bin/kube-dash
94
+[ -f ${KUBE_DASH_BIN} ] || {
95
+    echo "Writing File: $KUBE_DASH_BIN"
96
+    mkdir -p $(dirname ${KUBE_DASH_BIN})
97
+    cat << EOF > ${KUBE_DASH_BIN}
98
+#!/bin/sh
99
+until curl -sf "http://127.0.0.1:8080/healthz"
100
+do
101
+    echo "Waiting for Kubernetes API..."
102
+    sleep 5
103
+done
104
+
105
+#echo check for existence of kubernetes-dashboard deployment
106
+/usr/bin/kubectl get deployment kube-dashboard --namespace=kube-system
107
+
108
+if [ "\$?" != "0" ]; then
109
+    /usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-dash-deploy.yaml --namespace=kube-system
110
+fi
111
+
112
+#echo check for existence of kubernetes-dashboard service
113
+/usr/bin/kubectl get service kubernetes-dashboard --namespace=kube-system
114
+
115
+if [ "\$?" != "0" ]; then
116
+    /usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-dash-svc.yaml --namespace=kube-system
117
+fi
118
+EOF
119
+}
120
+
121
+KUBE_DASH_SERVICE=/etc/systemd/system/kube-dash.service
122
+[ -f ${KUBE_DASH_SERVICE} ] || {
123
+    echo "Writing File: $KUBE_DASH_SERVICE"
124
+    mkdir -p $(dirname ${KUBE_DASH_SERVICE})
125
+    cat << EOF > ${KUBE_DASH_SERVICE}
126
+[Unit]
127
+After=kube-system-namespace.service
128
+Requires=kubelet.service
129
+Wants=kube-system-namespace.service
130
+
131
+[Service]
132
+Type=oneshot
133
+Environment=HOME=/root
134
+EnvironmentFile=-/etc/kubernetes/config
135
+ExecStart=${KUBE_DASH_BIN}
136
+
137
+[Install]
138
+WantedBy=multi-user.target
139
+EOF
140
+}
141
+
142
+chown root:root ${KUBE_DASH_BIN}
143
+chmod 0755 ${KUBE_DASH_BIN}
144
+
145
+chown root:root ${KUBE_DASH_SERVICE}
146
+chmod 0644 ${KUBE_DASH_SERVICE}
147
+
148
+systemctl enable kube-dash
149
+systemctl start --no-block kube-dash

+ 0
- 133
magnum/drivers/common/templates/kubernetes/fragments/kube-ui-service.sh View File

@@ -1,133 +0,0 @@
1
-#!/bin/sh
2
-
3
-# this service is required because docker will start only after cloud init was finished
4
-# due to the service dependencies in Fedora Atomic (docker <- docker-storage-setup <- cloud-final)
5
-
6
-
7
-. /etc/sysconfig/heat-params
8
-
9
-if [ -n "${INSECURE_REGISTRY_URL}" ]; then
10
-    KUBEUI_IMAGE="${INSECURE_REGISTRY_URL}/google_containers/kube-ui:v4"
11
-else
12
-    KUBEUI_IMAGE="gcr.io/google_containers/kube-ui:v4"
13
-fi
14
-
15
-KUBE_UI_RC=/srv/kubernetes/manifests/kube-ui-rc.yaml
16
-
17
-[ -f ${KUBE_UI_RC} ] || {
18
-    echo "Writing File: $KUBE_UI_RC"
19
-    mkdir -p $(dirname ${KUBE_UI_RC})
20
-    cat << EOF > ${KUBE_UI_RC}
21
-apiVersion: v1
22
-kind: ReplicationController
23
-metadata:
24
-  name: kube-ui-v4
25
-  namespace: kube-system
26
-  labels:
27
-    k8s-app: kube-ui
28
-    version: v4
29
-    kubernetes.io/cluster-service: "true"
30
-spec:
31
-  replicas: 1
32
-  selector:
33
-    k8s-app: kube-ui
34
-    version: v4
35
-  template:
36
-    metadata:
37
-      labels:
38
-        k8s-app: kube-ui
39
-        version: v4
40
-        kubernetes.io/cluster-service: "true"
41
-    spec:
42
-      containers:
43
-      - name: kube-ui
44
-        image: ${KUBEUI_IMAGE}
45
-        resources:
46
-          limits:
47
-            cpu: 100m
48
-            memory: 50Mi
49
-        ports:
50
-        - containerPort: 8080
51
-EOF
52
-}
53
-
54
-KUBE_UI_SVC=/srv/kubernetes/manifests/kube-ui-svc.yaml
55
-[ -f ${KUBE_UI_SVC} ] || {
56
-    echo "Writing File: $KUBE_UI_SVC"
57
-    mkdir -p $(dirname ${KUBE_UI_SVC})
58
-    cat << EOF > ${KUBE_UI_SVC}
59
-apiVersion: v1
60
-kind: Service
61
-metadata:
62
-  name: kube-ui
63
-  namespace: kube-system
64
-  labels:
65
-    k8s-app: kube-ui
66
-    kubernetes.io/cluster-service: "true"
67
-    kubernetes.io/name: "KubeUI"
68
-spec:
69
-  selector:
70
-    k8s-app: kube-ui
71
-  ports:
72
-  - port: 80
73
-    targetPort: 8080
74
-EOF
75
-}
76
-
77
-KUBE_UI_BIN=/usr/local/bin/kube-ui
78
-[ -f ${KUBE_UI_BIN} ] || {
79
-    echo "Writing File: $KUBE_UI_BIN"
80
-    mkdir -p $(dirname ${KUBE_UI_BIN})
81
-    cat << EOF > ${KUBE_UI_BIN}
82
-#!/bin/sh
83
-until curl -sf "http://127.0.0.1:8080/healthz"
84
-do
85
-    echo "Waiting for Kubernetes API..."
86
-    sleep 5
87
-done
88
-
89
-#echo check for existence of kube-ui-v4 replication controller
90
-/usr/bin/kubectl get rc kube-ui-v4 --namespace=kube-system
91
-
92
-if [ "\$?" != "0" ]; then
93
-    /usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-ui-rc.yaml --namespace=kube-system
94
-fi
95
-
96
-#echo check for existence of kube-ui service
97
-/usr/bin/kubectl get service kube-ui --namespace=kube-system
98
-
99
-if [ "\$?" != "0" ]; then
100
-    /usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-ui-svc.yaml --namespace=kube-system
101
-fi
102
-EOF
103
-}
104
-
105
-KUBE_UI_SERVICE=/etc/systemd/system/kube-ui.service
106
-[ -f ${KUBE_UI_SERVICE} ] || {
107
-    echo "Writing File: $KUBE_UI_SERVICE"
108
-    mkdir -p $(dirname ${KUBE_UI_SERVICE})
109
-    cat << EOF > ${KUBE_UI_SERVICE}
110
-[Unit]
111
-After=kube-system-namespace.service
112
-Requires=kubelet.service
113
-Wants=kube-system-namespace.service
114
-
115
-[Service]
116
-Type=oneshot
117
-Environment=HOME=/root
118
-EnvironmentFile=-/etc/kubernetes/config
119
-ExecStart=${KUBE_UI_BIN}
120
-
121
-[Install]
122
-WantedBy=multi-user.target
123
-EOF
124
-}
125
-
126
-chown root:root ${KUBE_UI_BIN}
127
-chmod 0755 ${KUBE_UI_BIN}
128
-
129
-chown root:root ${KUBE_UI_SERVICE}
130
-chmod 0644 ${KUBE_UI_SERVICE}
131
-
132
-systemctl enable kube-ui
133
-systemctl start --no-block kube-ui

+ 2
- 0
magnum/drivers/common/templates/kubernetes/fragments/write-heat-params-master.yaml View File

@@ -27,6 +27,7 @@ write_files:
27 27
       TENANT_NAME="$TENANT_NAME"
28 28
       CLUSTER_SUBNET="$CLUSTER_SUBNET"
29 29
       TLS_DISABLED="$TLS_DISABLED"
30
+      KUBE_DASHBOARD_ENABLED="$KUBE_DASHBOARD_ENABLED"
30 31
       CLUSTER_UUID="$CLUSTER_UUID"
31 32
       MAGNUM_URL="$MAGNUM_URL"
32 33
       VOLUME_DRIVER="$VOLUME_DRIVER"
@@ -35,6 +36,7 @@ write_files:
35 36
       NO_PROXY="$NO_PROXY"
36 37
       WAIT_CURL="$WAIT_CURL"
37 38
       KUBE_VERSION="$KUBE_VERSION"
39
+      KUBE_DASHBOARD_VERSION="$KUBE_DASHBOARD_VERSION"
38 40
       TRUSTEE_USER_ID="$TRUSTEE_USER_ID"
39 41
       TRUSTEE_PASSWORD="$TRUSTEE_PASSWORD"
40 42
       TRUST_ID="$TRUST_ID"

+ 2
- 1
magnum/drivers/heat/k8s_template_def.py View File

@@ -109,7 +109,8 @@ class K8sTemplateDefinition(template_def.BaseTemplateDefinition):
109 109
                       'flannel_network_subnetlen',
110 110
                       'system_pods_initial_delay',
111 111
                       'system_pods_timeout',
112
-                      'admission_control_list']
112
+                      'admission_control_list',
113
+                      'kube_dashboard_enabled']
113 114
 
114 115
         for label in label_list:
115 116
             extra_params[label] = cluster_template.labels.get(label)

+ 12
- 0
magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml View File

@@ -227,6 +227,11 @@ parameters:
227 227
     description: whether or not to disable TLS
228 228
     default: False
229 229
 
230
+  kube_dashboard_enabled:
231
+    type: boolean
232
+    description: whether or not to enable kubernetes dashboard
233
+    default: True
234
+
230 235
   kubernetes_port:
231 236
     type: number
232 237
     description: >
@@ -288,6 +293,11 @@ parameters:
288 293
     description: version of kubernetes used for kubernetes cluster
289 294
     default: v1.5.3
290 295
 
296
+  kube_dashboard_version:
297
+    type: string
298
+    description: version of kubernetes dashboard used for kubernetes cluster
299
+    default: v1.5.1
300
+
291 301
   insecure_registry_url:
292 302
     type: string
293 303
     description: insecure registry url
@@ -448,11 +458,13 @@ resources:
448 458
           tenant_name: {get_param: tenant_name}
449 459
           kubernetes_port: {get_param: kubernetes_port}
450 460
           tls_disabled: {get_param: tls_disabled}
461
+          kube_dashboard_enabled: {get_param: kube_dashboard_enabled}
451 462
           secgroup_kube_master_id: {get_resource: secgroup_kube_master}
452 463
           http_proxy: {get_param: http_proxy}
453 464
           https_proxy: {get_param: https_proxy}
454 465
           no_proxy: {get_param: no_proxy}
455 466
           kube_version: {get_param: kube_version}
467
+          kube_dashboard_version: {get_param: kube_dashboard_version}
456 468
           trustee_user_id: {get_param: trustee_user_id}
457 469
           trustee_password: {get_param: trustee_password}
458 470
           trust_id: {get_param: trust_id}

+ 11
- 1
magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml View File

@@ -95,6 +95,10 @@ parameters:
95 95
     type: boolean
96 96
     description: whether or not to enable TLS
97 97
 
98
+  kube_dashboard_enabled:
99
+    type: boolean
100
+    description: whether or not to disable kubernetes dashboard
101
+
98 102
   kubernetes_port:
99 103
     type: number
100 104
     description: >
@@ -184,6 +188,10 @@ parameters:
184 188
     type: string
185 189
     description: version of kubernetes used for kubernetes cluster
186 190
 
191
+  kube_dashboard_version:
192
+    type: string
193
+    description: version of kubernetes dashboard used for kubernetes cluster
194
+
187 195
   trustee_user_id:
188 196
     type: string
189 197
     description: user id of the trustee
@@ -272,6 +280,7 @@ resources:
272 280
             "$TENANT_NAME": {get_param: tenant_name}
273 281
             "$CLUSTER_SUBNET": {get_param: fixed_subnet}
274 282
             "$TLS_DISABLED": {get_param: tls_disabled}
283
+            "$KUBE_DASHBOARD_ENABLED": {get_param: kube_dashboard_enabled}
275 284
             "$CLUSTER_UUID": {get_param: cluster_uuid}
276 285
             "$MAGNUM_URL": {get_param: magnum_url}
277 286
             "$VOLUME_DRIVER": {get_param: volume_driver}
@@ -279,6 +288,7 @@ resources:
279 288
             "$HTTPS_PROXY": {get_param: https_proxy}
280 289
             "$NO_PROXY": {get_param: no_proxy}
281 290
             "$KUBE_VERSION": {get_param: kube_version}
291
+            "$KUBE_DASHBOARD_VERSION": {get_param: kube_dashboard_version}
282 292
             "$WAIT_CURL": {get_attr: [master_wait_handle, curl_cli]}
283 293
             "$TRUSTEE_USER_ID": {get_param: trustee_user_id}
284 294
             "$TRUSTEE_PASSWORD": {get_param: trustee_password}
@@ -366,7 +376,7 @@ resources:
366 376
     type: OS::Heat::SoftwareConfig
367 377
     properties:
368 378
       group: ungrouped
369
-      config: {get_file: ../../common/templates/kubernetes/fragments/kube-ui-service.sh}
379
+      config: {get_file: ../../common/templates/kubernetes/fragments/kube-dashboard-service.sh}
370 380
 
371 381
   enable_kube_proxy:
372 382
     type: OS::Heat::SoftwareConfig

+ 12
- 0
magnum/drivers/k8s_fedora_ironic_v1/templates/kubecluster.yaml View File

@@ -225,6 +225,11 @@ parameters:
225 225
     description: whether or not to disable TLS
226 226
     default: False
227 227
 
228
+  kube_dashboard_enabled:
229
+    type: boolean
230
+    description: whether or not to disable kubernetes dashboard
231
+    default: True
232
+
228 233
   kubernetes_port:
229 234
     type: number
230 235
     description: >
@@ -291,6 +296,11 @@ parameters:
291 296
     description: version of kubernetes used for kubernetes cluster
292 297
     default: v1.5.3
293 298
 
299
+  kube_dashboard_version:
300
+    type: string
301
+    description: version of kubernetes dashboard used for kubernetes cluster
302
+    default: v1.5.1
303
+
294 304
   insecure_registry_url:
295 305
     type: string
296 306
     description: insecure registry url
@@ -434,12 +444,14 @@ resources:
434 444
           tenant_name: {get_param: tenant_name}
435 445
           kubernetes_port: {get_param: kubernetes_port}
436 446
           tls_disabled: {get_param: tls_disabled}
447
+          kube_dashboard_enabled: {get_param: kube_dashboard_enabled}
437 448
           secgroup_base_id: {get_resource: secgroup_base}
438 449
           secgroup_kube_master_id: {get_resource: secgroup_kube_master}
439 450
           http_proxy: {get_param: http_proxy}
440 451
           https_proxy: {get_param: https_proxy}
441 452
           no_proxy: {get_param: no_proxy}
442 453
           kube_version: {get_param: kube_version}
454
+          kube_dashboard_version: {get_param: kube_dashboard_version}
443 455
           trustee_user_id: {get_param: trustee_user_id}
444 456
           trustee_password: {get_param: trustee_password}
445 457
           trust_id: {get_param: trust_id}

+ 11
- 1
magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml View File

@@ -91,6 +91,10 @@ parameters:
91 91
     type: boolean
92 92
     description: whether or not to enable TLS
93 93
 
94
+  kube_dashboard_enabled:
95
+    type: boolean
96
+    description: whether or not to disable kubernetes dashboard
97
+
94 98
   kubernetes_port:
95 99
     type: number
96 100
     description: >
@@ -179,6 +183,10 @@ parameters:
179 183
     type: string
180 184
     description: version of kubernetes used for kubernetes cluster
181 185
 
186
+  kube_dashboard_version:
187
+    type: string
188
+    description: version of kubernetes dashboard used for kubernetes cluster
189
+
182 190
   trustee_user_id:
183 191
     type: string
184 192
     description: user id of the trustee
@@ -260,12 +268,14 @@ resources:
260 268
             "$TENANT_NAME": {get_param: tenant_name}
261 269
             "$CLUSTER_SUBNET": {get_param: fixed_subnet}
262 270
             "$TLS_DISABLED": {get_param: tls_disabled}
271
+            "$KUBE_DASHBOARD_ENABLED": {get_param: kube_dashboard_enabled}
263 272
             "$CLUSTER_UUID": {get_param: cluster_uuid}
264 273
             "$MAGNUM_URL": {get_param: magnum_url}
265 274
             "$HTTP_PROXY": {get_param: http_proxy}
266 275
             "$HTTPS_PROXY": {get_param: https_proxy}
267 276
             "$NO_PROXY": {get_param: no_proxy}
268 277
             "$KUBE_VERSION": {get_param: kube_version}
278
+            "$KUBE_DASHBOARD_VERSION": {get_param: kube_dashboard_version}
269 279
             "$WAIT_CURL": {get_param: wc_curl_cli}
270 280
             "$TRUSTEE_USER_ID": {get_param: trustee_user_id}
271 281
             "$TRUSTEE_PASSWORD": {get_param: trustee_password}
@@ -354,7 +364,7 @@ resources:
354 364
     type: OS::Heat::SoftwareConfig
355 365
     properties:
356 366
       group: ungrouped
357
-      config: {get_file: ../../common/templates/kubernetes/fragments/kube-ui-service.sh}
367
+      config: {get_file: ../../common/templates/kubernetes/fragments/kube-dashboard-service.sh}
358 368
 
359 369
   enable_kube_proxy:
360 370
     type: OS::Heat::SoftwareConfig

+ 1
- 0
magnum/tests/functional/k8s/test_k8s_python_client.py View File

@@ -23,5 +23,6 @@ class TestKubernetesAPIs(base.BaseK8sTest):
23 23
             "system_pods_initial_delay": 3600,
24 24
             "system_pods_timeout": 600,
25 25
             "admission_control_list": "",
26
+            "kube_dashboard_enabled": False,
26 27
         }
27 28
     }

+ 2
- 1
magnum/tests/functional/k8s_ironic/test_k8s_python_client.py View File

@@ -24,6 +24,7 @@ class TestFedoraKubernetesIronicAPIs(base.BaseK8sTest):
24 24
         "docker_storage_driver": 'overlay',
25 25
         "labels": {
26 26
             "system_pods_initial_delay": 3600,
27
-            "system_pods_timeout": 600
27
+            "system_pods_timeout": 600,
28
+            "kube_dashboard_enabled": False
28 29
         }
29 30
     }

+ 10
- 2
magnum/tests/unit/conductor/handlers/test_k8s_cluster_conductor.py View File

@@ -51,7 +51,8 @@ class TestClusterConductorWithK8s(base.TestCase):
51 51
                        'flannel_backend': 'vxlan',
52 52
                        'system_pods_initial_delay': '15',
53 53
                        'system_pods_timeout': '1',
54
-                       'admission_control_list': 'fake_list'},
54
+                       'admission_control_list': 'fake_list',
55
+                       'kube_dashboard_enabled': 'True'},
55 56
             'tls_disabled': False,
56 57
             'server_type': 'vm',
57 58
             'registry_enabled': False,
@@ -149,7 +150,8 @@ class TestClusterConductorWithK8s(base.TestCase):
149 150
                        'flannel_backend': 'vxlan',
150 151
                        'system_pods_initial_delay': '15',
151 152
                        'system_pods_timeout': '1',
152
-                       'admission_control_list': 'fake_list'},
153
+                       'admission_control_list': 'fake_list',
154
+                       'kube_dashboard_enabled': 'True'},
153 155
             'http_proxy': 'http_proxy',
154 156
             'https_proxy': 'https_proxy',
155 157
             'no_proxy': 'no_proxy',
@@ -180,6 +182,7 @@ class TestClusterConductorWithK8s(base.TestCase):
180 182
             'system_pods_initial_delay': '15',
181 183
             'system_pods_timeout': '1',
182 184
             'admission_control_list': 'fake_list',
185
+            'kube_dashboard_enabled': 'True',
183 186
             'http_proxy': 'http_proxy',
184 187
             'https_proxy': 'https_proxy',
185 188
             'no_proxy': 'no_proxy',
@@ -261,6 +264,7 @@ class TestClusterConductorWithK8s(base.TestCase):
261 264
             'system_pods_initial_delay': '15',
262 265
             'system_pods_timeout': '1',
263 266
             'admission_control_list': 'fake_list',
267
+            'kube_dashboard_enabled': 'True',
264 268
             'http_proxy': 'http_proxy',
265 269
             'https_proxy': 'https_proxy',
266 270
             'magnum_url': 'http://127.0.0.1:9511/v1',
@@ -344,6 +348,7 @@ class TestClusterConductorWithK8s(base.TestCase):
344 348
             'system_pods_initial_delay': '15',
345 349
             'system_pods_timeout': '1',
346 350
             'admission_control_list': 'fake_list',
351
+            'kube_dashboard_enabled': 'True',
347 352
             'insecure_registry_url': '10.0.0.1:5000',
348 353
             'kube_version': 'fake-version',
349 354
             'magnum_url': 'http://127.0.0.1:9511/v1',
@@ -419,6 +424,7 @@ class TestClusterConductorWithK8s(base.TestCase):
419 424
             'system_pods_initial_delay': '15',
420 425
             'system_pods_timeout': '1',
421 426
             'admission_control_list': 'fake_list',
427
+            'kube_dashboard_enabled': 'True',
422 428
             'tls_disabled': False,
423 429
             'registry_enabled': False,
424 430
             'trustee_domain_id': self.mock_keystone.trustee_domain_id,
@@ -486,6 +492,7 @@ class TestClusterConductorWithK8s(base.TestCase):
486 492
             'system_pods_initial_delay': '15',
487 493
             'system_pods_timeout': '1',
488 494
             'admission_control_list': 'fake_list',
495
+            'kube_dashboard_enabled': 'True',
489 496
             'tls_disabled': False,
490 497
             'registry_enabled': False,
491 498
             'trustee_domain_id': self.mock_keystone.trustee_domain_id,
@@ -679,6 +686,7 @@ class TestClusterConductorWithK8s(base.TestCase):
679 686
             'system_pods_initial_delay': '15',
680 687
             'system_pods_timeout': '1',
681 688
             'admission_control_list': 'fake_list',
689
+            'kube_dashboard_enabled': 'True',
682 690
             'tenant_name': 'fake_tenant',
683 691
             'username': 'fake_user',
684 692
             'cluster_uuid': self.cluster_dict['uuid'],

+ 6
- 0
magnum/tests/unit/drivers/test_template_definition.py View File

@@ -260,6 +260,8 @@ class AtomicK8sTemplateDefinitionTestCase(BaseTemplateDefinitionTestCase):
260 260
             'system_pods_timeout')
261 261
         admission_control_list = mock_cluster_template.labels.get(
262 262
             'admission_control_list')
263
+        kube_dashboard_enabled = mock_cluster_template.labels.get(
264
+            'kube_dashboard_enabled')
263 265
 
264 266
         k8s_def = k8sa_tdef.AtomicK8sTemplateDefinition()
265 267
 
@@ -275,6 +277,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseTemplateDefinitionTestCase):
275 277
             'system_pods_initial_delay': system_pods_initial_delay,
276 278
             'system_pods_timeout': system_pods_timeout,
277 279
             'admission_control_list': admission_control_list,
280
+            'kube_dashboard_enabled': kube_dashboard_enabled,
278 281
             'username': 'fake_user',
279 282
             'tenant_name': 'fake_tenant',
280 283
             'magnum_url': mock_osc.magnum_url.return_value,
@@ -325,6 +328,8 @@ class AtomicK8sTemplateDefinitionTestCase(BaseTemplateDefinitionTestCase):
325 328
             'system_pods_timeout')
326 329
         admission_control_list = mock_cluster_template.labels.get(
327 330
             'admission_control_list')
331
+        kube_dashboard_enabled = mock_cluster_template.labels.get(
332
+            'kube_dashboard_enabled')
328 333
 
329 334
         k8s_def = k8sa_tdef.AtomicK8sTemplateDefinition()
330 335
 
@@ -340,6 +345,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseTemplateDefinitionTestCase):
340 345
             'system_pods_initial_delay': system_pods_initial_delay,
341 346
             'system_pods_timeout': system_pods_timeout,
342 347
             'admission_control_list': admission_control_list,
348
+            'kube_dashboard_enabled': kube_dashboard_enabled,
343 349
             'username': 'fake_user',
344 350
             'tenant_name': 'fake_tenant',
345 351
             'magnum_url': mock_osc.magnum_url.return_value,

Loading…
Cancel
Save