Add docker volume size option for cluster
Add docker volume size option as number into cluster workflow for create. Change-Id: I18528d87d5696795742973c90da85b74fbfc3894 Implements: blueprint add-docker-volume-size-option
This commit is contained in:
parent
6db5050e34
commit
1b662de231
@ -17,30 +17,21 @@ from __future__ import absolute_import
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from magnumclient.v1 import client as magnum_client
|
|
||||||
|
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon.utils.memoized import memoized
|
from horizon.utils.memoized import memoized
|
||||||
from openstack_dashboard.api import base
|
from openstack_dashboard.api import base
|
||||||
|
|
||||||
|
from magnumclient.v1 import certificates
|
||||||
|
from magnumclient.v1 import client as magnum_client
|
||||||
|
from magnumclient.v1 import cluster_templates
|
||||||
|
from magnumclient.v1 import clusters
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
CLUSTER_TEMPLATE_CREATE_ATTRS = ['name', 'image_id', 'flavor_id',
|
CLUSTER_TEMPLATE_CREATE_ATTRS = cluster_templates.CREATION_ATTRIBUTES
|
||||||
'master_flavor_id', 'keypair_id',
|
CLUSTER_CREATE_ATTRS = clusters.CREATION_ATTRIBUTES
|
||||||
'external_network_id', 'fixed_network',
|
CERTIFICATE_CREATE_ATTRS = certificates.CREATION_ATTRIBUTES
|
||||||
'dns_nameserver', 'docker_volume_size',
|
|
||||||
'labels', 'coe', 'http_proxy', 'https_proxy',
|
|
||||||
'no_proxy', 'network_driver', 'volume_driver',
|
|
||||||
'public', 'registry_enabled', 'tls_disabled',
|
|
||||||
'docker_storage_driver', 'fixed_subnet',
|
|
||||||
'floating_ip_enabled', 'master_lb_enabled',
|
|
||||||
'insecure_registry']
|
|
||||||
|
|
||||||
CLUSTER_CREATE_ATTRS = ['name', 'cluster_template_id', 'node_count',
|
|
||||||
'discovery_url', 'create_timeout',
|
|
||||||
'master_count', 'keypair']
|
|
||||||
|
|
||||||
CERTIFICATE_CREATE_ATTRS = ['cluster_uuid', 'csr']
|
|
||||||
|
|
||||||
|
|
||||||
def _cleanup_params(attrs, check, **params):
|
def _cleanup_params(attrs, check, **params):
|
||||||
|
@ -77,6 +77,8 @@
|
|||||||
? response.data.create_timeout : null;
|
? response.data.create_timeout : null;
|
||||||
config.model.keypair = response.data.keypair
|
config.model.keypair = response.data.keypair
|
||||||
? response.data.keypair : "";
|
? response.data.keypair : "";
|
||||||
|
config.model.docker_volume_size = response.data.docker_volume_size
|
||||||
|
? response.data.docker_volume_size : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return modal.open(config).then(submit);
|
return modal.open(config).then(submit);
|
||||||
|
@ -48,7 +48,8 @@
|
|||||||
registry_enabled: "",
|
registry_enabled: "",
|
||||||
tls_disabled: "",
|
tls_disabled: "",
|
||||||
apiserver_port: "",
|
apiserver_port: "",
|
||||||
keypair_id: ""
|
keypair_id: "",
|
||||||
|
docker_volume_size: ""
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +75,13 @@
|
|||||||
$scope.model.keypair = response.data.keypair_id;
|
$scope.model.keypair = response.data.keypair_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($scope.model.docker_volume_size === "") {
|
||||||
|
if (response.data.docker_volume_size === null) {
|
||||||
|
$scope.model.docker_volume_size = "";
|
||||||
|
} else {
|
||||||
|
$scope.model.docker_volume_size = response.data.docker_volume_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function watchClusterTemplateId() {
|
function watchClusterTemplateId() {
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
<dd>{$ ctrl.clusterTemplate.image_id $}</dd>
|
<dd>{$ ctrl.clusterTemplate.image_id $}</dd>
|
||||||
<dt translate>Keypair</dt>
|
<dt translate>Keypair</dt>
|
||||||
<dd>{$ ctrl.clusterTemplate.keypair_id|noValue $}</dd>
|
<dd>{$ ctrl.clusterTemplate.keypair_id|noValue $}</dd>
|
||||||
|
<dt translate>Docker Volume Size</dt>
|
||||||
|
<dd>{$ ctrl.clusterTemplate.docker_volume_size|gb|noValue $}</dd>
|
||||||
<dt translate>Public</dt>
|
<dt translate>Public</dt>
|
||||||
<dd>{$ ctrl.clusterTemplate.public $}</dd>
|
<dd>{$ ctrl.clusterTemplate.public $}</dd>
|
||||||
<dt translate>Registry Enabled</dt>
|
<dt translate>Registry Enabled</dt>
|
||||||
|
@ -1 +1 @@
|
|||||||
<p translate>Specify the number of master nodes and cluster nodes for the cluster.</p>
|
<p translate>Specify the number of master nodes, cluster nodes and docker volume size for the cluster.</p>
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
var schema, form, model;
|
var schema, form, model;
|
||||||
var clusterTemplates = [{value:"", name: gettext("Choose a Cluster Template")}];
|
var clusterTemplates = [{value:"", name: gettext("Choose a Cluster Template")}];
|
||||||
var keypairs = [{value:"", name: gettext("Choose a Keypair")}];
|
var keypairs = [{value:"", name: gettext("Choose a Keypair")}];
|
||||||
|
var dockerVolumeSizeDescription = gettext(
|
||||||
|
"If not specified, the value specified in Clsuter Template will be used.");
|
||||||
|
|
||||||
// schema
|
// schema
|
||||||
schema = {
|
schema = {
|
||||||
@ -75,6 +77,10 @@
|
|||||||
'keypair': {
|
'keypair': {
|
||||||
title: gettext('Keypair'),
|
title: gettext('Keypair'),
|
||||||
type: 'string'
|
type: 'string'
|
||||||
|
},
|
||||||
|
'docker_volume_size': {
|
||||||
|
title: gettext('Docker Volume Size (GB)'),
|
||||||
|
type: 'number'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -133,6 +139,12 @@
|
|||||||
{
|
{
|
||||||
key: 'node_count',
|
key: 'node_count',
|
||||||
placeholder: gettext('The cluster node count.')
|
placeholder: gettext('The cluster node count.')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'docker_volume_size',
|
||||||
|
placeholder: gettext('Specify the size in GB for the docker volume'),
|
||||||
|
description: dockerVolumeSizeDescription,
|
||||||
|
readonly: action === 'update'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -196,6 +208,7 @@
|
|||||||
cluster_template_id: "",
|
cluster_template_id: "",
|
||||||
master_count: null,
|
master_count: null,
|
||||||
node_count: null,
|
node_count: null,
|
||||||
|
docker_volume_size: "",
|
||||||
discovery_url: "",
|
discovery_url: "",
|
||||||
create_timeout: null,
|
create_timeout: null,
|
||||||
keypair: ""
|
keypair: ""
|
||||||
|
Loading…
Reference in New Issue
Block a user