mirror of https://github.com/rancher/ui.git
amazon driver updates
This commit is contained in:
parent
487e5779db
commit
dc4fa0bd26
|
|
@ -1,3 +1,10 @@
|
||||||
<section>
|
<section>
|
||||||
{{add-host allowCustom=(not app.isCaas) model=model driver=driver completed=(action 'completed') goBack=(action 'goBack') cancel=(action 'goBack')}}
|
{{add-host
|
||||||
|
allowCustom=false
|
||||||
|
model=model
|
||||||
|
driver=driver
|
||||||
|
completed=(action 'completed')
|
||||||
|
goBack=(action 'goBack')
|
||||||
|
cancel=(action 'goBack')
|
||||||
|
}}
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<section>
|
<section>
|
||||||
{{add-host
|
{{add-host
|
||||||
allowCustom=(not app.isCaas)
|
allowCustom=false
|
||||||
model=model
|
model=model
|
||||||
driver=driver
|
driver=driver
|
||||||
completed=(action 'completed')
|
completed=(action 'completed')
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,13 @@
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import { scheduleOnce } from '@ember/runloop';
|
import { scheduleOnce } from '@ember/runloop';
|
||||||
import EmberObject, { computed } from '@ember/object';
|
import EmberObject, { computed, get, set, setProperties } from '@ember/object';
|
||||||
import { alias, equal, gte } from '@ember/object/computed';
|
import { alias, equal, gte } from '@ember/object/computed';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import Driver from 'shared/mixins/host-driver';
|
import Driver from 'shared/mixins/host-driver';
|
||||||
import layout from './template';
|
import layout from './template';
|
||||||
|
|
||||||
let RANCHER_TAG = 'rancher-ui';
|
let RANCHER_GROUP = 'rancher-nodes';
|
||||||
let RANCHER_GROUP = 'rancher-machine';
|
|
||||||
let RANCHER_INGRESS_RULES = [
|
|
||||||
{ FromPort: 6443, ToPort: 6443, CidrIp: '0.0.0.0/0', IpProtocol: 'tcp' }, // Rancher Cluster manager
|
|
||||||
{ FromPort: -1, ToPort: -1, CidrIp: '0.0.0.0/0', IpProtocol: 'icmp' }, // MTU Path discovery (shouldiblockicmp.com)
|
|
||||||
|
|
||||||
// Docker-machine creates these ports if we don't,
|
|
||||||
// but explodes with race conditions if you try to deploy 2 hosts simultaneously and they both want to create it.
|
|
||||||
// So we'll just have the UI create them up front.
|
|
||||||
{ FromPort: 22, ToPort: 22, CidrIp: '0.0.0.0/0', IpProtocol: 'tcp' }, // SSH, to install Docker
|
|
||||||
{ FromPort: 2376, ToPort: 2376, CidrIp: '0.0.0.0/0', IpProtocol: 'tcp' }, // Docker Remote API, for no good reason
|
|
||||||
];
|
|
||||||
|
|
||||||
let RANCHER_INTERNAL_RULES = [
|
|
||||||
// : 2379,2380 (etcd), 10251 (Scheduler), 10252 (Controller), 10250 (kubelet), 10256 (kubeproxy), 6443 (kubeapi)
|
|
||||||
// 8472/udp (flannel)
|
|
||||||
{ FromPort: 2379, ToPort: 2380, IpProtocol: 'tcp' }, // etcd
|
|
||||||
{ FromPort: 6443, ToPort: 6443, IpProtocol: 'tcp' }, // cluster manager
|
|
||||||
{ FromPort: 4789, ToPort: 4789, IpProtocol: 'udp' }, // vxlan
|
|
||||||
{ FromPort: 8472, ToPort: 8472, IpProtocol: 'udp' }, // flannel
|
|
||||||
{ FromPort: 10250, ToPort: 10256, IpProtocol: 'tcp' }, // kubelet, scheduler, controller, federation, ingress, readonly kublelet, kubeproxy
|
|
||||||
];
|
|
||||||
|
|
||||||
let INSTANCE_TYPES = [
|
let INSTANCE_TYPES = [
|
||||||
{group: 'T2 - Burstable', name: 't2.nano'},
|
{group: 'T2 - Burstable', name: 't2.nano'},
|
||||||
|
|
@ -195,19 +174,19 @@ export default Component.extend(Driver, {
|
||||||
isGteStep7 : gte('step',7),
|
isGteStep7 : gte('step',7),
|
||||||
|
|
||||||
bootstrap: function() {
|
bootstrap: function() {
|
||||||
let pref = this.get('prefs.amazonec2')||{};
|
let pref = get(this, 'prefs.amazonec2')||{};
|
||||||
let config = this.get('globalStore').createRecord({
|
let config = get(this, 'globalStore').createRecord({
|
||||||
type : 'amazonec2Config',
|
type : 'amazonec2Config',
|
||||||
region : 'us-west-2',
|
region : 'us-west-2',
|
||||||
instanceType : 't2.micro',
|
instanceType : 't2.micro',
|
||||||
securityGroup : ['rancher-machine',],
|
securityGroup : '',
|
||||||
zone : 'a',
|
zone : 'a',
|
||||||
rootSize : '16',
|
rootSize : '16',
|
||||||
accessKey : pref.accessKey||'',
|
accessKey : pref.accessKey||'',
|
||||||
secretKey : pref.secretKey||'',
|
secretKey : pref.secretKey||'',
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('model', this.get('globalStore').createRecord({
|
set(this, 'model', get(this, 'globalStore').createRecord({
|
||||||
type: 'machineTemplate',
|
type: 'machineTemplate',
|
||||||
driver: 'amazonec2',
|
driver: 'amazonec2',
|
||||||
amazonec2Config: config
|
amazonec2Config: config
|
||||||
|
|
@ -217,30 +196,32 @@ export default Component.extend(Driver, {
|
||||||
validate() {
|
validate() {
|
||||||
let errors = [];
|
let errors = [];
|
||||||
|
|
||||||
if ( !this.get('model.name') ) {
|
if ( !get(this, 'model.name') ) {
|
||||||
errors.push('Name is required');
|
errors.push('Name is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set('errors', errors);
|
set(this, 'errors', errors);
|
||||||
return errors.length === 0;
|
return errors.length === 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
this.set('editing', false);
|
setProperties(this, {
|
||||||
this.set('clients', EmberObject.create());
|
editing: false,
|
||||||
this.set('allSubnets', []);
|
clients: EmberObject.create(),
|
||||||
|
allSubnets: []
|
||||||
|
})
|
||||||
|
|
||||||
let cur = this.get('amazonec2Config.securityGroup');
|
let cur = get(this, 'amazonec2Config.securityGroup');
|
||||||
|
|
||||||
if ( cur.length === 1 && cur[0] === RANCHER_GROUP ) {
|
if ( cur === '' ) { // TODO 2.0 should this be null 403 Vince/Wes/Daishan
|
||||||
this.setProperties({
|
setProperties(this, {
|
||||||
whichSecurityGroup : 'default',
|
whichSecurityGroup : 'default',
|
||||||
selectedSecurityGroup : null,
|
selectedSecurityGroup : null,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setProperties({
|
setProperties(this, {
|
||||||
whichSecurityGroup : 'custom',
|
whichSecurityGroup : 'custom',
|
||||||
selectedSecurityGroup : cur,
|
selectedSecurityGroup : cur,
|
||||||
});
|
});
|
||||||
|
|
@ -248,7 +229,7 @@ export default Component.extend(Driver, {
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement: function() {
|
willDestroyElement: function() {
|
||||||
this.setProperties({
|
setProperties(this, {
|
||||||
step : 1,
|
step : 1,
|
||||||
machineId : null,
|
machineId : null,
|
||||||
clients : null,
|
clients : null,
|
||||||
|
|
@ -267,17 +248,19 @@ export default Component.extend(Driver, {
|
||||||
actions: {
|
actions: {
|
||||||
awsLogin: function() {
|
awsLogin: function() {
|
||||||
let self = this;
|
let self = this;
|
||||||
this.set('errors',null);
|
|
||||||
this.set('step',2);
|
|
||||||
|
|
||||||
this.set('amazonec2Config.accessKey', (this.get('amazonec2Config.accessKey')||'').trim());
|
setProperties(this, {
|
||||||
this.set('amazonec2Config.secretKey', (this.get('amazonec2Config.secretKey')||'').trim());
|
'errors':null,
|
||||||
|
'step':2,
|
||||||
|
'amazonec2Config.accessKey': (get(this, 'amazonec2Config.accessKey')||'').trim(),
|
||||||
|
'amazonec2Config.secretKey': (get(this, 'amazonec2Config.secretKey')||'').trim(),
|
||||||
|
});
|
||||||
|
|
||||||
let subnets = [];
|
let subnets = [];
|
||||||
let rName = this.get('amazonec2Config.region');
|
let rName = get(this, 'amazonec2Config.region');
|
||||||
let ec2 = new AWS.EC2({
|
let ec2 = new AWS.EC2({
|
||||||
accessKeyId : this.get('amazonec2Config.accessKey'),
|
accessKeyId : get(this, 'amazonec2Config.accessKey'),
|
||||||
secretAccessKey : this.get('amazonec2Config.secretKey'),
|
secretAccessKey : get(this, 'amazonec2Config.secretKey'),
|
||||||
region : rName,
|
region : rName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -288,8 +271,10 @@ export default Component.extend(Driver, {
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
let errors = self.get('errors')||[];
|
let errors = self.get('errors')||[];
|
||||||
errors.pushObject(err);
|
errors.pushObject(err);
|
||||||
this.set('errors', errors);
|
setProperties(this, {
|
||||||
this.set('step', 1);
|
'errors': errors,
|
||||||
|
'step': 1
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -302,12 +287,14 @@ export default Component.extend(Driver, {
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
let errors = self.get('errors')||[];
|
let errors = self.get('errors')||[];
|
||||||
errors.pushObject(err);
|
errors.pushObject(err);
|
||||||
this.set('errors', errors);
|
setProperties(this, {
|
||||||
this.set('step', 1);
|
'errors': errors,
|
||||||
|
'step': 1
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('clients').set(rName, ec2);
|
get(this, 'clients').set(rName, ec2);
|
||||||
|
|
||||||
data.Subnets.forEach((subnet) => {
|
data.Subnets.forEach((subnet) => {
|
||||||
if ( (subnet.State||'').toLowerCase() !== 'available' )
|
if ( (subnet.State||'').toLowerCase() !== 'available' )
|
||||||
|
|
@ -327,39 +314,43 @@ export default Component.extend(Driver, {
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('allSubnets', subnets);
|
setProperties(this, {
|
||||||
this.set('step', 3);
|
'allSubnets': subnets,
|
||||||
|
'step': 3
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
selectSubnet: function() {
|
selectSubnet: function() {
|
||||||
this.set('errors',null);
|
set(this, 'errors',null);
|
||||||
|
|
||||||
if ( !this.get('selectedZone') ) {
|
if ( !get(this, 'selectedZone') ) {
|
||||||
this.set('errors', ['Select an Availability Zone']);
|
set(this, 'errors', ['Select an Availability Zone']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.get('selectedSubnet') ) {
|
if ( !get(this, 'selectedSubnet') ) {
|
||||||
this.set('errors', ['Select a VPC or Subnet']);
|
set(this, 'errors', ['Select a VPC or Subnet']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set('step', 4);
|
set(this, 'step', 4);
|
||||||
|
|
||||||
let ec2 = this.get('clients').get(this.get('amazonec2Config.region'));
|
let ec2 = get(this, 'clients').get(get(this, 'amazonec2Config.region'));
|
||||||
let filter = {Name: 'vpc-id', Values: [ this.get('amazonec2Config.vpcId')]};
|
let filter = {Name: 'vpc-id', Values: [ get(this, 'amazonec2Config.vpcId')]};
|
||||||
|
|
||||||
ec2.describeSecurityGroups({Filters: [filter]}, (err, data) => {
|
ec2.describeSecurityGroups({Filters: [filter]}, (err, data) => {
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
this.set('errors',[err]);
|
setProperties(this, {
|
||||||
this.set('step', 3);
|
'errors': [err],
|
||||||
|
'step': 3
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let groups = [];
|
let groups = [];
|
||||||
let defaultGroup = null;
|
|
||||||
|
|
||||||
data.SecurityGroups.forEach((group) => {
|
data.SecurityGroups.forEach((group) => {
|
||||||
let tags = {};
|
let tags = {};
|
||||||
|
|
@ -377,20 +368,17 @@ export default Component.extend(Driver, {
|
||||||
id : group.GroupId,
|
id : group.GroupId,
|
||||||
name : group.GroupName,
|
name : group.GroupName,
|
||||||
description : group.Description,
|
description : group.Description,
|
||||||
isDefault : group.GroupName === this.get('defaultSecurityGroupName'),
|
|
||||||
isRancher : (typeof tags[RANCHER_TAG] !== 'undefined')
|
|
||||||
};
|
};
|
||||||
|
|
||||||
groups.push(obj);
|
groups.push(obj);
|
||||||
|
|
||||||
if ( obj.isDefault && !defaultGroup) {
|
|
||||||
defaultGroup = obj;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('step', 5);
|
setProperties(this, {
|
||||||
this.set('allSecurityGroups', groups);
|
'allSecurityGroups': groups,
|
||||||
this.set('defaultSecurityGroup', defaultGroup);
|
'step': 5
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -402,83 +390,29 @@ export default Component.extend(Driver, {
|
||||||
return selectedOptions.push(cap.value);
|
return selectedOptions.push(cap.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('selectedSecurityGroup', selectedOptions);
|
set(this, 'selectedSecurityGroup', selectedOptions);
|
||||||
},
|
},
|
||||||
|
|
||||||
selectSecurityGroup: function() {
|
selectSecurityGroup: function() {
|
||||||
this.set('errors',null);
|
set(this, 'errors',null);
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
let ec2 = this.get('clients').get(this.get('amazonec2Config.region'));
|
|
||||||
|
|
||||||
if ( this.get('isCustomSecurityGroup') ) {
|
if ( get(this, 'isCustomSecurityGroup') ) {
|
||||||
this.set('amazonec2Config.securityGroup', this.get('selectedSecurityGroup'));
|
set(this, 'amazonec2Config.securityGroup', get(this, 'selectedSecurityGroup'));
|
||||||
done();
|
done();
|
||||||
} else {
|
} else {
|
||||||
this.set('step', 6);
|
setProperties(this, {
|
||||||
this.set('amazonec2Config.securityGroup', [this.get('defaultSecurityGroupName')]);
|
'amazonec2Config.securityGroup': '',
|
||||||
let group = this.get('defaultSecurityGroup');
|
'step': 6
|
||||||
if ( group ) {
|
|
||||||
if ( group.isRancher ) {
|
|
||||||
this.set('amazonec2Config.securityGroup', group.name);
|
|
||||||
done();
|
|
||||||
} else {
|
|
||||||
addRules(group.id, done);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ec2.createSecurityGroup({
|
|
||||||
GroupName : this.get('defaultSecurityGroupName'),
|
|
||||||
Description : `${this.get('settings.appName')} default security group`,
|
|
||||||
VpcId : this.get('amazonec2Config.vpcId'),
|
|
||||||
}, function(err, data) {
|
|
||||||
if ( err ) {
|
|
||||||
return done(err);
|
|
||||||
} else {
|
|
||||||
return addRules(data.GroupId, done);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addRules(groupId, cb) {
|
|
||||||
async.each(RANCHER_INGRESS_RULES, function(item, cb) {
|
|
||||||
let params = JSON.parse(JSON.stringify(item)); // Don't change the original
|
|
||||||
params.GroupId = groupId;
|
|
||||||
ec2.authorizeSecurityGroupIngress(params, cb);
|
|
||||||
}, function(err) {
|
|
||||||
if ( err ) {
|
|
||||||
return cb(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
async.each(RANCHER_INTERNAL_RULES, function(item, cb) {
|
|
||||||
let ipPermission = JSON.parse(JSON.stringify(item)); // Don't change the original
|
|
||||||
ipPermission.UserIdGroupPairs = [
|
|
||||||
{GroupId: groupId}
|
|
||||||
];
|
|
||||||
|
|
||||||
let params = {
|
|
||||||
GroupId: groupId,
|
|
||||||
IpPermissions: [ipPermission],
|
|
||||||
}
|
|
||||||
|
|
||||||
params.GroupId = groupId;
|
|
||||||
ec2.authorizeSecurityGroupIngress(params, cb);
|
|
||||||
}, function(err) {
|
|
||||||
if ( err ) {
|
|
||||||
return cb(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
ec2.createTags({
|
|
||||||
Resources : [groupId],
|
|
||||||
Tags : [ {Key : RANCHER_TAG, Value : self.get('app.version') }]
|
|
||||||
}, cb);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
function done(err) {
|
function done(err) {
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
this.set('errors', [err]);
|
set(this, 'errors', [err]);
|
||||||
self.set('step', 5);
|
self.set('step', 5);
|
||||||
} else {
|
} else {
|
||||||
self.set('step', 7);
|
self.set('step', 7);
|
||||||
|
|
@ -489,7 +423,7 @@ export default Component.extend(Driver, {
|
||||||
|
|
||||||
selectedZone: computed('amazonec2Config.{region,zone}', {
|
selectedZone: computed('amazonec2Config.{region,zone}', {
|
||||||
get: function() {
|
get: function() {
|
||||||
let config = this.get('amazonec2Config');
|
let config = get(this, 'amazonec2Config');
|
||||||
if ( config.get('region') && config.get('zone') ) {
|
if ( config.get('region') && config.get('zone') ) {
|
||||||
return config.get('region') + config.get('zone');
|
return config.get('region') + config.get('zone');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -498,15 +432,15 @@ export default Component.extend(Driver, {
|
||||||
},
|
},
|
||||||
|
|
||||||
set: function(key, val) {
|
set: function(key, val) {
|
||||||
let config = this.get('amazonec2Config');
|
let config = get(this, 'amazonec2Config');
|
||||||
config.setProperties({
|
config.setProperties({
|
||||||
region : val.substr(0, val.length - 1),
|
region : val.substr(0, val.length - 1),
|
||||||
zone : val.substr(val.length - 1),
|
zone : val.substr(val.length - 1),
|
||||||
});
|
});
|
||||||
|
|
||||||
let selectedSubnet = this.get('selectedSubnet');
|
let selectedSubnet = get(this, 'selectedSubnet');
|
||||||
|
|
||||||
if ( this.get('subnetChoices').filterBy('value', selectedSubnet).length === 0 ) {
|
if ( get(this, 'subnetChoices').filterBy('value', selectedSubnet).length === 0 ) {
|
||||||
config.setProperties({
|
config.setProperties({
|
||||||
region : val.substr(0, val.length - 1),
|
region : val.substr(0, val.length - 1),
|
||||||
zone : val.substr(val.length - 1),
|
zone : val.substr(val.length - 1),
|
||||||
|
|
@ -524,9 +458,9 @@ export default Component.extend(Driver, {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
zoneChoices: function() {
|
zoneChoices: function() {
|
||||||
const choices = (this.get('allSubnets')||[]).map((subnet) => {return subnet.get('zone');}).sort().uniq();
|
const choices = (get(this, 'allSubnets')||[]).map((subnet) => {return subnet.get('zone');}).sort().uniq();
|
||||||
if ( choices.length ) {
|
if ( choices.length ) {
|
||||||
this.set('selectedZone', choices[0]);
|
set(this, 'selectedZone', choices[0]);
|
||||||
}
|
}
|
||||||
return choices;
|
return choices;
|
||||||
}.property('allSubnets.@each.{zone}'),
|
}.property('allSubnets.@each.{zone}'),
|
||||||
|
|
@ -535,7 +469,7 @@ export default Component.extend(Driver, {
|
||||||
let out = [];
|
let out = [];
|
||||||
let seenVpcs = [];
|
let seenVpcs = [];
|
||||||
|
|
||||||
(this.get('allSubnets')||[]).filterBy('zone', this.get('selectedZone')).forEach((subnet) => {
|
(get(this, 'allSubnets')||[]).filterBy('zone', get(this, 'selectedZone')).forEach((subnet) => {
|
||||||
let vpcName = subnet.get('vpcName');
|
let vpcName = subnet.get('vpcName');
|
||||||
let vpcId = subnet.get('vpcId');
|
let vpcId = subnet.get('vpcId');
|
||||||
let vpcTags = subnet.get('vpcTags');
|
let vpcTags = subnet.get('vpcTags');
|
||||||
|
|
@ -568,7 +502,7 @@ export default Component.extend(Driver, {
|
||||||
|
|
||||||
selectedSubnet: computed('amazonec2Config.{subnetId,vpcId}', {
|
selectedSubnet: computed('amazonec2Config.{subnetId,vpcId}', {
|
||||||
set: function(key, val) {
|
set: function(key, val) {
|
||||||
let config = this.get('amazonec2Config');
|
let config = get(this, 'amazonec2Config');
|
||||||
if ( arguments.length > 1 ) {
|
if ( arguments.length > 1 ) {
|
||||||
if ( val && val.length ) {
|
if ( val && val.length ) {
|
||||||
if ( val.indexOf('vpc-') === 0 ) {
|
if ( val.indexOf('vpc-') === 0 ) {
|
||||||
|
|
@ -595,12 +529,12 @@ export default Component.extend(Driver, {
|
||||||
},
|
},
|
||||||
|
|
||||||
get: function() {
|
get: function() {
|
||||||
let config = this.get('amazonec2Config');
|
let config = get(this, 'amazonec2Config');
|
||||||
return config.get('subnetId') || config.get('vpcId');
|
return config.get('subnetId') || config.get('vpcId');
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
subnetById: function(id) {
|
subnetById: function(id) {
|
||||||
return (this.get('allSubnets')||[]).filterBy('subnetId',id)[0];
|
return (get(this, 'allSubnets')||[]).filterBy('subnetId',id)[0];
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -191,11 +191,7 @@
|
||||||
<div class="radio pt-10">
|
<div class="radio pt-10">
|
||||||
<label>
|
<label>
|
||||||
{{radio-button selection=whichSecurityGroup value="default"}}
|
{{radio-button selection=whichSecurityGroup value="default"}}
|
||||||
{{#if defaultSecurityGroup}}
|
|
||||||
{{t 'machine.driverAmazon.securityGroup.defaultExisting' groupName=defaultSecurityGroupName htmlSafe=true}}
|
|
||||||
{{else}}
|
|
||||||
{{t 'machine.driverAmazon.securityGroup.defaultCreate' groupName=defaultSecurityGroupName htmlSafe=true}}
|
{{t 'machine.driverAmazon.securityGroup.defaultCreate' groupName=defaultSecurityGroupName htmlSafe=true}}
|
||||||
{{/if}}
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -216,13 +212,6 @@
|
||||||
<option value={{choice.name}} selected={{array-includes selectedSecurityGroup choice.name}}>{{choice.name}} ({{choice.id}})</option>
|
<option value={{choice.name}} selected={{array-includes selectedSecurityGroup choice.name}}>{{choice.name}} ({{choice.id}})</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<p style="m-0 mt-10">{{t 'machine.driverAmazon.needs.label' appName=settings.appName}}</p>
|
|
||||||
<ul>
|
|
||||||
<li>{{t 'machine.driverAmazon.needs.item1' appName=settings.appName htmlSafe=true}}</li>
|
|
||||||
<li>{{t 'machine.driverAmazon.needs.item2' appName=settings.appName htmlSafe=true}}</li>
|
|
||||||
<li>{{t 'machine.driverAmazon.needs.item3' appName=settings.appName htmlSafe=true}}</li>
|
|
||||||
</ul>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -233,7 +222,7 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{amazonec2Config.securityGroup}}
|
{{defaultSecurityGroupName}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
}}
|
}}
|
||||||
{{else if (eq mode 'add')}}
|
{{else if (eq mode 'add')}}
|
||||||
{{add-host
|
{{add-host
|
||||||
allowCustom=(not app.isCaas)
|
allowCustom=false
|
||||||
model=addHostModel.model
|
model=addHostModel.model
|
||||||
driver=driver
|
driver=driver
|
||||||
cluster=cluster
|
cluster=cluster
|
||||||
|
|
|
||||||
|
|
@ -3243,7 +3243,7 @@ machine:
|
||||||
securityGroup:
|
securityGroup:
|
||||||
label: Security Group
|
label: Security Group
|
||||||
choose: Choose an existing group
|
choose: Choose an existing group
|
||||||
defaultExisting: "Standard: Use the existing <code>{groupName}</code> group"
|
defaultExisting: "Standard: Use the existing <code>rancher-nodes</code> group"
|
||||||
defaultCreate: "Standard: Automatically create a <code>{groupName}</code> group"
|
defaultCreate: "Standard: Automatically create a <code>{groupName}</code> group"
|
||||||
custom: "Custom: Choose an existing group"
|
custom: "Custom: Choose an existing group"
|
||||||
updating: Updating Security Group...
|
updating: Updating Security Group...
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue