diff --git a/README.md b/README.md index da7136b7..0b3cf0bf 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,14 @@ NetBox Operator extends the Kubernetes API by allowing users to manage NetBox resources – such as IP addresses and prefixes – directly through Kubernetes. This integration brings Kubernetes-native features like reconciliation, ensuring that network configurations are maintained automatically, thereby improving both efficiency and reliability. +## The Claim Model +The NetBox Operator implements a "Claim Model" which is also used in the Kubernetes PersistentVolumeClaims (PVCs). +In this case, instead of disk storage, NetBox Operator dynamically allocates network resources (Prefixes and IP Addresses) based on claims submitted via custom resources. + +### Purpose +This model ensures a declarative management of IP addressing and subnet allocation, with full NetBox integration. +The users will create claims (PrefixClaims & IPAddressClaims), and the NetBox Operator will resolve them into actual Prefixes and IPAddresses within a designated parent prefix. + ![Figure 1: NetBox Operator High-Level Architecture](docs/netbox-operator-high-level-architecture.drawio.svg) # Getting Started diff --git a/docs/netbox-operator-high-level-architecture.drawio.svg b/docs/netbox-operator-high-level-architecture.drawio.svg index 55a08d29..62fcb76f 100644 --- a/docs/netbox-operator-high-level-architecture.drawio.svg +++ b/docs/netbox-operator-high-level-architecture.drawio.svg @@ -1,457 +1,4 @@ - - - - - - - - -
-
-
- k8s cluster -
-
-
-
- - k8s cluster - -
-
- - - - - -
-
-
- user namespace -
-
-
-
- - user namespace - -
-
- - - - - - -
-
-
- consumer -
-
-
-
- - consumer - -
-
- - - - -
-
-
- NetBox REST API -
-
-
-
- - NetBox REST API - -
-
- - - - -
-
-
- namespace netbox-operator -
-
-
-
- - namespace netbox-operator - -
-
- - - - - -
-
-
- reconcile -
-
-
-
- - reconcile - -
-
- - - - - -
-
-
- create/update/delete -
-
-
-
- - create/update/delete - -
-
- - - - - -
-
-
- create -
-
-
-
- - create - -
-
- - - - - -
-
-
- reconcile -
-
-
-
- - reconcile - -
-
- - - - - -
-
-
- create/update/delete -
-
-
-
- - create/update/delete - -
-
- - - - - -
-
-
- get available prefixes -
-
-
-
- - get available prefixes - -
-
- - - - -
-
-
- netbox-operator -
-
-
-
- - netbox-operator - -
-
- - - - -
-
-
-
- kind: PrefixClaim -
-
- spec: -
-
- parentPrefix: 2.0.0.0/16 -
-
- prefixLength: /28 -
-
-
-
-
-
- - kind: PrefixClaim... - -
-
- - - - -
-
-
- Prefix 2.0.0.0/16 -
-
-
-
- - Prefix 2.0.0.0/16 - -
-
- - - - - -
-
-
- User -
- w/ kubectl -
-
-
-
- - User... - -
-
- - - - - -
-
-
- GitOps -
- w/ Argo or Flux -
-
-
-
- - GitOps... - -
-
- - - - -
-
-
- and/or -
-
-
-
- - and/or - -
-
- - - - -
-
-
-
- kind: Prefix -
-
- spec: -
-
- prefix: 2.0.0.0/16 -
-
-
-
-
-
- - kind: Prefix... - -
-
- - - - - -
-
-
- reconcile -
-
-
-
- - reconcile - -
-
- - - - - -
-
-
- ownerReference -
-
-
-
- - ownerReference - -
-
- - - - -
-
-
-
- kind: Prefix -
-
- spec: -
-
- prefix: 2.0.0.0/28 -
-
-
-
-
-
-
-
- - kind: Prefix... - -
-
- - - - -
-
-
- Prefix 2.0.0.0/28 -
-
-
-
- - Prefix 2.0.0.0/28 - -
-
- - - - - -
-
-
- create/sync -
-
-
-
- - create/sync - -
-
- - -
- - - - - Text is not SVG - cannot display - - - -
+ + + +
k8s cluster
user namespace
consumer
NetBox REST API
namespace netbox-operator
reconcile
create/update/delete
create
reconcile
create/update/delete
get available prefixes
netbox-operator
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  prefix: 2.0.0.0/28
Prefix 2.0.0.0/16
User
w/ kubectl
GitOps
w/ Argo or Flux
and/or
kind: Prefix
spec:
  prefix: 2.0.0.0/16
reconcile
update status
(ownerReference)
kind: Prefix
spec:
  prefix: 2.0.0.0/28

Prefix 2.0.0.0/28
create/sync
image/svg+xml
\ No newline at end of file diff --git a/docs/operational-manual.md b/docs/operational-manual.md new file mode 100644 index 00000000..b9162e5b --- /dev/null +++ b/docs/operational-manual.md @@ -0,0 +1,50 @@ +# Operational Manual + +This document describes how to troubleshoot errors in the NetBox Operator. +Known issues are collected on the [GitHub issues](https://github.com/netbox-community/netbox-operator/issues) page. + +## Troubleshooting + +### Check Logs +Use the following command to get logs from the operator: + +```bash +kubectl logs -n deployment/netbox-operator-controller-manager +``` + +### Check CR Status +Inspect the CRs status: + +```bash +kubectl describe -n +``` + +E.g.: +```bash +kubectl describe prefixclaim prefixclaim-sample -n +kubectl describe ipaddressclaim ipaddressclaim-sample -n +kubectl describe prefix prefix-sample -n +kubectl describe ipaddress ipaddress-sample -n +``` +This will show you the status of the operator and any errors it may have encountered. + +### Verify Operator Version + +```bash +kubectl get deployment netbox-operator-controller-manager -n -o=jsonpath="{.spec.template.spec.containers[*].image}" +``` + +### Look at Related Pods +If netbox-oeprator is not running correctly, inspect the related pods: + +```bash +kubectl logs deployment/netbox-operator-controller-manager -n -c manager +kubectl describe pod -n +``` + +### Check Events +Events might give hints about what’s going wrong: + +```bash +kubectl get events -n --sort-by='.lastTimestamp' +``` \ No newline at end of file diff --git a/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg b/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg index 99cd828a..5118715c 100644 --- a/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg +++ b/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster
k8s cluster
namespace default
namespace default
user namespace
user namespace
namespace netbox-operator
namespace netbox-operator
create
create
reconcile
reconcile
netbox-operator
netbox-operator
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/28
kind: Prefix...
NetBox REST API
NetBox REST API
create/update/delete
create/update/delete
get available prefixes
get available prefixes
Prefix 2.0.0.0/16
Prefix 2.0.0.0/16
Prefix 2.0.0.0/28
Prefix 2.0.0.0/28
kind: MetalLBIPPoolNetBox (kro )
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
kind: MetalLBIPPoolNetBox (kro )...
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  ipAddress:
kind: PrefixClaim...
kind: IPAddressPool
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
kind: IPAddressPool...
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster
namespace default
user namespace
namespace netbox-operator
create
reconcile
netbox-operator
reconcile
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/28
image/svg+xml
NetBox REST API
create/update/delete
get available prefixes
Prefix 2.0.0.0/16
Prefix 2.0.0.0/28
kind: MetalLBIPPoolNetBox (kro )
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  ipAddress:
kind: IPAddressPool
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
\ No newline at end of file