diff --git a/lib/nodes/addon/components/driver-amazonec2/component.js b/lib/nodes/addon/components/driver-amazonec2/component.js index 40f004caf..1179845e4 100644 --- a/lib/nodes/addon/components/driver-amazonec2/component.js +++ b/lib/nodes/addon/components/driver-amazonec2/component.js @@ -11,6 +11,7 @@ import NodeDriver from 'shared/mixins/node-driver'; import layout from './template'; import { INSTANCE_TYPES, nameFromResource, tagsFromResource, REGIONS } from 'shared/utils/amazon'; import { randomStr } from 'shared/utils/util'; +import { isEmpty } from '@ember/utils'; let RANCHER_GROUP = 'rancher-nodes'; @@ -46,9 +47,9 @@ export default Component.extend(NodeDriver, { this._super(...arguments); setProperties(this, { - clients: EmberObject.create(), + clients: {}, allSubnets: [] - }) + }); let cur = get(this, 'config.securityGroup'); @@ -76,6 +77,14 @@ export default Component.extend(NodeDriver, { set(this, 'tags', tags); } + + if (isEmpty(get(this, 'config.httpEndpoint'))) { + set(this, 'config.httpEndpoint', 'enabled'); + } + + if (isEmpty(get(this, 'config.httpTokens'))) { + set(this, 'config.httpTokens', 'optional'); + } }, willDestroyElement() { diff --git a/lib/nodes/addon/components/driver-amazonec2/template.hbs b/lib/nodes/addon/components/driver-amazonec2/template.hbs index e28722a07..f3b52c964 100644 --- a/lib/nodes/addon/components/driver-amazonec2/template.hbs +++ b/lib/nodes/addon/components/driver-amazonec2/template.hbs @@ -1,16 +1,15 @@ -{{#accordion-list showExpandAll=false as | al expandFn |}} +{{#accordion-list showExpandAll=false as |al expandFn|}}
{{driverOptionsTitle}}
- {{#accordion-list-item - title=(t "nodeDriver.amazonec2.access.title") - detail=(t "nodeDriver.amazonec2.access.detail") - expandAll=expandAll - expand=(action expandFn) - expandOnInit=true + title=(t "nodeDriver.amazonec2.access.title") + detail=(t "nodeDriver.amazonec2.access.detail") + expandAll=expandAll + expand=(action expandFn) + expandOnInit=true }} {{#unless hideRegionSelection}}
@@ -25,16 +24,15 @@ onchange={{action (mut config.region) value="target.value"}} > {{#each regionChoices as |choice|}} - {{/each}} {{else}} -
{{config.region}}
+
+ {{config.region}} +
{{/if}}
@@ -59,9 +57,10 @@ -
{{config.accessKey}}
+
+ {{config.accessKey}} +
-
{{/if}} {{/accordion-list-item}} -
{{#accordion-list-item - title=(t "nodeDriver.amazonec2.zone.title") - detail=(t "nodeDriver.amazonec2.zone.detail") - expandAll=expandAll - expand=(action expandFn) - expandOnInit=true + title=(t "nodeDriver.amazonec2.zone.title") + detail=(t "nodeDriver.amazonec2.zone.detail") + expandAll=expandAll + expand=(action expandFn) + expandOnInit=true }} {{#if (eq step 2)}}
@@ -100,16 +98,12 @@ onchange={{action (mut selectedZone) value="target.value"}} > {{#each zoneChoices as |choice|}} - {{/each}}
-
-
{{#accordion-list-item - title=(t "nodeDriver.amazonec2.securityGroup.title") - detail=(t "nodeDriver.amazonec2.securityGroup.detail") - expandAll=expandAll - expand=(action expandFn) - expandOnInit=true + title=(t "nodeDriver.amazonec2.securityGroup.title") + detail=(t "nodeDriver.amazonec2.securityGroup.detail") + expandAll=expandAll + expand=(action expandFn) + expandOnInit=true }}
{{#if (eq step 3)}}
- {{#if (and settings.isRancher (not isCustomSecurityGroup))}}

- + {{t "nodeDriver.amazonec2.portHelp.link"}} {{t "nodeDriver.amazonec2.portHelp.text"}}

{{/if}} -
- {{#if isCustomSecurityGroup}} @@ -256,7 +240,9 @@ {{#if (is-array config.securityGroup)}}
{{#each config.securityGroup as |group|}} - {{group}} + + {{group}} + {{/each}}
{{else}} @@ -266,7 +252,6 @@ {{/if}}
{{/accordion-list-item}} - {{#if (eq step 3)}} {{top-errors errors=errors}} {{save-cancel @@ -277,14 +262,13 @@ }} {{/if}}
-
{{#accordion-list-item - title=(t "nodeDriver.amazonec2.instance.title") - detail=(t "nodeDriver.amazonec2.instance.detail") - expandAll=expandAll - expand=(action expandFn) - expandOnInit=true + title=(t "nodeDriver.amazonec2.instance.title") + detail=(t "nodeDriver.amazonec2.instance.detail") + expandAll=expandAll + expand=(action expandFn) + expandOnInit=true }}
@@ -301,7 +285,6 @@ optionGroupPath="group" }}
-
- {{#if config.requestSpotInstance}}
@@ -340,7 +322,6 @@
{{/if}} -
-
- +
+
+
+ +
+
+ + +
+ {{t "nodeDriver.amazonec2.metadata.httpEndpoint.protip"}} +
+
+
+
+
+ +
+
+ + +
+ {{t "nodeDriver.amazonec2.metadata.httpTokens.protip"}} +
+
+
+
{{#if config.encryptEbsVolume}}
{{/unless}} -
-
-
-
-
{{form-key-value @@ -520,41 +550,21 @@
{{/accordion-list-item}} -
{{templateOptionsTitle}}
- - {{form-name-description - model=model - nameRequired=true - rowClass="row mb-10" - }} - + {{form-name-description model=model nameRequired=true rowClass="row mb-10"}} {{form-user-labels initialLabels=labelResource.labels setLabels=(action "setLabels") expand=(action expandFn) }} - - {{form-node-taints - model=model - expand=(action expandFn) - }} - - {{form-engine-opts - machine=model - showEngineUrl=showEngineUrl - }} - + {{form-node-taints model=model expand=(action expandFn)}} + {{form-engine-opts machine=model showEngineUrl=showEngineUrl}} {{top-errors errors=errors}} - - {{save-cancel - save=(action "save") - cancel=(action "cancel") - editing=editing + {{save-cancel save=(action "save") cancel=(action "cancel") editing=editing }} -{{/accordion-list}} +{{/accordion-list}} \ No newline at end of file diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 1a33d15ca..9cc12b5f6 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -8576,84 +8576,95 @@ nodeDriver: label: Region amazonec2: access: - title: 1. Account Access detail: Choose the region and API Key that will be used to launch EC2 Instances - next: "Next: Authenticate & configure nodes" + help: Paste in your AWS key pair here. We'll use this key to create your new Instances. loading: Loading Availability Zone and VPC info from EC2... - help: "Paste in your AWS key pair here. We'll use this key to create your new Instances." - zone: - title: 2. Zone and Network - detail: Select the Availability Zone and VPC/Subnet for Instances - next: "Next: Select a Security Group" - loading: Loading security group info from EC2... + next: 'Next: Authenticate & configure nodes' + title: 1. Account Access accessKey: label: Access Key placeholder: Your AWS access key - secretKey: - label: Secret Key - placeholder: Your AWS secret key - provided: Provided - region: - label: Region - availabilityZone: Availability Zone - subnet: VPC/Subnet - noSubnet: There are no subnets to choose from - securityGroup: - title: 3. Security Groups - detail: Choose the security groups that will be applied to Instances - choose: Choose one or more existing groups - defaultExisting: "Standard: Use the existing {groupName} group" - defaultCreate: "Standard: Automatically create a {groupName} group" - next: "Next: Set Instance options" - loading: Loading Instance options... - tags: - addActionLabel: Add AWS Tag - valueLabel: Tags - placeholder: e.g. dev - instance: - title: 4. Instance - detail: Customize the EC2 Instance that will be created. - portHelp: - link: Learn more - text: about the ports that will be opened. - needs: - label: "For {appName} to work correctly your security group will need to allow traffic:" - item1: From the {appName} server to TCP port 22 (SSH to install and configure Docker) - item2: From and To all other hosts on UDP ports 500 and 4500 (for IPsec networking) - item3: These rules will not be added automatically. - instanceType: - label: Instance Type - rootSize: - label: Root Disk Size - unit: GB - encryptEbsVolume: - label: Encryption - radioLabel: Encrypt EBS Volume - volumeType: - label: Amazon EBS volume type - useEbsOptimizedInstance: - label: Optimized Instance - radioLabel: Create EBS optimized instance ami: label: AMI placeholder: An Ubuntu AMI rancherList: RancherOS AMI List - sshUser: - label: SSH User - placeholder: e.g. ubuntu + availabilityZone: Availability Zone + encryptEbsVolume: + label: Encryption + radioLabel: Encrypt EBS Volume iam: label: IAM Instance Profile Name placeholder: my-k8s-profile - privateIp: - label: Private IP + instance: + detail: Customize the EC2 Instance that will be created. + title: 4. Instance + instanceType: + label: Instance Type + metadata: + httpEndpoint: + label: HTTP Endpoint + enabled: Enabled + disabled: Disabled + protip: Enables or disables the HTTP metadata endpoint on your instances + httpTokens: + label: HTTP Tokens + required: Required + optional: Optional + protip: Use HTTP Tokens for Instance Metadata Requests + needs: + item1: 'From the {appName} server to TCP port 22 (SSH to install and configure Docker)' + item2: From and To all other hosts on UDP ports 500 and 4500 (for IPsec networking) + item3: These rules will not be added automatically. + label: 'For {appName} to work correctly your security group will need to allow traffic:' + noSubnet: There are no subnets to choose from onlyPrivate: label: Use only private IP address + portHelp: + link: Learn more + text: about the ports that will be opened. + privateIp: + label: Private IP + region: + label: Region requestSpotInstance: - label: Spot Instance enable: Request spot instance + label: Spot Instance + rootSize: + label: Root Disk Size + unit: GB + secretKey: + label: Secret Key + placeholder: Your AWS secret key + provided: Provided + securityGroup: + choose: Choose one or more existing groups + defaultCreate: 'Standard: Automatically create a {groupName} group' + defaultExisting: 'Standard: Use the existing {groupName} group' + detail: Choose the security groups that will be applied to Instances + loading: Loading Instance options... + next: 'Next: Set Instance options' + title: 3. Security Groups spotPrice: label: Spot Price unit: $ + sshUser: + label: SSH User + placeholder: e.g. ubuntu + subnet: VPC/Subnet + tags: + addActionLabel: Add AWS Tag + placeholder: e.g. dev + valueLabel: Tags + useEbsOptimizedInstance: + label: Optimized Instance + radioLabel: Create EBS optimized instance + volumeType: + label: Amazon EBS volume type + zone: + detail: Select the Availability Zone and VPC/Subnet for Instances + loading: Loading security group info from EC2... + next: 'Next: Select a Security Group' + title: 2. Zone and Network digitalocean: droplet: title: Droplet Options