diff --git a/.yamllint b/.yamllint index 5c3e8c04..07498f3c 100644 --- a/.yamllint +++ b/.yamllint @@ -11,6 +11,7 @@ ignore: | config/default/* config/prometheus/* config/network-policy/* + kind/job/kustomization.yaml rules: # anchors: enable braces: enable diff --git a/docs/examples/example1-getting-started/README.md b/docs/examples/1-getting-started/README.md similarity index 91% rename from docs/examples/example1-getting-started/README.md rename to docs/examples/1-getting-started/README.md index 944200b8..bfb6befa 100644 --- a/docs/examples/example1-getting-started/README.md +++ b/docs/examples/1-getting-started/README.md @@ -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 @@ -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 diff --git a/docs/examples/example1-getting-started/dynamic_prefixclaim-large-font.drawio.svg b/docs/examples/1-getting-started/dynamic_prefixclaim-large-font.drawio.svg similarity index 100% rename from docs/examples/example1-getting-started/dynamic_prefixclaim-large-font.drawio.svg rename to docs/examples/1-getting-started/dynamic_prefixclaim-large-font.drawio.svg diff --git a/docs/examples/example1-getting-started/prefixclaim-dynamic.drawio.svg b/docs/examples/1-getting-started/prefixclaim-dynamic.drawio.svg similarity index 100% rename from docs/examples/example1-getting-started/prefixclaim-dynamic.drawio.svg rename to docs/examples/1-getting-started/prefixclaim-dynamic.drawio.svg diff --git a/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml b/docs/examples/1-getting-started/prefixclaim-dynamic.yaml similarity index 100% rename from docs/examples/example1-getting-started/prefixclaim-dynamic.yaml rename to docs/examples/1-getting-started/prefixclaim-dynamic.yaml diff --git a/docs/examples/example1-getting-started/prefixclaim-simple.drawio.svg b/docs/examples/1-getting-started/prefixclaim-simple.drawio.svg similarity index 100% rename from docs/examples/example1-getting-started/prefixclaim-simple.drawio.svg rename to docs/examples/1-getting-started/prefixclaim-simple.drawio.svg diff --git a/docs/examples/example1-getting-started/prefixclaim-simple.yaml b/docs/examples/1-getting-started/prefixclaim-simple.yaml similarity index 100% rename from docs/examples/example1-getting-started/prefixclaim-simple.yaml rename to docs/examples/1-getting-started/prefixclaim-simple.yaml diff --git a/docs/examples/example1-getting-started/simple_prefixclaim-large-font.drawio.svg b/docs/examples/1-getting-started/simple_prefixclaim-large-font.drawio.svg similarity index 100% rename from docs/examples/example1-getting-started/simple_prefixclaim-large-font.drawio.svg rename to docs/examples/1-getting-started/simple_prefixclaim-large-font.drawio.svg diff --git a/docs/examples/example2-load-balancer-ip/README.md b/docs/examples/2-load-balancer-ip/README.md similarity index 90% rename from docs/examples/example2-load-balancer-ip/README.md rename to docs/examples/2-load-balancer-ip/README.md index 6a34addd..e1ad58df 100644 --- a/docs/examples/example2-load-balancer-ip/README.md +++ b/docs/examples/2-load-balancer-ip/README.md @@ -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 diff --git a/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg b/docs/examples/2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg similarity index 100% rename from docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg rename to docs/examples/2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg diff --git a/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml b/docs/examples/2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml similarity index 100% rename from docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml rename to docs/examples/2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml diff --git a/docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg b/docs/examples/2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg similarity index 79% rename from docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg rename to docs/examples/2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg index 3cbc2e0d..bde2f471 100644 --- a/docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg +++ b/docs/examples/2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg @@ -1,4 +1,4 @@ - + @@ -117,8 +117,8 @@ - - + + @@ -139,14 +139,14 @@ - + -
+
reconcile @@ -154,21 +154,21 @@
- + reconcile - + -
+
create/update/delete @@ -176,7 +176,7 @@
- + create/update/delete @@ -190,7 +190,7 @@ -
+
get available prefixes @@ -198,7 +198,7 @@
- + get available prefixes @@ -359,8 +359,8 @@ - - + + @@ -376,7 +376,7 @@
- + reconcile
@@ -390,7 +390,7 @@ -
+
ownerReference @@ -398,7 +398,7 @@
- + ownerReference @@ -482,7 +482,7 @@
- kind: MetallbIPAddressPoolNetBox + kind: LoadBalancerIPPoolNetBox
spec: @@ -508,7 +508,7 @@
- kind: MetallbIPAddressPoolNetBox... + kind: LoadBalancerIPPoolNetBox... @@ -517,7 +517,7 @@ -
+
@@ -527,7 +527,7 @@
- + owner reference @@ -567,7 +567,7 @@ -
+
@@ -577,7 +577,7 @@
- + read status and update spec @@ -627,7 +627,7 @@ -
+
create @@ -635,7 +635,7 @@
- + create diff --git a/docs/examples/example2-load-balancer-ip/prepare-demo-env.sh b/docs/examples/2-load-balancer-ip/prepare-demo-env.sh similarity index 74% rename from docs/examples/example2-load-balancer-ip/prepare-demo-env.sh rename to docs/examples/2-load-balancer-ip/prepare-demo-env.sh index db5049e3..f3c57ad9 100755 --- a/docs/examples/example2-load-balancer-ip/prepare-demo-env.sh +++ b/docs/examples/2-load-balancer-ip/prepare-demo-env.sh @@ -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 @@ -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 diff --git a/docs/examples/example2-load-balancer-ip/sample-deployment.yaml b/docs/examples/2-load-balancer-ip/sample-deployment.yaml similarity index 100% rename from docs/examples/example2-load-balancer-ip/sample-deployment.yaml rename to docs/examples/2-load-balancer-ip/sample-deployment.yaml diff --git a/docs/examples/example2-load-balancer-ip/zurich-pool.yaml b/docs/examples/2-load-balancer-ip/zurich-pool.yaml similarity index 73% rename from docs/examples/example2-load-balancer-ip/zurich-pool.yaml rename to docs/examples/2-load-balancer-ip/zurich-pool.yaml index 01fbe3a3..a6317ed8 100644 --- a/docs/examples/example2-load-balancer-ip/zurich-pool.yaml +++ b/docs/examples/2-load-balancer-ip/zurich-pool.yaml @@ -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 diff --git a/docs/examples/example3-restoration/README.md b/docs/examples/3-restoration/README.md similarity index 100% rename from docs/examples/example3-restoration/README.md rename to docs/examples/3-restoration/README.md diff --git a/docs/examples/example3-restoration/prefixclaim-restore1.yaml b/docs/examples/3-restoration/prefixclaim-restore1.yaml similarity index 100% rename from docs/examples/example3-restoration/prefixclaim-restore1.yaml rename to docs/examples/3-restoration/prefixclaim-restore1.yaml diff --git a/docs/examples/example3-restoration/prefixclaim-restore2.yaml b/docs/examples/3-restoration/prefixclaim-restore2.yaml similarity index 100% rename from docs/examples/example3-restoration/prefixclaim-restore2.yaml rename to docs/examples/3-restoration/prefixclaim-restore2.yaml diff --git a/docs/examples/example3-restoration/prefixclaim-restore3.yaml b/docs/examples/3-restoration/prefixclaim-restore3.yaml similarity index 100% rename from docs/examples/example3-restoration/prefixclaim-restore3.yaml rename to docs/examples/3-restoration/prefixclaim-restore3.yaml diff --git a/docs/examples/example3-restoration/restoration-large-font.drawio.png b/docs/examples/3-restoration/restoration-large-font.drawio.png similarity index 100% rename from docs/examples/example3-restoration/restoration-large-font.drawio.png rename to docs/examples/3-restoration/restoration-large-font.drawio.png diff --git a/docs/examples/example3-restoration/restoration-large-font.drawio.svg b/docs/examples/3-restoration/restoration-large-font.drawio.svg similarity index 100% rename from docs/examples/example3-restoration/restoration-large-font.drawio.svg rename to docs/examples/3-restoration/restoration-large-font.drawio.svg diff --git a/docs/examples/3-restoration/restoration.drawio.svg b/docs/examples/3-restoration/restoration.drawio.svg new file mode 100644 index 00000000..d596fd0e --- /dev/null +++ b/docs/examples/3-restoration/restoration.drawio.svg @@ -0,0 +1,4 @@ + + + +
k8s cluster kind-london
namespace default
namespace "advanced"
namespace "netbox-operator"
reconcile
create & reconcile
netbox-operator
create
User
w/ kubectl
image/svg+xml
NetBox REST API
Prefix 2.0.0.0/32
Prefix 2.0.0.1/32
Prefix 2.0.0.2/32
restore by looking up
restoration hash
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
\ No newline at end of file diff --git a/docs/examples/example4-exhaustion/README.md b/docs/examples/4-exhaustion/README.md similarity index 100% rename from docs/examples/example4-exhaustion/README.md rename to docs/examples/4-exhaustion/README.md diff --git a/docs/examples/example4-exhaustion/exhaustion-1-starting-point.drawio.svg b/docs/examples/4-exhaustion/exhaustion-1-starting-point.drawio.svg similarity index 100% rename from docs/examples/example4-exhaustion/exhaustion-1-starting-point.drawio.svg rename to docs/examples/4-exhaustion/exhaustion-1-starting-point.drawio.svg diff --git a/docs/examples/example4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg b/docs/examples/4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg similarity index 100% rename from docs/examples/example4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg rename to docs/examples/4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg diff --git a/docs/examples/example4-exhaustion/exhaustion-3-after-fix.drawio.svg b/docs/examples/4-exhaustion/exhaustion-3-after-fix.drawio.svg similarity index 100% rename from docs/examples/example4-exhaustion/exhaustion-3-after-fix.drawio.svg rename to docs/examples/4-exhaustion/exhaustion-3-after-fix.drawio.svg diff --git a/docs/examples/example4-exhaustion/prefixclaim-exhaustion.yaml b/docs/examples/4-exhaustion/prefixclaim-exhaustion.yaml similarity index 100% rename from docs/examples/example4-exhaustion/prefixclaim-exhaustion.yaml rename to docs/examples/4-exhaustion/prefixclaim-exhaustion.yaml diff --git a/docs/examples/example5-multicluster/README.md b/docs/examples/5-multicluster/README.md similarity index 78% rename from docs/examples/example5-multicluster/README.md rename to docs/examples/5-multicluster/README.md index 79459482..4d626511 100644 --- a/docs/examples/example5-multicluster/README.md +++ b/docs/examples/5-multicluster/README.md @@ -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 @@ -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 diff --git a/docs/examples/example5-multicluster/cluster-cfg.yaml b/docs/examples/5-multicluster/cluster-cfg.yaml similarity index 100% rename from docs/examples/example5-multicluster/cluster-cfg.yaml rename to docs/examples/5-multicluster/cluster-cfg.yaml diff --git a/docs/examples/example5-multicluster/create-kind-clusters.sh b/docs/examples/5-multicluster/create-kind-clusters.sh similarity index 95% rename from docs/examples/example5-multicluster/create-kind-clusters.sh rename to docs/examples/5-multicluster/create-kind-clusters.sh index 5ff58bdd..4835744b 100755 --- a/docs/examples/example5-multicluster/create-kind-clusters.sh +++ b/docs/examples/5-multicluster/create-kind-clusters.sh @@ -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)) diff --git a/docs/examples/example5-multicluster/demo-setup.drawio.svg b/docs/examples/5-multicluster/demo-setup.drawio.svg similarity index 100% rename from docs/examples/example5-multicluster/demo-setup.drawio.svg rename to docs/examples/5-multicluster/demo-setup.drawio.svg diff --git a/docs/examples/example5-multicluster/kustomization.yaml b/docs/examples/5-multicluster/kustomization.yaml similarity index 100% rename from docs/examples/example5-multicluster/kustomization.yaml rename to docs/examples/5-multicluster/kustomization.yaml diff --git a/docs/examples/example5-multicluster/london-pools.yaml b/docs/examples/5-multicluster/london-pools.yaml similarity index 100% rename from docs/examples/example5-multicluster/london-pools.yaml rename to docs/examples/5-multicluster/london-pools.yaml diff --git a/docs/examples/example5-multicluster/multicluster.drawio.svg b/docs/examples/5-multicluster/multicluster.drawio.svg similarity index 100% rename from docs/examples/example5-multicluster/multicluster.drawio.svg rename to docs/examples/5-multicluster/multicluster.drawio.svg diff --git a/docs/examples/example5-multicluster/netbox-l2advertisement.yaml b/docs/examples/5-multicluster/netbox-l2advertisement.yaml similarity index 100% rename from docs/examples/example5-multicluster/netbox-l2advertisement.yaml rename to docs/examples/5-multicluster/netbox-l2advertisement.yaml diff --git a/docs/examples/example5-multicluster/netbox-svc.yaml b/docs/examples/5-multicluster/netbox-svc.yaml similarity index 100% rename from docs/examples/example5-multicluster/netbox-svc.yaml rename to docs/examples/5-multicluster/netbox-svc.yaml diff --git a/docs/examples/example5-multicluster/prepare-demo-env.sh b/docs/examples/5-multicluster/prepare-demo-env.sh similarity index 73% rename from docs/examples/example5-multicluster/prepare-demo-env.sh rename to docs/examples/5-multicluster/prepare-demo-env.sh index f4fcf075..b23eb7ae 100755 --- a/docs/examples/example5-multicluster/prepare-demo-env.sh +++ b/docs/examples/5-multicluster/prepare-demo-env.sh @@ -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 @@ -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 diff --git a/docs/examples/example5-multicluster/zurich-pools.yaml b/docs/examples/5-multicluster/zurich-pools.yaml similarity index 100% rename from docs/examples/example5-multicluster/zurich-pools.yaml rename to docs/examples/5-multicluster/zurich-pools.yaml diff --git a/docs/examples/example3-restoration/restoration.drawio.svg b/docs/examples/example3-restoration/restoration.drawio.svg deleted file mode 100644 index 61ed40e5..00000000 --- a/docs/examples/example3-restoration/restoration.drawio.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
reconcile
reconcile
create & reconcile
create & reconcile
netbox-operator
netbox-operator
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
Prefix 2.0.0.0/32
Prefix 2.0.0.0/32
Prefix 2.0.0.1/32
Prefix 2.0.0.1/32
Prefix 2.0.0.2/32
Prefix 2.0.0.2/32
restore by looking up
restoration hash
restore by looking up...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
Text is not SVG - cannot display
diff --git a/kind/deploy-netbox.sh b/kind/deploy-netbox.sh index 7bdd2c17..fb81b70a 100755 --- a/kind/deploy-netbox.sh +++ b/kind/deploy-netbox.sh @@ -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" diff --git a/kind/job/kustomization.yaml b/kind/job/kustomization.yaml index 716fe282..68fcafcd 100644 --- a/kind/job/kustomization.yaml +++ b/kind/job/kustomization.yaml @@ -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