-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #616 from mplsgrant/2024-09-create-kube-configs-st…
…epthru Using team namespaces: Kubeconfig Step Thru
- Loading branch information
Showing
22 changed files
with
1,028 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ jobs: | |
- services_test.py | ||
- signet_test.py | ||
- scenarios_test.py | ||
- namespace_admin_test.py | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: azure/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ warnet.egg-info | |
.env | ||
dist/ | ||
build/ | ||
**/kubeconfigs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Admin | ||
|
||
## Connect to your cluster | ||
|
||
Ensure you are connected to your cluster because Warnet will use your current configuration to generate configurations for your users. | ||
|
||
```shell | ||
$ warnet status | ||
``` | ||
|
||
Observe that the output of the command matches your cluster. | ||
|
||
## Create an *admin* directory | ||
|
||
```shell | ||
$ mkdir admin | ||
$ cd admin | ||
$ warnet admin init | ||
``` | ||
|
||
Observe that there are now two folders within the *admin* directory: *namespaces* and *networks* | ||
|
||
## The *namespaces* directory | ||
This directory contains a Helm chart named *two_namespaces_two_users*. | ||
|
||
Modify this chart based on the number of teams and users you have. | ||
|
||
Deploy the *two_namespaces_two_users* chart. | ||
|
||
```shell | ||
$ warnet deploy namespaces/two_namespaces_two_users | ||
``` | ||
|
||
Observe that this creates service accounts and namespaces in the cluster: | ||
|
||
```shell | ||
$ kubectl get ns | ||
$ kubectl get sa -A | ||
``` | ||
|
||
### Creating Warnet invites | ||
A Warnet invite is a Kubernetes config file. | ||
|
||
Create invites for each of your users. | ||
|
||
```shell | ||
$ warnet admin create-kubeconfigs | ||
``` | ||
|
||
Observe the *kubeconfigs* directory. It holds invites for each user. | ||
|
||
### Using Warnet invites | ||
Users can connect to your wargame using their invite. | ||
|
||
```shell | ||
$ warnet auth alice-wargames-red-team-kubeconfig | ||
``` | ||
|
||
### Set up a network for your users | ||
Before letting the users into your cluster, make sure to create a network of tanks for them to view. | ||
|
||
|
||
```shell | ||
$ warnet deploy networks/mynet --to-all-users | ||
``` | ||
|
||
Observe that the *wargames-red-team* namespace now has tanks in it. | ||
|
||
**TODO**: What's the logging approach here? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.