<p>I created a Kubernetes cluster using ansible-playbook command below</p>

<pre><code>ansible-playbook kubectl.yaml --extra-vars "kubernetes_api_endpoint=&lt;Path to aws load balancer server&gt;"
</code></pre>

<p>Now I have deleted the cluster using command</p>

<pre><code>kubectl config delete-cluster &lt;Name of cluster&gt;
</code></pre>

<p>But still EC2 nodes are running, I tried to manually stop them but they start again automatically (expected because they are running in a cluster)</p>

<p>Is there any way by which I can detach the nodes from the cluster or delete the cluster in total?</p>

<p>Kubectl config view shows below message</p>

<blockquote>
  <p>apiVersion: v1
  clusters: []
  contexts:
  - context:
     cluster: ""
     user: ""
   name: default-context
  current-context: default-context
  kind: Config
  preferences: {}
  users:
  - name: cc3.k8s.local
    user:
     token: cc3.k8s.local</p>
</blockquote>

<p>This means there is no cluster.
I want to delete the cluster in total and start fresh.</p>

<p>The <code>delete-cluster</code> command does this :</p>

<blockquote>
  <p>delete-cluster  Delete the specified cluster from the kubeconfig</p>
</blockquote>

<p>It will only delete the context from your <code>~/.kube/config</code> file. Not delete the actual cluster.</p>

<p>You will need to write a different script for that or go into the AWS console and simply delete the nodes.</p>
