onos-operator

module
v0.4.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2021 License: Apache-2.0

README

Kubernetes Operator for µONOS

This project provides a set of Kubernetes operators for managing components of the µONOS architecture. µONOS operators extend the Kubernetes API with custom resources and integrate µONOS subsystems with the Kubernetes control plane.

To install the µONOS operator you can use Helm as follows:

> helm install -n kube-system onos-operator onosproject/onos-operator --wait
NAME: onos-operator
LAST DEPLOYED: Tue Oct 12 20:02:04 2021
NAMESPACE: kube-system
STATUS: deployed
REVISION: 1
TEST SUITE: None

The operator consists of a topo-operator pod, config-operator and app-operator pod, all of which will be installed in the kube-system namespace by default.

> kubectl get pods -n kube-system
NAME                                              READY   STATUS    RESTARTS   AGE
onos-operator-app-585d588d5c-ndvkr                1/1     Running   0          42m39s
onos-operator-config-6d59c87b9b-f89bk             1/1     Running   0          42m39s
onos-operator-topo-7ff4df6f57-6p8dv               1/1     Running   0          42m39s

App Operator

The application operator registers a mutating admission webhook to intercept pod deployment requests. These requests are inspected for presence of proxy.onosproject.org/inject metadata annotation. If this annotation is present and its value is true, the deployment request will be augmented to include a sidecar onosproject/onos-proxy container as part of the pod.

For more information about see onos-proxy.

Topology Operator

The topology operator extends the Kubernetes API with custom resources for defining µONOS topology objects. Topology resources are propagated from the Kubernetes API to the onos-topo service via the onos-api. When a topology resource is created, the topology operator adds the object to µONOS topology. When a topology resource is deleted, the operator will remove the associated object from the µONOS topology.

Kind

To define a topology object kind, create a Kind resource:

apiVersion: topo.onosproject.org/v1beta1
kind: Kind
metadata:
  name: e2-node
spec:
  attributes:
    foo: bar
Entity

To define a topology entity, create an Entity resource:

apiVersion: topo.onosproject.org/v1beta1
kind: Entity
metadata:
  name: e2-node-1
spec:
  kind:
    name: e2-node
  attributes:
    baz: foo
Relation

To define a topology relation, create a Relation resource connecting a source and target entity:

apiVersion: topo.onosproject.org/v1beta1
kind: Relation
metadata:
  name: e2-node-1-e2t-1
spec:
  kind:
    name: e2-connection
  source:
    name: e2-node-1
  target:
    name: e2t-1
Dynamic topology management

The topology operator supports dynamic entity sets with Kubernetes label selectors using the Service resource:

apiVersion: topo.onosproject.org/v1beta1
kind: Service
metadata:
  name: my-app
spec:
  selector:
    matchLabels:
      name: my-app
  kind:
    name: my-app-node

The operator will automatically populate the µONOS topology with an entity for each pod matching the service's label selector. This allows dynamic/autoscaling Kubernetes components like ReplicaSets to be represented as dynamic objects in the µONOS topology.

Config Operator

The config operator extends the Kubernetes API, adding a custom Model resource for defining config (YANG) models. The config operator automatically injects configured Model resources into onos-config pods, compiling plugins on the fly.

apiVersion: config.onosproject.org/v1beta1
kind: Model
metadata:
  name: ric
spec:
  plugin:
    type: ric
    version: 1.0.0
  modules:
  - name: test1
    version: 2020-11-18
    file: test1@2020-11-18.yang
  files:
    test1@2020-11-18.yang: |
      module test1 {
        namespace "http://opennetworking.org/oran/test1";
        prefix t1;

        organization
          "Open Networking Foundation.";
        contact
          "Adib Rastegarnia";
        description
          "To generate JSON from this use command
           pyang -f jtoxx test1.yang | python3 -m json.tool > test1.json
           Copied from YangUIComponents project";

        revision 2020-11-18 {
          description
            "Extended with new attributes on leaf2d, list2b";
          reference
            "RFC 6087";
        }

        container cont1a {
          description
            "The top level container";
          leaf leaf1a {
            type string {
              length "1..80";
            }
            description
              "display name to use in GUI or CLI";
          }
          leaf leaf2a {
            type string {
              length "1..255";
            }
            description
              "user plane name";
          }
        }
      }

Directories

Path Synopsis
cmd
admission-init command
app-operator command
config-operator command
topo-operator command
pkg
apis/config/v1beta1
Package v1beta1 contains API Schema definitions for the cloud v1beta3 API group
Package v1beta1 contains API Schema definitions for the cloud v1beta3 API group
apis/topo/v1beta1
Package v1beta1 contains API Schema definitions for the cloud v1beta3 API group
Package v1beta1 contains API Schema definitions for the cloud v1beta3 API group
clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/config/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/config/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/versioned/typed/topo/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/topo/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL