NETCONF operator

Report Card
Build Status

This operator is meant to provide support for:

  • RFC6241 Network Configuration Protocol (NETCONF)
  • RFC6242 Using the NETCONF Protocol over Secure Shell (SSH)

It is build using the following go-netconf implementation.

Usage

The MountPoint CRD is meant to establish an SSH connection to a remote NETCONF server. It supports only username/password for authentication. Support for public key pair will be added shortly.

The NETCONF operations currently supported are represented with their respective CRD, see the examples folder:

  • Get
  • GetConfig
  • EditConfig
  • Commit
  • Lock
  • Unlock

All these operations rely on the MountPoint to be existing at the time of the CRD creation.

The Lock CRD removes the lock on the datastore when deleted; so removal of a Lock CR acts like an unlock.

Finally, in order to sequence operations, the EditConfig, Commit, and Unlock CRD provide to ability to define an operation it is depending on. As such, one can achieve such flow: Lock –> EditConfig –> Commit –> Unlock.

TODO

  • fix cleanup sequence
  • add support for NETCONF notification
  • map NETCONF notification to K8S event

Dev

To build:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
make docker-build docker-push IMG=quay.io/adetalho/netconf-operator:dev

To deploy:

make deploy IMG=quay.io/adetalho/netconf-operator:dev

To remove:

make undeploy

How the operator was generated using the Operator SDK

1 – create the scaffolding

operator-sdk init \
--domain=adetalhouet.io \
--repo=github.com/adetalhouet/netconf-operator
  1. generate the netconf operations API.

operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind Mountpoint
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind Commit
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind EditConfig
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind GetConfig
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind Get
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind Lock
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind Unlock
    
operator-sdk create api \
    --resource=true \
    --controller=true \
    --group netconf \
    --version v1 \
    --kind RPC

Links

Getting started with Operator SDK

GitHub

View Github