diff --git a/lib/global-admin/addon/clusters/new/launch/controller.js b/lib/global-admin/addon/clusters/new/launch/controller.js index f4c37f3da..a2c9bdebf 100644 --- a/lib/global-admin/addon/clusters/new/launch/controller.js +++ b/lib/global-admin/addon/clusters/new/launch/controller.js @@ -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'), diff --git a/lib/global-admin/addon/clusters/new/launch/route.js b/lib/global-admin/addon/clusters/new/launch/route.js index a4016c621..b12cb39a7 100644 --- a/lib/global-admin/addon/clusters/new/launch/route.js +++ b/lib/global-admin/addon/clusters/new/launch/route.js @@ -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 }, } }); diff --git a/lib/global-admin/addon/clusters/new/select/template.hbs b/lib/global-admin/addon/clusters/new/select/template.hbs index c7851b55e..7c3f85d04 100644 --- a/lib/global-admin/addon/clusters/new/select/template.hbs +++ b/lib/global-admin/addon/clusters/new/select/template.hbs @@ -1,4 +1,7 @@
+

+ {{t "clusterNew.register.title"}} +

{{#if disabledAddCluster}}

- {{t "clusterNew.custom.label"}} + {{t "clusterNew.register.label"}}

- {{t "clusterNew.custom.helpBlock"}} + {{t "clusterNew.register.helpBlock" htmlSafe=true}}

@@ -44,6 +47,33 @@
+
+

+ {{t "clusterNew.custom.title"}} +

+
+
+ +
+ +
+
+

+ {{t "clusterNew.custom.label"}} +

+

+ {{t "clusterNew.custom.helpBlock"}} +

+
+
+
+
{{#if (gt (get (get providerGroups "rkeGroup") "length") 0)}}
diff --git a/lib/global-admin/addon/clusters/new/template.hbs b/lib/global-admin/addon/clusters/new/template.hbs index eb5653074..b82fdd5a8 100644 --- a/lib/global-admin/addon/clusters/new/template.hbs +++ b/lib/global-admin/addon/clusters/new/template.hbs @@ -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}} diff --git a/lib/shared/addon/components/cru-cluster/template.hbs b/lib/shared/addon/components/cru-cluster/template.hbs index 319bdc4af..147848e96 100644 --- a/lib/shared/addon/components/cru-cluster/template.hbs +++ b/lib/shared/addon/components/cru-cluster/template.hbs @@ -1,4 +1,4 @@ -{{#if (eq provider "import")}} +{{#if (and (eq provider "import") router.currentRoute.queryParams.register)}}
diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 39da77101..cf3742473 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -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, K3s 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: "Note: 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 cluster-admin bound to it), you need to bind the ClusterRole cluster-admin using the command below.

Replace [USER_ACCOUNT] with your Google account address (you can retrieve this using gcloud config get-value account). If you are not importing a Google Kubernetes Engine cluster, replace [USER_ACCOUNT] 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 K3S backed clusters, {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 K3s 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: