10.2. Ajouter des machines de calcul à AWS en utilisant des modèles CloudFormation
Vous pouvez ajouter d'autres machines de calcul à votre cluster OpenShift Container Platform sur Amazon Web Services (AWS) que vous avez créé à l'aide des modèles CloudFormation types.
10.2.1. Conditions préalables
- Vous avez installé votre cluster sur AWS en utilisant les modèles AWS CloudFormation fournis.
- Vous disposez du fichier JSON et du modèle CloudFormation que vous avez utilisés pour créer les machines de calcul lors de l'installation du cluster. Si vous n'avez pas ces fichiers, vous devez les recréer en suivant les instructions de la procédure d'installation.
10.2.2. Ajouter des machines de calcul à votre cluster AWS en utilisant les modèles CloudFormation
Vous pouvez ajouter d'autres machines de calcul à votre cluster OpenShift Container Platform sur Amazon Web Services (AWS) que vous avez créé à l'aide des modèles CloudFormation types.
Le modèle CloudFormation crée une pile qui représente une machine de calcul. Vous devez créer une pile pour chaque machine de calcul.
Si vous n'utilisez pas le modèle CloudFormation fourni pour créer vos nœuds de calcul, vous devez consulter les informations fournies et créer manuellement l'infrastructure. Si votre cluster ne s'initialise pas correctement, vous devrez peut-être contacter l'assistance de Red Hat avec vos journaux d'installation.
Conditions préalables
- Vous avez installé un cluster OpenShift Container Platform en utilisant des modèles CloudFormation et vous avez accès au fichier JSON et au modèle CloudFormation que vous avez utilisé pour créer les machines de calcul lors de l'installation du cluster.
- Vous avez installé l'AWS CLI.
Procédure
Créer une autre pile de calcul.
Lancer le modèle :
aws cloudformation create-stack --stack-name <name> \ --template-body file://<template>.yaml \ --parameters file://<parameters>.json
$ aws cloudformation create-stack --stack-name <name> \
1 --template-body file://<template>.yaml \
2 --parameters file://<parameters>.json
3 Copy to Clipboard Copied! - 1
<name>
est le nom de la pile CloudFormation, par exemplecluster-workers
. Vous devez fournir le nom de cette pile si vous supprimez le cluster.- 2
<template>
is the relative path to and name of the CloudFormation template YAML file that you saved.- 3
<parameters>
is the relative path to and name of the CloudFormation parameters JSON file.
Confirm that the template components exist:
aws cloudformation describe-stacks --stack-name <name>
$ aws cloudformation describe-stacks --stack-name <name>
Copy to Clipboard Copied!
- Continuez à créer des piles de calcul jusqu'à ce que vous ayez créé suffisamment de machines de calcul pour votre cluster.
10.2.3. Approving the certificate signing requests for your machines
When you add machines to a cluster, two pending certificate signing requests (CSRs) are generated for each machine that you added. You must confirm that these CSRs are approved or, if necessary, approve them yourself. The client requests must be approved first, followed by the server requests.
Conditions préalables
- You added machines to your cluster.
Procédure
Confirm that the cluster recognizes the machines:
oc get nodes
$ oc get nodes
Copy to Clipboard Copied! Exemple de sortie
NAME STATUS ROLES AGE VERSION master-0 Ready master 63m v1.25.0 master-1 Ready master 63m v1.25.0 master-2 Ready master 64m v1.25.0
NAME STATUS ROLES AGE VERSION master-0 Ready master 63m v1.25.0 master-1 Ready master 63m v1.25.0 master-2 Ready master 64m v1.25.0
Copy to Clipboard Copied! The output lists all of the machines that you created.
NoteThe preceding output might not include the compute nodes, also known as worker nodes, until some CSRs are approved.
Review the pending CSRs and ensure that you see the client requests with the
Pending
orApproved
status for each machine that you added to the cluster:oc get csr
$ oc get csr
Copy to Clipboard Copied! Exemple de sortie
NAME AGE REQUESTOR CONDITION csr-8b2br 15m system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending csr-8vnps 15m system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending ...
NAME AGE REQUESTOR CONDITION csr-8b2br 15m system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending csr-8vnps 15m system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending ...
Copy to Clipboard Copied! In this example, two machines are joining the cluster. You might see more approved CSRs in the list.
If the CSRs were not approved, after all of the pending CSRs for the machines you added are in
Pending
status, approve the CSRs for your cluster machines:NoteBecause the CSRs rotate automatically, approve your CSRs within an hour of adding the machines to the cluster. If you do not approve them within an hour, the certificates will rotate, and more than two certificates will be present for each node. You must approve all of these certificates. After the client CSR is approved, the Kubelet creates a secondary CSR for the serving certificate, which requires manual approval. Then, subsequent serving certificate renewal requests are automatically approved by the
machine-approver
if the Kubelet requests a new certificate with identical parameters.NoteFor clusters running on platforms that are not machine API enabled, such as bare metal and other user-provisioned infrastructure, you must implement a method of automatically approving the kubelet serving certificate requests (CSRs). If a request is not approved, then the
oc exec
,oc rsh
, andoc logs
commands cannot succeed, because a serving certificate is required when the API server connects to the kubelet. Any operation that contacts the Kubelet endpoint requires this certificate approval to be in place. The method must watch for new CSRs, confirm that the CSR was submitted by thenode-bootstrapper
service account in thesystem:node
orsystem:admin
groups, and confirm the identity of the node.To approve them individually, run the following command for each valid CSR:
oc adm certificate approve <csr_name>
$ oc adm certificate approve <csr_name>
1 Copy to Clipboard Copied! - 1
<csr_name>
est le nom d'un CSR figurant dans la liste des CSR actuels.
To approve all pending CSRs, run the following command:
oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs --no-run-if-empty oc adm certificate approve
$ oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs --no-run-if-empty oc adm certificate approve
Copy to Clipboard Copied! NoteSome Operators might not become available until some CSRs are approved.
Now that your client requests are approved, you must review the server requests for each machine that you added to the cluster:
oc get csr
$ oc get csr
Copy to Clipboard Copied! Exemple de sortie
NAME AGE REQUESTOR CONDITION csr-bfd72 5m26s system:node:ip-10-0-50-126.us-east-2.compute.internal Pending csr-c57lv 5m26s system:node:ip-10-0-95-157.us-east-2.compute.internal Pending ...
NAME AGE REQUESTOR CONDITION csr-bfd72 5m26s system:node:ip-10-0-50-126.us-east-2.compute.internal Pending csr-c57lv 5m26s system:node:ip-10-0-95-157.us-east-2.compute.internal Pending ...
Copy to Clipboard Copied! If the remaining CSRs are not approved, and are in the
Pending
status, approve the CSRs for your cluster machines:To approve them individually, run the following command for each valid CSR:
oc adm certificate approve <csr_name>
$ oc adm certificate approve <csr_name>
1 Copy to Clipboard Copied! - 1
<csr_name>
est le nom d'un CSR figurant dans la liste des CSR actuels.
To approve all pending CSRs, run the following command:
oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs oc adm certificate approve
$ oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs oc adm certificate approve
Copy to Clipboard Copied!
After all client and server CSRs have been approved, the machines have the
Ready
status. Verify this by running the following command:oc get nodes
$ oc get nodes
Copy to Clipboard Copied! Exemple de sortie
NAME STATUS ROLES AGE VERSION master-0 Ready master 73m v1.25.0 master-1 Ready master 73m v1.25.0 master-2 Ready master 74m v1.25.0 worker-0 Ready worker 11m v1.25.0 worker-1 Ready worker 11m v1.25.0
NAME STATUS ROLES AGE VERSION master-0 Ready master 73m v1.25.0 master-1 Ready master 73m v1.25.0 master-2 Ready master 74m v1.25.0 worker-0 Ready worker 11m v1.25.0 worker-1 Ready worker 11m v1.25.0
Copy to Clipboard Copied! NoteIt can take a few minutes after approval of the server CSRs for the machines to transition to the
Ready
status.
Informations complémentaires
- For more information on CSRs, see Certificate Signing Requests.