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.

Important

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.

Note

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

  1. Créer une autre pile de calcul.

    1. Lancer le modèle :

      $ aws cloudformation create-stack --stack-name <name> \ 
      1
      
           --template-body file://<template>.yaml \ 
      2
      
           --parameters file://<parameters>.json 
      3
      Copy to Clipboard
      1
      <name> est le nom de la pile CloudFormation, par exemple cluster-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.
    2. Confirm that the template components exist:

      $ aws cloudformation describe-stacks --stack-name <name>
      Copy to Clipboard
  2. 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

  1. Confirm that the cluster recognizes the machines:

    $ oc get nodes
    Copy to Clipboard

    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
    Copy to Clipboard

    The output lists all of the machines that you created.

    Note

    The preceding output might not include the compute nodes, also known as worker nodes, until some CSRs are approved.

  2. Review the pending CSRs and ensure that you see the client requests with the Pending or Approved status for each machine that you added to the cluster:

    $ oc get csr
    Copy to Clipboard

    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
    ...
    Copy to Clipboard

    In this example, two machines are joining the cluster. You might see more approved CSRs in the list.

  3. 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:

    Note

    Because 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.

    Note

    For 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, and oc 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 the node-bootstrapper service account in the system:node or system: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> 
      1
      Copy to Clipboard
      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
      Copy to Clipboard
      Note

      Some Operators might not become available until some CSRs are approved.

  4. 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
    Copy to Clipboard

    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
    ...
    Copy to Clipboard

  5. 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> 
      1
      Copy to Clipboard
      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
      Copy to Clipboard
  6. 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
    Copy to Clipboard

    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
    Copy to Clipboard

    Note

    It can take a few minutes after approval of the server CSRs for the machines to transition to the Ready status.

Informations complémentaires

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat