Skip to content

Commit 2529823

Browse files
committed
add admin documentation
1 parent c9b6a73 commit 2529823

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

docs/admin.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Admin
2+
3+
## Connect to your cluster
4+
5+
Ensure you are connected to your cluster because Warnet will use your current configuration to generate configurations for your users.
6+
7+
```shell
8+
$ warnet status
9+
```
10+
11+
Observe that the output of the command matches your cluster.
12+
13+
**TODO** Add the *current-config* to the *status* report.
14+
15+
## Create an *admin* directory
16+
17+
```shell
18+
$ mkdir admin
19+
$ cd admin
20+
$ warnet admin init
21+
```
22+
23+
Observe that there are now two folders within the *admin* directory: *namespaces* and *networks*
24+
25+
## The *namespaces* directory
26+
This directory contains a Helm chart named *two_namespaces_two_users*.
27+
28+
Modify this chart based on the number of teams and users you have.
29+
30+
Deploy the *two_namespaces_two_users* chart.
31+
32+
```shell
33+
$ cd namespaces
34+
$ warnet deploy two_namespaces_two_users
35+
```
36+
37+
**TODO**: `warnet deploy namespaces/two_namespaces_two_users` fails with an error about directory handling
38+
39+
Observe that this creates service accounts and namespaces in the cluster:
40+
41+
```shell
42+
$ kubectl get ns
43+
$ kubectl get sa -A
44+
```
45+
46+
**TODO**: `warnet admin namespaces list` does not show the teams as yet.
47+
48+
**TODO**: Lift `kubectl get sa -A` into Warnet.
49+
50+
### Creating Warnet invites
51+
A Warnet invite is a Kubernetes config file.
52+
53+
Create invites for each of your users.
54+
55+
```shell
56+
$ warnet admin create-kubeconfigs wargames
57+
```
58+
59+
Take note of the "wargames" prefix we used. That aligns with the "wargames" prefix of the namespaces we created for our users.
60+
61+
Observe the *kubeconfigs* directory. It holds invites for each user.
62+
63+
### Using Warnet invites
64+
Users can connect to your wargame using their invite.
65+
66+
```shell
67+
$ warnet auth alice-wargames-red-team-kubeconfig
68+
```
69+
70+
### Set up a network for your users
71+
Before letting the users into your cluster, make sure to create a network of tanks for them to view.
72+
73+
74+
```shell
75+
$ warnet admin deploy networks/mynet --namepace wargames-red-team
76+
```
77+
78+
**TODO**: What's the logging approach here?
79+
80+
Observe that the *wargames-red-team* namespace now has tanks in it.

0 commit comments

Comments
 (0)