Merge pull request #4102 from westlywright/enhancement.select.cluster.type

Rework Cluster Import/Register Experience
This commit is contained in:
Westly Wright 2020-07-28 12:02:31 -07:00 committed by GitHub
commit 2c1fac8c64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 24 deletions

View File

@ -6,10 +6,11 @@ export default Controller.extend({
growl: service(),
settings: service(),
queryParams: ['clusterTemplateRevision', 'importProvider'],
queryParams: ['clusterTemplateRevision', 'importProvider', 'register'],
clusterTemplateRevision: null,
importProvider: null,
register: false,
cluster: alias('model.cluster'),

View File

@ -103,7 +103,8 @@ export default Route.extend({
if (isExiting && transition.targetName !== 'error') {
controller.setProperties({
clusterTemplateRevision: null,
importProvider: null
importProvider: null,
register: false,
});
}
},
@ -125,5 +126,6 @@ export default Route.extend({
queryParams: {
clusterTemplateRevision: { refreshModel: true },
importProvider: { refreshModel: true },
register: { refreshModel: true },
}
});

View File

@ -1,4 +1,7 @@
<div class="launch-cluster">
<h2>
{{t "clusterNew.register.title"}}
</h2>
<div class="row mb-20">
{{#if disabledAddCluster}}
<BannerMessage
@ -10,22 +13,22 @@
<div class="row-same-height row-full-height">
<a
class="col span-6 cluster-driver-box span-height full-height"
href="{{href-to "global-admin.clusters.new.launch" "custom"}}"
href="{{href-to "global-admin.clusters.new.launch" "import" (query-params register=true)}}"
disabled={{disabledAddCluster}}
>
<div class="machine-driver custom-driver"></div>
<div class="driver-content">
<h3>
{{t "clusterNew.custom.label"}}
{{t "clusterNew.register.label"}}
</h3>
<p class="help-block">
{{t "clusterNew.custom.helpBlock"}}
{{t "clusterNew.register.helpBlock" htmlSafe=true}}
</p>
</div>
</a>
<a
class="col span-6 cluster-driver-box span-height full-height"
href="{{href-to "global-admin.clusters.new.launch" "import"}}"
href="{{href-to "global-admin.clusters.new.launch" "import" (query-params importProvider='other')}}"
disabled={{disabledAddCluster}}
>
<div class="machine-driver import-driver"></div>
@ -44,6 +47,33 @@
</a>
</div>
</div>
<div class="row">
<h2>
{{t "clusterNew.custom.title"}}
</h2>
<div class="col span-12 mt-0">
<div>
<label class="acc-label">
{{t "clusterNew.custom.subtitle"}}
</label>
</div>
<a
class="col span-6 cluster-driver-box span-height full-height"
href="{{href-to "global-admin.clusters.new.launch" "custom"}}"
disabled={{disabledAddCluster}}
>
<div class="machine-driver custom-driver"></div>
<div class="driver-content">
<h3>
{{t "clusterNew.custom.label"}}
</h3>
<p class="help-block">
{{t "clusterNew.custom.helpBlock"}}
</p>
</div>
</a>
</div>
</div>
{{#if (gt (get (get providerGroups "rkeGroup") "length") 0)}}
<div class="row">
<div class="col span-12">

View File

@ -4,12 +4,14 @@
{{t "clustersPage.select.provider.label"}}
{{else if (eq router.currentRoute.localName "cluster-template")}}
{{t "clustersPage.select.template.label"}}
{{else}}
{{#if (or (eq provider "import") (eq provider "importeks"))}}
{{t "clustersPage.launch.import"}} - {{driver-name provider}}
{{else if (or (eq provider "import") (eq provider "importeks"))}}
{{#if router.currentRoute.queryParams.register}}
{{t "clustersPage.launch.register"}}
{{else}}
{{t "clustersPage.launch.import"}}
{{/if}}
{{else}}
{{t "clustersPage.launch.new"}} - {{driver-name provider}}
{{/if}}
{{/if}}
</h1>
</section>

View File

@ -1,4 +1,4 @@
{{#if (eq provider "import")}}
{{#if (and (eq provider "import") router.currentRoute.queryParams.register)}}
<div class="launch-cluster">
<div class="row mb-20">
<div class="row-same-height row-full-height">

View File

@ -1367,6 +1367,7 @@ clustersPage:
launch:
new: Add Cluster
import: Import Cluster
register: Register Cluster
cluster:
label: Cluster Name
templateRevision:
@ -3451,12 +3452,12 @@ clusterNew:
import:
clusterSelect:
title: Choose Cluster
detail: Choose an EKS cluster to import
detail: Choose an EKS cluster to register
select:
label: Cluster To Import
label: Cluster To register
input:
label: Cluster Name To Import
createLabel: Import Cluster
label: Cluster Name To register
createLabel: Register Cluster
tencenttke:
label: Tencent Kubernetes Engine
shortLabel: Tencent TKE
@ -4413,31 +4414,36 @@ clusterNew:
title: Authorized Endpoint
detail: "Enabling the authorized cluster endpoint allows direct communication with the cluster, bypassing the API proxy. Authorized endpoints can be retrieved by generating a kubeconfig for the cluster."
label: Authorized Cluster Endpoint
register:
title: Bring an existing Kubernetes cluster
label: Register
shortLabel: Registered
helpBlock: Register an existing Rancher, <a href='https://k3s.io/' target='_blank' rel='nofollow noreferrer'>K3s</a> or EKS cluster.
custom:
title: Create a new Kubernetes cluster
subtitle: With RKE and existing nodes
label: From existing nodes (Custom)
shortLabel: Custom
helpBlock: Create a new Kubernetes cluster using RKE, out of existing bare-metal servers or virtual machines.
import:
label: Import an existing cluster
shortLabel: Imported
helpBlock: "Import an existing Kubernetes cluster."
helpBlock: Import an existing CNCF certified Kubernetes cluster. Kubernetes configuration and infrastructure management is managed outside of Rancher.
command:
instructionsAdminRole: "<b>Note:</b> If you want to import a Google Kubernetes Engine (GKE) cluster (or any cluster that does not supply you with a kubectl configuration file with the ClusterRole <b>cluster-admin</b> bound to it), you need to bind the ClusterRole <b>cluster-admin</b> using the command below.<br/><br/>Replace <b>[USER_ACCOUNT]</b> with your Google account address (you can retrieve this using <b>gcloud config get-value account</b>). If you are not importing a Google Kubernetes Engine cluster, replace <b>[USER_ACCOUNT]</b> with the executing user configured in your kubectl configuration file."
instructions: "Run the kubectl command below on an existing Kubernetes cluster running a supported Kubernetes version to import it into {appName}:"
instructionsInsecure: "If you get an error about 'certificate signed by unknown authority' because your {appName} installation is running with an untrusted/self-signed SSL certificate, run the command below instead to bypass the certificate check:"
select:
other:
title: Other
helpBlock: "For <a id='k3s-info-external-link' href='https://k3s.io/' target='_blank' rel='nofollow noreferrer'>K3S backed clusters</a>, {appName} can manage some aspects of the cluster configuration, such as version upgrades. For standard Kubernetes clusters, the provider will manage provisioning and configuration."
title: Rancher or K3s
helpBlock: "Register existing Rancher or <a id='k3s-info-external-link' href='https://k3s.io/' target='_blank' rel='nofollow noreferrer'>K3s</a> backed cluster."
eks:
title: Amazon EKS
helpBlock: "Register an existing Amazon EKS cluster."
importEks:
label: Import an existing Amazon EKS cluster
shortLabel: Imported
helpBlock: "Import an existing Amazon EKS Kubernetes cluster."
command:
instructions: "Run the kubectl command below on an existing Kubernetes cluster running a supported Kubernetes version to import it into {appName}:"
instructionsInsecure: "If you get an error about 'certificate signed by unknown authority' because your {appName} installation is running with an untrusted/self-signed SSL certificate, run the command below instead to bypass the certificate check:"
label: Register an existing Amazon EKS cluster
shortLabel: Registered
helpBlock: "Register an existing Amazon EKS Kubernetes cluster."
clusterTemplateNew:
members: