# Attach-node Command

The `attach-node` CLI command binds a specified node or nodes to an **existing cluster** as either a Master or Worker node.

## Syntax Example

{% tabs %}
{% tab title="Javascript" %}

```javascript
pf9ctl attach-node
```

{% endtab %}
{% endtabs %}

All Available Commands and Flags

{% tabs %}
{% tab title="Javascript" %}

```javascript
#pf9ctl attach-node --help

Attach nodes to existing cluster. One a time, multiple workers but only one master can be attached

Usage:
  pf9ctl attach-node [flags] cluster-name

Flags:
  -h, --help                help for attach-node
  -m, --master-ip strings   master node ip address
  -w, --worker-ip strings   worker node ip address

Global Flags:
      --verbose   print verbose logs
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
**Important**

We have seen users who try to attach either a master or worker nodes to a cluster, without first creating a (master/worker) type cluster. This can lead to errors which can be confusing. Please ensure a cluster is up and running before attempting to attach a node.
{% endhint %}

## Command Example

{% tabs %}
{% tab title="Javascript" %}

```javascript
pf9ctl attach-node -m 172.20.7.66 -w 172.20.7.58 test-cluster
✓ Loaded Config Successfully
2021-05-26T11:58:01.9579Z	INFO	Worker node(s) [bf5364cf-e2fd-4500-97fb-0b01be26084f] attached to cluster
2021-05-26T11:58:03.6328Z	INFO	Master node(s) [615c1042-48a3-42e8-8003-ac135d12e6f4] attached to cluster
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/managed-kubernetes/5.15/pmk-cli/commands/cli-attach-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
