Questo contenuto non è disponibile nella lingua selezionata.

Chapter 3. Shutting down the cluster gracefully


This document describes the process to gracefully shut down your cluster. You might need to temporarily shut down your cluster for maintenance reasons, or to save on resource costs.

3.1. Prerequisites

  • Take an etcd backup prior to shutting down the cluster.

3.2. Shutting down the cluster

You can shut down your cluster in a graceful manner so that it can be restarted at a later date.

Prerequisites

  • You have access to the cluster as a user with the cluster-admin role.
  • You have taken an etcd backup.

    Important

    It is important to take an etcd backup before performing this procedure so that your cluster can be restored if you encounter any issues when restarting the cluster.

Procedure

  1. Shut down all of the nodes in the cluster. You can do this from your cloud provider’s web console, or you can use the below commands:

    1. Obtain the list of nodes:

      $ nodes=$(oc get nodes -o jsonpath='{.items[*].metadata.name}')
      Copy to Clipboard Toggle word wrap
    2. Shut down all of the nodes:

      $ for node in ${nodes[@]}
      do
          echo "==== Shut down $node ===="
          ssh core@$node sudo shutdown -h 1
      done
      Copy to Clipboard Toggle word wrap

      Shutting down the nodes using one of these methods allows pods to terminate gracefully, which reduces the chance for data corruption.

      Note

      It is not necessary to drain master nodes of the standard pods that ship with OpenShift Container Platform prior to shutdown.

      Cluster administrators are responsible for ensuring a clean restart of their own workloads after the cluster is restarted. If you drained master nodes prior to shutdown because of custom workloads, you must mark the master nodes as schedulable before the cluster will be functional again after restart.

  2. Shut off any cluster dependencies that are no longer needed, such as external storage or an LDAP server. Be sure to consult your vendor’s documentation before doing so.

Additional resources

Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat