Skip to content

Commit bb93417

Browse files
committed
add drawing of demo setup
1 parent 3a6513e commit bb93417

File tree

9 files changed

+238
-135
lines changed

9 files changed

+238
-135
lines changed

docs/examples/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This folder shows some examples how the NetBox Operator can be used. The demo environment can be prepared with the 'docs/examples/set-up/prepare-demo-env.sh' script, which creates two kind clusters with NetBox Operator and [kro] installed. One one of the clusters a NetBox instance is installed which is available to both NetBox Operator deployments.
44

5+
![Demo Set Up](demo-setup.drawio.svg)
6+
57
[kro]: https://github.com/kro-run/kro/
68

79
Prerequisites:

docs/examples/demo-setup.drawio.svg

+226
Loading

docs/examples/example1-getting-started/README-ex1.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
Before prefixes and ip addresses can be claimed with the NetBox operator, a prefix has to be created in NetBox.
66

7-
1. Port-forward NetBox: `kubectl port-forward --context kind-london deploy/netbox 8080:8080 -n default`
7+
1. Port-forward NetBox: `kubectl port-forward --context kind-london deploy/netbox 8080:8080`
88
2. Open <http://localhost:8080> in your favorite browser and log in with the username `admin` and password `admin`
9-
3. Create a new prefix '3.0.0.64/25' with custom fields 'environment: prod'
9+
3. Create a new prefix '3.0.0.64/26' with custom field 'environment: prod'
1010

1111
# 1.1 Claim a Prefix
1212

@@ -22,13 +22,14 @@ Before prefixes and ip addresses can be claimed with the NetBox operator, a pref
2222

2323
![Example 1.2](dynamic-prefixclaim.drawio.svg)
2424

25-
# 1.3 Claim a Prefix for a Podinfo Deployment and Create a MetalLB IPAddressPool
25+
# 1.3 Claim a Prefix and Create a MetalLB IPAddressPool, create a depoyment which is exposed with a service using an ip from the claimed prefix
2626

2727
This example uses [kro] to map the claimed prefix to a MetalLB IPAddressPool. The required resource graph definitions and kro were installed with the set-up script.
2828

29-
1. Apply the manifests to create a deployment with a service and a metallb-ip-address-pool-netbox to create a metalLB IPAddressPool from the prefix claimed from NetBox `kubectl apply --context kind-zurich -f docs/examples/example1-getting-started/ip-address-pool.yaml`
30-
2. Apply the manifests to createa deployment with a service that gets a ip assigned from the metalLB pool created in the prevoius step. `kubectl apply --context kind-zurich -k docs/examples/example1-getting-started/sample-deployment.yaml`
31-
3. check if the frontend service got an external ip address assigned `kubectl get --context kind-zurich svc podinfo -n test`
29+
1. Apply the kro resource graph definition, defining the mapping from the prefix claim to the metalLB ip address pool `kubectl apply -f docs/examples/set-up/metallb-ip-address-pool-netbox.yaml`
30+
2. Apply the manifests to create a deployment with a service and a metallb-ip-address-pool-netbox to create a metalLB IPAddressPool from the prefix claimed from NetBox `kubectl apply --context kind-zurich -f docs/examples/example1-getting-started/ip-address-pool.yaml`
31+
3. Apply the manifests to createa deployment with a service that gets a ip assigned from the metalLB pool created in the prevoius step. `kubectl apply --context kind-zurich -k docs/examples/example1-getting-started/sample-deployment.yaml`
32+
4. check if the frontend service got an external ip address assigned `kubectl get --context kind-zurich svc my-nginx -n nginx`
3233

3334

3435
![Example 1.3](metallb-ipaddresspool-netbox.drawio.svg)

docs/examples/example1-getting-started/kustomization.yaml

-16
This file was deleted.

docs/examples/example1-getting-started/simple_prefixclaim.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ metadata:
77
name: simple-prefixclaim
88
spec:
99
tenant: "MY_TENANT"
10-
parentPrefix: 3.0.0.64/25
10+
parentPrefix: 3.0.0.64/26
1111
prefixLength: "/30"

docs/examples/example2-multicluster/london-pools.yaml

