Skip to content

cisco-open/cisco-virtual-kubelet

Cisco Virtual Kubelet Provider

Go Version License

A Virtual Kubelet provider that enables Kubernetes to schedule container workloads on Cisco Catalyst series switches and other IOS-XE devices with App-Hosting capabilities.

Overview

This provider allows Kubernetes pods to be deployed as containers directly on Cisco devices, enabling edge computing scenarios where compute workloads run on network infrastructure. The provider communicates with Cisco devices via RESTCONF APIs to manage the container lifecycle.

Key Features

  • Native Kubernetes Integration: Deploy containers to Cisco devices using standard kubectl commands
  • Driver-Based Architecture: Extensible driver pattern currently supporting IOS-XE devices
  • Full Lifecycle Management: Create, monitor, and delete containers via RESTCONF
  • Health Monitoring: Continuous node health checks and status reporting
  • Resource Management: CPU, memory, and storage allocation per container
  • Flexible Networking: Support both DHCP IP allocation via Virtual Port Groups or AppGigabitEthernet
  • DHCP Integration: Automatic IP discovery from device operational data or ARP tables

Supported Devices

  • Cisco Catalyst 8000V virtual routers
  • Cisco Catalyst 9000 switches

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Kubernetes Cluster                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                   Kubernetes API Server                  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                              β”‚                                 β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚              β–Ό               β–Ό               β–Ό                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  VK Provider    β”‚ β”‚  VK Provider    β”‚ β”‚  VK Provider    β”‚   β”‚
β”‚  β”‚  (Device 1)     β”‚ β”‚  (Device 2)     β”‚ β”‚  (Device N)     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚ RESTCONF          β”‚ RESTCONF          β”‚ RESTCONF
            β–Ό                   β–Ό                   β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Cisco IOS-XE β”‚   β”‚  Cisco IOS-XE β”‚   β”‚  Cisco IOS-XE β”‚
    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
    β”‚  β”‚Containerβ”‚  β”‚   β”‚  β”‚Containerβ”‚  β”‚   β”‚  β”‚Containerβ”‚  β”‚
    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

Prerequisites

  • A Kubernetes cluster
  • helm v3
  • Cisco IOS-XE device with:
    • IOx enabled (iox configuration)
    • RESTCONF enabled
    • App-hosting support
    • Container image (tar file) on device flash

Controller Deployment (Kubernetes)

The controller watches CiscoDevice CRs and automatically creates a VK pod per device. Deploy it via the included Helm chart.

Build and push a custom image

# Build
docker build -t <your-registry>/cisco-vk:latest .

# Push
docker push <your-registry>/cisco-vk:latest

Install the Helm chart

# Install CRDs and the controller into the cvk-system namespace
helm install cvk ./charts/cisco-virtual-kubelet \
  --namespace cvk-system --create-namespace \
  --set image.repository=<your-registry>/cisco-vk \
  --set image.tag=latest

Both the controller pod and the VK pods it spawns use the same image by default. To use different images:

helm install cvk ./charts/cisco-virtual-kubelet \
  --namespace cvk-system --create-namespace \
  --set controllerImage.repository=<your-registry>/cisco-vk-controller \
  --set controllerImage.tag=latest \
  --set vkImage.repository=<your-registry>/cisco-vk \
  --set vkImage.tag=latest

Create a CiscoDevice CR

Once the controller is running, create a CiscoDevice resource to provision a VK node:

apiVersion: cisco.vk/v1alpha1
kind: CiscoDevice
metadata:
  name: cat9000-1
  namespace: default
spec:
  driver: XE
  address: "192.168.1.100"
  port: 443
  username: admin
  password: cisco123
  tls:
    enabled: true
    insecureSkipVerify: true
  xe:
    networking:
      interface:
        type: VirtualPortGroup
        virtualPortGroup:
          dhcp: true
          interface: "0"
          guestInterface: 0

The controller will create a VK deployment and a matching Kubernetes node. Pods scheduled to that node are deployed to the device via AppHosting.

Documentation

Project Structure

cisco-virtual-kubelet/
β”œβ”€β”€ api/
β”‚   └── v1alpha1/               # CRD API types (DeviceSpec, CiscoDevice)
β”œβ”€β”€ cmd/
β”‚   └── cisco-vk/               # Unified binary entry point
β”‚       β”œβ”€β”€ main.go             # cobra root command
β”‚       β”œβ”€β”€ run.go              # 'run' subcommand β€” standalone VK provider
β”‚       └── manager.go          # 'manager' subcommand β€” CRD controller manager
β”œβ”€β”€ charts/
β”‚   └── cisco-virtual-kubelet/  # Helm chart for controller deployment
β”‚       β”œβ”€β”€ crds/               # CRD (synced from config/crd by make generate)
β”‚       └── templates/          # RBAC, Deployment (role.yaml auto-generated)
β”œβ”€β”€ config/
β”‚   └── crd/                    # Generated CRDs (source of truth for make generate)
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ config/                 # YAML/viper config loader
β”‚   β”œβ”€β”€ controller/             # CiscoDevice reconciler (+kubebuilder:rbac markers)
β”‚   β”œβ”€β”€ provider/               # Virtual Kubelet provider implementation
β”‚   └── drivers/                # Device driver implementations (XE, fake)
β”œβ”€β”€ examples/
β”œβ”€β”€ dev/                        # Development configs and test resources
β”œβ”€β”€ docs/
β”œβ”€β”€ Makefile
β”œβ”€β”€ go.mod
└── README.md

Development

For local development and testing, the VK provider can be run directly against a cluster without deploying it to Kubernetes.

Prerequisites

  • Go 1.23 or later

Build and run locally

make build

cisco-vk run \
  --config dev/deviceConfig.yaml \
  --kubeconfig ~/.kube/config \
  --nodename my-test-node

The device config file follows the same schema as the CiscoDevice CR spec. See examples for interface/networking options.

Runtime flags:

Flag Env Var Default Description
--nodename VKUBELET_NODE_NAME cisco-virtual-kubelet Kubernetes node name
--config / -c - /etc/virtual-kubelet/config.yaml Path to device config file
--kubeconfig KUBECONFIG (in-cluster) Path to kubeconfig file
--log-level LOG_LEVEL info Log level: debug, info, warn, error

Regenerate RBAC and CRDs

# Regenerates CRDs β†’ config/crd, RBAC β†’ chart templates, syncs CRDs into chart
make generate

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Support

Acknowledgments

About

Production-ready Virtual Kubelet provider for Cisco devices with Application Hosting capabilities.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors