From 8d7104be1a46f2d2c00dc499f5354bae618a2751 Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Mon, 29 Aug 2016 15:04:42 +0900 Subject: [PATCH] Add cluster template options Following updates of magnumclient, this patch adds some properties to cluster template creation and views. To spec section: - docker_storage_driver: 'devicemapper' or 'overlay', default='devicemapper' To network section: - fixed_subnet: string - floating_ip_enabled: boolean, default=True - master_lb_enabled: boolean, default=False Change-Id: Ibeb9933e68f533b0aea3b6951a3c293dc85343e4 Implements: blueprint cluster-template-options Depends-On: I971ef74f0cc79346a76c1faba55777b0a44465da --- magnum_ui/api/magnum.py | 5 ++- .../create/cluster-template-model.js | 13 +++++-- .../create/network/network.help.html | 4 ++ .../create/network/network.html | 21 +++++++++++ .../create/spec/spec.help.html | 4 +- .../cluster-templates/create/spec/spec.html | 37 ++++++++++++------- .../cluster-templates/details/overview.html | 12 +++++- magnum_ui/test/test_data.py | 7 +++- 8 files changed, 80 insertions(+), 23 deletions(-) diff --git a/magnum_ui/api/magnum.py b/magnum_ui/api/magnum.py index 276f6595..5a885696 100644 --- a/magnum_ui/api/magnum.py +++ b/magnum_ui/api/magnum.py @@ -31,7 +31,10 @@ CLUSTER_TEMPLATE_CREATE_ATTRS = ['name', 'image_id', 'flavor_id', 'dns_nameserver', 'docker_volume_size', 'labels', 'coe', 'http_proxy', 'https_proxy', 'no_proxy', 'network_driver', 'volume_driver', - 'public', 'registry_enabled', 'tls_disabled'] + 'public', 'registry_enabled', 'tls_disabled', + 'docker_storage_driver', 'fixed_subnet', + 'floating_ip_enabled', 'master_lb_enabled', + 'insecure_registry'] CLUSTER_CREATE_ATTRS = ['name', 'baymodel_id', 'node_count', 'discovery_url', 'cluster_create_timeout', diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js index d5b02d0b..574a3e1d 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js @@ -45,6 +45,7 @@ flavor_id: "", master_flavor_id: "", docker_volume_size: null, + docker_storage_driver: "devicemapper", keypair_id: "", network_driver: "", volume_driver: "", @@ -53,13 +54,19 @@ no_proxy: null, external_network_id: "", fixed_network: "", + fixed_subnet: "", dns_nameserver: null, + master_lb_enabled: "", + floating_ip_enabled: true, labels: null, - network_drivers : [{name: "docker", label: gettext("Docker")}, + network_drivers : [{name: "", label: gettext("Choose a Network Driver")}, + {name: "docker", label: gettext("Docker")}, {name: "flannel", label: gettext("Flannel")}], volume_drivers : [{name: "", label: gettext("Choose a Volume Driver")}, {name: "cinder", label: gettext("Cinder")}, - {name: "rexray", label: gettext("Rexray")}] + {name: "rexray", label: gettext("Rexray")}], + docker_storage_drivers: [{name: "devicemapper", label: gettext("Device Mapper")}, + {name: "overlay", label: gettext("Overley")}] }; } @@ -83,7 +90,7 @@ // These are not for submittion. for (var key in finalSpec) { if (finalSpec.hasOwnProperty(key) && finalSpec[key] === null || finalSpec[key] === "" - || key === "network_drivers" || key === "volume_drivers") { + || key === "network_drivers" || key === "volume_drivers" || key === "docker_storage_drivers") { delete finalSpec[key]; } } diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html index 6718a3ad..715deef8 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html @@ -2,3 +2,7 @@
This should really be named fixed-network-cidr. Default: 10.0.0.0/24
DNS
Specify the nameserver to use for the cluster template. Default: 8.8.8.8
+
Master LB
+
Indicates whether created clusters should have a load balancer for master nodes or not. Default: False
+
Floating IP
+
Indicates whether created clusters should have a floating ip or not. Default: True
\ No newline at end of file diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html index efd12a89..a9080dd2 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html @@ -48,6 +48,13 @@ ng-model="model.newClusterTemplateSpec.fixed_network" placeholder="{$ 'The private Neutron network name to connect to this cluster template'|translate $}"> +
+ + +
+
+
+ + +
+
+
+
+ + +
+
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html index f8970011..a685eb9b 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html @@ -1,12 +1,12 @@
Image
The name or UUID of the base image to customize for the cluster.
+
Keypair
+
The name or UUID of the SSH keypair to load into the cluster nodes.
Flavor
The nova flavor id to use when launching the cluster. Default: m1.small
Master Flavor
The nova flavor id to use when launching the master node of the cluster. Default: m1.small
Docker Volume Size
The size in GB for Docker Volume. Default: 25
-
Keypair
-
The name or UUID of the SSH keypair to load into the cluster nodes.
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html index c208f405..138b294e 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html @@ -1,6 +1,6 @@
-
+
+
+
+ + +
+
@@ -30,7 +42,7 @@
-
+
+ +
+
-
-
- - -
-
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html index 849d3957..c946dcd9 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html @@ -24,16 +24,18 @@
Image ID
{$ ctrl.cluster_template.image_id $}
+
Keypair ID
+
{$ ctrl.cluster_template.keypair_id $}
Flavor ID
{$ ctrl.cluster_template.flavor_id $}
Master Flavor ID
{$ ctrl.cluster_template.master_flavor_id $}
Volume Driver
{$ ctrl.cluster_template.volume_driver $}
+
Docker Storage Driver
+
{$ ctrl.cluster_template.docker_storage_driver $}
Docker Volume Size
{$ ctrl.cluster_template.docker_volume_size | gb $}
-
Keypair ID
-
{$ ctrl.cluster_template.keypair_id $}
@@ -54,8 +56,14 @@
{$ ctrl.cluster_template.external_network_id $}
Fixed Network
{$ ctrl.cluster_template.fixed_network $}
+
Fixed Subnet
+
{$ ctrl.cluster_template.fixed_subnet $}
DNS
{$ ctrl.cluster_template.dns_nameserver $}
+
TLS Enabled
+
{$ ctrl.cluster_template.master_lb_enabled | yesno $}
+
Floating IP Enabled
+
{$ ctrl.cluster_template.floating_ip_enabled | yesno $}
diff --git a/magnum_ui/test/test_data.py b/magnum_ui/test/test_data.py index 7ed94072..c790b5ae 100644 --- a/magnum_ui/test/test_data.py +++ b/magnum_ui/test/test_data.py @@ -37,7 +37,12 @@ def data(TEST): "no-proxy": "", "labels": "", "tls-disabled": "", - "public": ""} + "public": "", + "docker_storage_driver": "", + "fixed_subnet": "", + "floating_ip_enabled": "", + "master_lb_enabled": "", + "insecure_registry": ""} TEST.cluster_templates.add(cluster_template_dict_1)