1
- # Fabric CLI
2
1
3
- !!! warning ""
4
- Under construction.
2
+ # Fabric CLI Reference
5
3
6
4
Currently Fabric CLI is represented by a kubectl plugin ` kubectl-fabric ` automatically installed on the Control Node.
7
5
It is a wrapper around ` kubectl ` and Kubernetes client which allows to manage Fabric resources in a more convenient way.
8
6
Fabric CLI only provides a subset of the functionality available via Fabric API and is focused on simplifying objects
9
7
creation and some manipulation with the already existing objects while main get/list/update operations are expected to
10
8
be done using ` kubectl ` .
11
9
10
+ ## Usage
11
+
12
12
``` bash
13
13
core@control-1 ~ $ kubectl fabric
14
14
NAME:
@@ -35,24 +35,196 @@ GLOBAL OPTIONS:
35
35
--version, -V print the version
36
36
```
37
37
38
- ## VPC
38
+ ## Commands and Options
39
+
40
+ | Command | Subcommand | Options | Description |
41
+ | ---------| ------------| ---------| -------------|
42
+ | ** vpc** | create | ` --name ` , ` --subnet ` (required), ` --vlan ` (required), ` --dhcp ` , ` --dhcp-range-start ` , ` --dhcp-range-end ` , ` --print ` | Create a new VPC. |
43
+ | | attach | ` --name ` , ` --vpc-subnet ` (required), ` --connection ` (required), ` --print ` | Attach VPC to a server connection. |
44
+ | | peer | ` --name ` , ` --vpc ` (required), ` --remote ` , ` --print ` | Peer two VPCs. |
45
+ | | wipe | ` --yes ` | Delete all VPCs and peerings. |
46
+ | ** switch** | ip | ` --name ` , ` --username ` , ` --verbose ` | Get switch management IP address. |
47
+ | | ssh | ` --name ` , ` --username ` , ` --verbose ` | SSH into the switch. |
48
+ | | serial | ` --name ` , ` --username ` , ` --verbose ` | Run serial console for the switch. |
49
+ | | reboot | ` --name ` , ` --yes ` , ` --verbose ` | Reboot the switch. |
50
+ | | power-reset | ` --name ` , ` --yes ` , ` --verbose ` | Power reset the switch. |
51
+ | | reinstall | ` --name ` , ` --yes ` , ` --verbose ` | Reinstall the switch. |
52
+ | ** connection** | get | ` --type ` | Get details of existing connections. |
53
+ | ** switchgroup** | create | ` --name ` , ` --print ` | Create a new switch group. |
54
+ | ** external** | create | ` --name ` , ` --ipv4-namespace ` , ` --inbound-community ` , ` --outbound-community ` , ` --print ` | Create a new external connection. |
55
+ | | peer | ` --vpc ` , ` --external ` , ` --vpc-subnet ` , ` --external-prefix ` , ` --print ` | Peer external and VPC. |
56
+ | ** wiring** | export | ` --vpcs ` , ` --externals ` , ` --switch-profiles ` | Export wiring diagram. |
57
+ | ** inspect** | fabric | ` --verbose ` , ` --output ` (default: "text") | Inspect overall Fabric state. |
58
+ | | switch | ` --name ` , ` --output ` (default: "text") | Inspect switch status and ports. |
59
+ | | port | ` --name ` , ` --output ` (default: "text") | Inspect switch port status. |
60
+ | | server | ` --name ` , ` --output ` (default: "text") | Inspect server status. |
61
+ | | connection | ` --name ` , ` --output ` (default: "text") | Inspect connection details. |
62
+ | | vpc | ` --name ` , ` --subnet ` , ` --output ` (default: "text") | Inspect VPC details. |
63
+ | | bgp | ` --switch-name ` , ` --strict ` | Inspect BGP neighbors. |
64
+ | | lldp | ` --switch-name ` , ` --strict ` , ` --fabric ` , ` --external ` , ` --server ` | Inspect LLDP neighbors. |
65
+ | | ip | ` --address ` | Inspect IP details. |
66
+ | | mac | ` --address ` | Inspect MAC details. |
67
+ | | access | ` --source ` , ` --destination ` | Inspect connectivity. |
68
+
69
+ ---
70
+
71
+ ## Command Details
72
+
73
+ ### ` vpc `
74
+ VPC management commands.
75
+
76
+ #### ` create `
77
+ Create a VPC:
78
+
79
+ ``` bash
80
+ kubectl fabric vpc create --name vpc-1 --subnet 10.0.1.0/24 --vlan 1001 --dhcp --dhcp-start 10.0.1.10 --dhcp-end 10.0.1.100
81
+ ```
82
+
83
+
84
+ ** Options:**
85
+ - ` --name ` – VPC name.
86
+ - ` --subnet ` – Subnet in CIDR format (** required** ).
87
+ - ` --vlan ` – VLAN ID (** required** ).
88
+ - ` --dhcp ` – Enable DHCP.
89
+ - ` --dhcp-range-start ` – Start of DHCP range.
90
+ - ` --dhcp-range-end ` – End of DHCP range.
91
+ - ` --print ` – Print object as YAML.
39
92
40
- Create VPC named ` vpc-1 ` with subnet ` 10.0.1.0/24 ` and VLAN ` 1001 ` with DHCP enabled and DHCP range starting from
41
- ` 10.0.1.10 ` (optional) :
93
+ #### ` attach `
94
+ Attach a VPC to a connection :
42
95
43
96
``` bash
44
- core@control-1 ~ $ kubectl fabric vpc create --name vpc-1 -- subnet 10.0.1.0/24 --vlan 1001 --dhcp --dhcp-start 10.0.1.10
97
+ kubectl fabric vpc attach --vpc-subnet vpc-1/default --connection server-01
45
98
```
46
99
47
- Attach previously created VPC to the server ` server-01 ` (which is connected to the Fabric using the
48
- ` server-01--mclag--leaf-01--leaf-02 ` Connection):
100
+
101
+ ** Options:**
102
+ - ` --vpc-subnet ` – VPC subnet name (** required** ).
103
+ - ` --connection ` – Connection name (** required** ).
104
+
105
+ #### ` peer `
106
+ Create a peering between VPCs:
49
107
50
108
``` bash
51
- core@control-1 ~ $ kubectl fabric vpc attach --vpc-subnet vpc-1/default --connection server-01--mclag--leaf-01--leaf-02
109
+ kubectl fabric vpc peer --vpc vpc-1 --vpc vpc-2
52
110
```
53
111
54
- To peer VPC with another VPC (e.g. ` vpc-2 ` ) use the following command:
112
+
113
+ ** Options:**
114
+ - ` --vpc ` – VPC names (** required** ).
115
+
116
+ #### ` wipe `
117
+ Delete all VPCs:
55
118
56
119
``` bash
57
- core@control-1 ~ $ kubectl fabric vpc peer --vpc vpc-1 --vpc vpc-2
120
+ kubectl fabric vpc wipe --yes
58
121
```
122
+
123
+
124
+ ** Options:**
125
+ - ` --yes ` – Confirm deletion.
126
+
127
+ ---
128
+
129
+ ### ` switch `
130
+ Switch management commands.
131
+
132
+ #### ` ip `
133
+ Get switch IP:
134
+
135
+ ``` bash
136
+ kubectl fabric switch ip --name switch-01
137
+ ```
138
+
139
+
140
+ ** Options:**
141
+ - ` --name ` – Switch name.
142
+ - ` --username ` – SSH username (default: "admin").
143
+
144
+ #### ` reboot `
145
+ Reboot the switch:
146
+
147
+ ``` bash
148
+ kubectl fabric switch reboot --name switch-01 --yes
149
+ ```
150
+
151
+
152
+ ** Options:**
153
+ - ` --name ` – Switch name.
154
+ - ` --yes ` – Confirm reboot.
155
+
156
+ ---
157
+
158
+ ### ` connection `
159
+ Get connection details:
160
+
161
+ ``` bash
162
+ kubectl fabric connection get management
163
+ ```
164
+
165
+
166
+ ** Options:**
167
+ - ` --type ` – Connection type (` management ` , ` fabric ` , ` vpc-loopback ` ).
168
+
169
+ ---
170
+
171
+ ### ` switchgroup `
172
+ Create a switch group:
173
+
174
+ ``` bash
175
+ kubectl fabric switchgroup create --name sg-01
176
+ ```
177
+
178
+
179
+ ** Options:**
180
+ - ` --name ` – Switch group name.
181
+
182
+ ---
183
+
184
+ ### ` external `
185
+ Create an external connection:
186
+
187
+ ``` bash
188
+ kubectl fabric external create --name ext-01 --ipv4-namespace default
189
+ ```
190
+
191
+
192
+ ** Options:**
193
+ - ` --name ` – External name.
194
+ - ` --ipv4-namespace ` – IPv4 namespace.
195
+
196
+ ---
197
+
198
+ ### ` wiring `
199
+ Export wiring diagram:
200
+
201
+ ``` bash
202
+ kubectl fabric wiring export --vpcs --externals
203
+ ```
204
+
205
+
206
+ ** Options:**
207
+ - ` --vpcs ` – Include VPCs (default: true).
208
+ - ` --externals ` – Include externals (default: true).
209
+
210
+ ---
211
+
212
+ ### ` inspect `
213
+ Inspect Fabric objects:
214
+
215
+ ``` bash
216
+ kubectl fabric inspect fabric --output text
217
+ ```
218
+
219
+
220
+ ** Options:**
221
+ - ` --output ` – Output format (` text ` , ` yaml ` , ` json ` ).
222
+
223
+ ---
224
+
225
+ ## Global Options
226
+ - ` --verbose ` , ` -v ` – Enable verbose output (includes debug).
227
+ - ` --help ` , ` -h ` – Show help.
228
+ - ` --version ` , ` -V ` – Display version information.
229
+ - ` --yes ` , ` -y ` – Confirm potentially dangerous actions.
230
+
0 commit comments