-55
Original file line numberDiff line numberDiff line change
@@ -52,58 +52,3 @@ spec:
5252
prefixLength: "/30"
5353
parentPrefixSelector:
5454
environment: prod
55-
---
56-
apiVersion: kro.run/v1alpha1
57-
kind: MetalLBIPAddressPoolNetBox
58-
metadata:
59-
name: london-network-6
60-
spec:
61-
name: london-network-6
62-
tenant: "MY_TENANT"
63-
prefixLength: "/30"
64-
parentPrefixSelector:
65-
environment: prod
66-
---
67-
apiVersion: kro.run/v1alpha1
68-
kind: MetalLBIPAddressPoolNetBox
69-
metadata:
70-
name: london-network-7
71-
spec:
72-
name: london-network-7
73-
tenant: "MY_TENANT"
74-
prefixLength: "/30"
75-
parentPrefixSelector:
76-
environment: prod
77-
---
78-
apiVersion: kro.run/v1alpha1
79-
kind: MetalLBIPAddressPoolNetBox
80-
metadata:
81-
name: london-network-8
82-
spec:
83-
name: london-network-8
84-
tenant: "MY_TENANT"
85-
prefixLength: "/30"
86-
parentPrefixSelector:
87-
environment: prod
88-
---
89-
apiVersion: kro.run/v1alpha1
90-
kind: MetalLBIPAddressPoolNetBox
91-
metadata:
92-
name: london-network-9
93-
spec:
94-
name: london-network-9
95-
tenant: "MY_TENANT"
96-
prefixLength: "/30"
97-
parentPrefixSelector:
98-
environment: prod
99-
---
100-
apiVersion: kro.run/v1alpha1
101-
kind: MetalLBIPAddressPoolNetBox
102-
metadata:
103-
name: london-network-10
104-
spec:
105-
name: london-network-10
106-
tenant: "MY_TENANT"
107-
prefixLength: "/30"
108-
parentPrefixSelector:
109-
environment: prod

docs/examples/example2-multicluster/zurich-pools.yaml

-55
Original file line numberDiff line numberDiff line change
@@ -52,58 +52,3 @@ spec:
5252
prefixLength: "/30"
5353
parentPrefixSelector:
5454
environment: prod
55-
---
56-
apiVersion: kro.run/v1alpha1
57-
kind: MetalLBIPAddressPoolNetBox
58-
metadata:
59-
name: zurich-network-6
60-
spec:
61-
name: zurich-network-6
62-
tenant: "MY_TENANT"
63-
prefixLength: "/30"
64-
parentPrefixSelector:
65-
environment: prod
66-
---
67-
apiVersion: kro.run/v1alpha1
68-
kind: MetalLBIPAddressPoolNetBox
69-
metadata:
70-
name: zurich-network-7
71-
spec:
72-
name: zurich-network-7
73-
tenant: "MY_TENANT"
74-
prefixLength: "/30"
75-
parentPrefixSelector:
76-
environment: prod
77-
---
78-
apiVersion: kro.run/v1alpha1
79-
kind: MetalLBIPAddressPoolNetBox
80-
metadata:
81-
name: zurich-network-8
82-
spec:
83-
name: zurich-network-8
84-
tenant: "MY_TENANT"
85-
prefixLength: "/30"
86-
parentPrefixSelector:
87-
environment: prod
88-
---
89-
apiVersion: kro.run/v1alpha1
90-
kind: MetalLBIPAddressPoolNetBox
91-
metadata:
92-
name: zurich-network-9
93-
spec:
94-
name: zurich-network-9
95-
tenant: "MY_TENANT"
96-
prefixLength: "/30"
97-
parentPrefixSelector:
98-
environment: prod
99-
---
100-
apiVersion: kro.run/v1alpha1
101-
kind: MetalLBIPAddressPoolNetBox
102-
metadata:
103-
name: zurich-network-10
104-
spec:
105-
name: zurich-network-10
106-
tenant: "MY_TENANT"
107-
prefixLength: "/30"
108-
parentPrefixSelector:
109-
environment: prod

docs/examples/set-up/cluster-cfg.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ nodes:
1111
kind: InitConfiguration
1212
nodeRegistration:
1313
kubeletExtraArgs:
14-
node-labels: "ingress-ready=true"
14+
node-labels: "ingress-ready=true"

kind/local-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ fi
3939
kind create cluster || echo "cluster already exists, continuing..."
4040
kubectl wait --for=jsonpath='{.status.phase}'=Active --timeout=1s namespace/${NAMESPACE}
4141

42-
./kind/deploy-netbox.sh kind $VERSION $NAMESPACE
42+
./kind/deploy-netbox.sh kind $VERSION $NAMESPACE

0 commit comments

Comments
 (0)