Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3baa517c
Commit
3baa517c
authored
Nov 20, 2019
by
Tiger
Committed by
Enrique Alcantara
Dec 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose instance type options to EKS creation form
parent
9e7c1a67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
app/assets/javascripts/create_cluster/eks_cluster/index.js
app/assets/javascripts/create_cluster/eks_cluster/index.js
+2
-0
app/controllers/clusters/clusters_controller.rb
app/controllers/clusters/clusters_controller.rb
+14
-0
app/views/clusters/clusters/aws/_new.html.haml
app/views/clusters/clusters/aws/_new.html.haml
+1
-0
No files found.
app/assets/javascripts/create_cluster/eks_cluster/index.js
View file @
3baa517c
...
...
@@ -17,6 +17,7 @@ export default el => {
sessionToken
,
externalId
,
accountId
,
instanceTypes
,
hasCredentials
,
createRolePath
,
createClusterPath
,
...
...
@@ -32,6 +33,7 @@ export default el => {
hasCredentials
:
parseBoolean
(
hasCredentials
),
externalId
,
accountId
,
instanceTypes
:
JSON
.
parse
(
instanceTypes
),
createRolePath
,
createClusterPath
,
signOutPath
,
...
...
app/controllers/clusters/clusters_controller.rb
View file @
3baa517c
...
...
@@ -42,6 +42,7 @@ class Clusters::ClustersController < Clusters::BaseController
if
params
[
:provider
]
==
'aws'
@aws_role
=
current_user
.
aws_role
||
Aws
::
Role
.
new
@aws_role
.
ensure_role_external_id!
@instance_types
=
load_instance_types
.
to_json
elsif
params
[
:provider
]
==
'gcp'
redirect_to
@authorize_url
if
@authorize_url
&&
!
@valid_gcp_token
...
...
@@ -308,6 +309,19 @@ class Clusters::ClustersController < Clusters::BaseController
end
end
##
# Unfortunately the EC2 API doesn't provide a list of
# possible instance types. There is a workaround, using
# the Pricing API, but instead of requiring the
# user to grant extra permissions for this we use the
# values that validate the CloudFormation template.
def
load_instance_types
stack_template
=
File
.
read
(
Rails
.
root
.
join
(
'vendor'
,
'aws'
,
'cloudformation'
,
'eks_cluster.yaml'
))
instance_types
=
YAML
.
safe_load
(
stack_template
).
dig
(
'Parameters'
,
'NodeInstanceType'
,
'AllowedValues'
)
instance_types
.
map
{
|
type
|
Hash
(
name:
type
,
value:
type
)
}
end
def
update_applications_status
@cluster
.
applications
.
each
(
&
:schedule_status_update
)
end
...
...
app/views/clusters/clusters/aws/_new.html.haml
View file @
3baa517c
...
...
@@ -10,6 +10,7 @@
'account-id'
=>
Gitlab
::
CurrentSettings
.
eks_account_id
,
'external-id'
=>
@aws_role
.
role_external_id
,
'role-arn'
=>
@aws_role
.
role_arn
,
'instance-types'
=>
@instance_types
,
'kubernetes-integration-help-path'
=>
help_page_path
(
'user/project/clusters/index'
),
'account-and-external-ids-help-path'
=>
help_page_path
(
'user/project/clusters/add_remove_clusters.md'
,
anchor:
'eks-cluster'
),
'create-role-arn-help-path'
=>
help_page_path
(
'user/project/clusters/add_remove_clusters.md'
,
anchor:
'eks-cluster'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment