forked from oap-project/cloudtik
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc for understanding cluster key and client machine movement (oa…
- Loading branch information
1 parent
5272933
commit 0559afd
Showing
6 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
docs/source/UserGuide/AdvancedTasks/switching-client-machine.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Switching Client Machine | ||
Sometimes, you may need to work on another client machine (working machine). | ||
This guide will introduce the key aspects when you created a cluster from one client machine, | ||
and you need to switch to another client machine to operate the cluster through CloudTik CLI. | ||
|
||
## Moving the configuration files | ||
You need move the cluster configuration file to the new client machine | ||
so that you can issue CloudTik CLI command to the cluster specifying the same cluster configuration file. | ||
|
||
If you want to manage workspace on the new client machine, backup and move the workspace configuration file as well. | ||
|
||
## Moving the cluster private key file | ||
The cluster was accessed using the cluster private key file. | ||
If you don't know where is the private key file located, you can execute: | ||
|
||
```bash | ||
cloudtik info your-cluster-config.yaml | ||
``` | ||
The command will show where is the cluster private key located. | ||
|
||
You need moving the corresponding private key file and for azure also the public key file to the new client machine. | ||
The file names of the private or public key may have association with the key pair name at Cloud side (for AWS and GCP). | ||
Please don't change the file names of the private or public key files when you are doing file movements. | ||
|
||
For a more detailed description of cluster key file, refer to [Understanding Cluster Key](./understanding-cluster-key.md) |
81 changes: 81 additions & 0 deletions
81
docs/source/UserGuide/AdvancedTasks/understanding-cluster-key.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Understanding Cluster Key | ||
The cluster is protected by the cluster key file (private key file and optionally public key file). | ||
|
||
The public key is used to when creating VM instance. For different Cloud providers, the way of specifying | ||
public key when creating VM instance is different. | ||
For AWS, AWS key pair is used to associate the name with the public and private key | ||
and the key pair name is specified when creating VM instance. | ||
For Azure, the public key is specified directly when creating VM instance. | ||
For GCP, we can create project wide ssh key to associate a USERNAME with its public key. | ||
And all VM instances in the same project can be accessed using the private key of the project wide | ||
ssh key. | ||
|
||
For private key, it is simpler. CloudTik CLI needs the cluster private key file to connect to the cluster | ||
and issue management commands for all Cloud providers. | ||
|
||
## The location of cluster key files | ||
For a running cluster, if you don't know where is the cluster key files located, | ||
you can execute info command, | ||
|
||
```bash | ||
cloudtik info your-cluster-config.yaml | ||
``` | ||
The command will show where is the cluster private or public key files located. | ||
|
||
## AWS cluster key | ||
|
||
### Implicit cluster private key | ||
If you don't specify a private key through ssh_private_key in the auth section in cluster configuration file, | ||
CloudTik will try to find an existing AWS key pair with the name pattern of cloudtik_{index}_{region} | ||
and if the private key file of the key pair ~/.ssh/cloudtik_{index}_{region}.pem exists. | ||
If found, the cluster will be created with the key pair and the private key file at ~/.ssh/cloudtik_{index}_{region}.pem. | ||
|
||
Otherwise, CloudTik will create a new key pair with the name pattern of cloudtik_{index}_{region} | ||
and download the private key file of the key pair to ~/.ssh/cloudtik_{index}_{region}.pem. | ||
|
||
If you create multiple clusters on the same client machine, CloudTik will use the same cluster private key based | ||
on the above process. If you don't want this, you can specify explicitly a key pair name to use for the cluster | ||
with provider/key_pair/key_name configuration key in cluster configuration file. | ||
|
||
### Explicit cluster private key | ||
You can also specify explicitly a private key file in the auth section in cluster configuration file. | ||
In this case, the specified private key file will be used. | ||
And you also need to explicitly specify the AWS key pair name of the private key through 'KeyName' configuration key | ||
in the 'node_config' of each node types defined in 'available_node_types'. | ||
|
||
For this case, CloudTik will not try creating any key pairs on AWS. | ||
You need to make sure the key pair exists on AWS and the private key file contains the corresponding private key material. | ||
|
||
## Azure cluster private key | ||
Azure cluster key management is simple. | ||
When creating the cluster, you need to generate a cluster RSA key pair. | ||
And specify the ssh_private_key configuration key and ssh_public_key configuration key | ||
in auth section for locating the private and public key file. | ||
|
||
The public key file will be used to create VM instances and the private key file | ||
can be used to access the VM instances through SSH. | ||
|
||
## GCP cluster private key | ||
|
||
### Implicit cluster private key | ||
If you don't specify a private key through ssh_private_key in the auth section in cluster configuration file, | ||
CloudTik will try to find an existing GCP project wide ssh key with the USERNAME equals to ssh_user in the configuration file | ||
and if the private key file and public key file of the key pair ~/.ssh/cloudtik_gcp_{region}_{project_id}_{ssh_user}_{index}.pem | ||
and ~/.ssh/cloudtik_gcp_{region}_{project_id}_{ssh_user}_{index}.pub exist locally. | ||
If found, the cluster will be created with the ssh key and using the private key file at ~/.ssh/cloudtik_gcp_{region}_{project_id}_{ssh_user}_{index}.pem | ||
for cluster access. | ||
|
||
Otherwise, CloudTik will generate an RSA key pair | ||
and create a GCP project wide ssh key with the USERNAME equals to ssh_user and the public key of the generated RSA key pair. | ||
and save the private key file of the key pair to ~/.ssh/cloudtik_gcp_{region}_{project_id}_{ssh_user}_{index}.pem and | ||
public key file of the key pair to ~/.ssh/cloudtik_gcp_{region}_{project_id}_{ssh_user}_{index}.pub. | ||
|
||
If you create multiple clusters on the same client machine and used the same ssh_user, CloudTik will use the same cluster private key based | ||
on the above process. | ||
|
||
### Explicit cluster private key | ||
You can also specify explicitly a private key file in the auth section in cluster configuration file. | ||
In this case, the specified private key file will be used. | ||
|
||
For this case, CloudTik will not try creating any project wide ssh key on GCP. | ||
You need to make sure the project wide ssh key with USERNAME equals to ssh_user exists on GCP project and the private key file contains the corresponding private key material. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters