Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ignore: |
config/default/*
config/prometheus/*
config/network-policy/*
kind/job/kustomization.yaml
rules:
# anchors: enable
braces: enable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kubectl port-forward deploy/netbox 8080:8080

# 0.3 Navigate to the example folder

Navigate to 'docs/examples/example1-getting-started' to run the examples below
Navigate to 'docs/examples/1-getting-started' to run the examples below

# 1.1 Claim a Prefix

Expand All @@ -46,7 +46,7 @@ kubectl get pxc,px

In this example, we use a `.spec.parentPrefixSelector`, which is a list of selectors that tell NetBox Operator from which parent prefixes to claim our Prefix from.

Navigate to 'docs/examples/example1-getting-started' to run the following commands.
Navigate to 'docs/examples/1-getting-started' to run the following commands.

1. Inspect the spec of the sample prefix claim CR
```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ kubectl port-forward deploy/netbox 8080:8080

### 0.3 Navigate to the example folder

Navigate to 'docs/examples/example2-load-balancer-ip/' to run the examples below
Navigate to 'docs/examples/2-load-balancer-ip/' to run the examples below

## Example Steps

0. Install kro and metallb with the installation script `docs/examples/example2-load-balancer-ip/prepare-demo-env.sh`
Then navigate to 'docs/examples/example2-load-balancer-ip' to follow the steps below.
0. Install kro and metallb with the installation script `docs/examples/2-load-balancer-ip/prepare-demo-env.sh`
Then navigate to 'docs/examples/2-load-balancer-ip' to follow the steps below.

1. Inspect the spec of the sample prefix claim CR
```bash
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ set -e
make deploy-kind

# install curl pod to demo access to created service
kind load docker-image curlimages/curl
kind load docker-image curlimages/curl
kubectl run curl --image curlimages/curl --image-pull-policy=Never -- sleep infinity

# load the nginx image into the kind cluster
kind load docker-image nginx
kind load docker-image nginx
kubectl run curl --image curlimages/curl -- sleep infinity

DEPLOYMENT_NAME=netbox-operator-controller-manager
NAMESPACE=netbox-operator-system
Expand Down Expand Up @@ -39,4 +33,4 @@ while true; do
sleep 5
fi
done
kubectl apply --context $CONTEXT -f docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml
kubectl apply --context $CONTEXT -f docs/examples/2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: zurich-pool
spec:
name: zurich-pool
tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value
tenant: "MY_TENANT"
prefixLength: "/30"
parentPrefixSelector:
environment: prod
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/3-restoration/restoration.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example shows how to claim multiple prefixes from different clusters and ma

### 0.1 Create a local cluster with nebox-installed

1. set up your local environment to run the following examples with the set up script 'docs/examples/example5-multicluster/prepare-demo-env.sh'
1. set up your local environment to run the following examples with the set up script 'docs/examples/5-multicluster/prepare-demo-env.sh'

### 0.2 Manually Create a Prefix in NetBox

Expand All @@ -23,17 +23,17 @@ kubectl port-forward deploy/netbox 8080:8080

### 0.3 Navigate to the example folder

Navigate to 'docs/examples/example5-multicluster/' to run the examples below
Navigate to 'docs/examples/5-multicluster/' to run the examples below

## Example Steps

1. Create ip address pools on the london cluster
```bash
kubectl apply --context kind-london -f docs/examples/example5-multicluster/london-pools.yaml
kubectl apply --context kind-london -f docs/examples/5-multicluster/london-pools.yaml
```
2. Create ip address pool on the zurich cluster
```bash
kubectl create --context kind-zurich -f docs/examples/example5-multicluster/zurich-pools.yaml
kubectl create --context kind-zurich -f docs/examples/5-multicluster/zurich-pools.yaml
```
3. Look up the created prefix claims
```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ i=0

# Loop to create the specified number of clusters
for clustername in "$@"; do
config_file="docs/examples/example5-multicluster/cluster-cfg.yaml"
config_file="docs/examples/5-multicluster/cluster-cfg.yaml"
temp_config="tmp/cluster-$clustername-cfg.yaml"
i=$((i + 1))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e
#create the kind clusters zurich and london
./docs/examples/example5-multicluster/create-kind-clusters.sh zurich london
./docs/examples/5-multicluster/create-kind-clusters.sh zurich london

# install netbox in the london cluster and load demo data
kubectl config use-context kind-london
Expand All @@ -11,17 +11,17 @@ kubectl config use-context kind-london
kubectl config use-context kind-london
kind load docker-image netbox-operator:build-local --name london
kind load docker-image netbox-operator:build-local --name london # fixes an issue with podman where the image is not correctly tagged after the first kind load docker-image
kustomize build docs/examples/example5-multicluster/ | kubectl apply -f -
kustomize build docs/examples/5-multicluster/ | kubectl apply -f -

kubectl config use-context kind-zurich
kind load docker-image netbox-operator:build-local --name zurich
kind load docker-image netbox-operator:build-local --name zurich # fixes an issue with podman where the image is not correctly tagged after the first kind load docker-image
kustomize build docs/examples/example5-multicluster/ | kubectl apply -f -
kustomize build docs/examples/5-multicluster/ | kubectl apply -f -
kind load docker-image curlimages/curl --name zurich
kind load docker-image curlimages/curl --name zurich
kubectl run curl --image curlimages/curl --image-pull-policy=Never -- sleep infinity

# expose netbox service
kubectl config use-context kind-london
kubectl apply -f docs/examples/example5-multicluster/netbox-svc.yaml
kubectl apply -f docs/examples/example5-multicluster/netbox-l2advertisement.yaml
kubectl apply -f docs/examples/5-multicluster/netbox-svc.yaml
kubectl apply -f docs/examples/5-multicluster/netbox-l2advertisement.yaml
4 changes: 0 additions & 4 deletions docs/examples/example3-restoration/restoration.drawio.svg

This file was deleted.

10 changes: 0 additions & 10 deletions kind/deploy-netbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ else
exit 1
fi

if $IS_VCLUSTER; then
echo "[Running in vCluster mode] skipping docker pull and kind load for remote images."
else
echo "[Running in Kind mode] pulling and loading remote images into kind cluster..."
for img in "${Remote_Images[@]}"; do
docker pull "$img"
kind load docker-image "$img" --name "${CLUSTER}"
done
fi

# build image for loading local data via NetBox API
cd "$SCRIPT_DIR/load-data-job"

Expand Down
9 changes: 4 additions & 5 deletions kind/job/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
resources:
- load-data-job.yaml
- load-data-job.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: ghcr.io/zalando/spilo-16
newName: ghcr.io/zalando/spilo-16
- name: ghcr.io/zalando/spilo-16
newName: ghcr.io/zalando/spilo-16
patches:
- path: sql-env-patch.yaml
- path: sql-env-patch.yaml
Loading