You can uninstall OpenShift Container Platform hosts in your cluster by running the uninstall.yml playbook. This playbook deletes OpenShift Container Platform content installed by Ansible, including:

  • Configuration

  • Containers

  • Default templates and image streams

  • Images

  • RPM packages

The playbook deletes content for any hosts defined in the inventory file that you specify when running the playbook.

Uninstalling a OpenShift Container Platform cluster

To uninstall OpenShift Container Platform across all hosts in your cluster, change to the playbook directory and run the playbook using the inventory file you used most recently:

# ansible-playbook [-i /path/to/file] \ (1)
1 If your inventory file is not in the /etc/ansible/hosts directory, specify -i and the path to the inventory file.

Uninstalling nodes

To uninstall node components from specific hosts using the uninstall.yml playbook while leaving the remaining hosts and cluster alone:

Use this method only when attempting to uninstall specific node hosts, not specific masters or etcd hosts. Uninstalling master or etcd hosts requires more configuration changes in the cluster.

  1. Follow the steps in Deleting Nodes to remove the node object from the cluster.

  2. Create a different inventory file that references only those hosts. For example, to delete content from only one node:

    nodes (1)
    [nodes] openshift_node_group_name='node-config-infra' (2)
    1 Include only the sections that apply to the hosts to uninstall.
    2 Include only the hosts to uninstall.
  3. Change to the playbook directory and run the uninstall.yml playbook:

    # ansible-playbook -i /path/to/new/file \ (1)
    1 Specify the path to the new inventory file.

When the playbook completes, all OpenShift Container Platform content is removed from the specified hosts.