Skip to content

yanet-platform/yanet-operator

Repository files navigation

yanet-operator

Docker Hub GitHub Container Registry Helm Chart

Kubernetes operator for managing YANET (Yet Another Network) deployments on worker nodes.

Features

  • πŸ”„ Automated Deployment Management β€” Creates and updates Deployments based on Yanet CRD specs
  • 🎯 Per-Node Deployment β€” One deployment per worker node with node affinity
  • πŸ” Auto-Discovery β€” Automatically discovers and manages Yanet instances
  • πŸ“Š Status Conditions β€” Ready, Synced, and Progressing conditions
  • 🧹 Graceful Cleanup β€” Finalizers ensure proper resource cleanup
  • πŸ“ Kubernetes Events β€” Audit trail for all operator actions
  • βœ… Validation Webhooks β€” Admission control for Yanet and YanetConfig resources
  • πŸ“ˆ Prometheus Metrics β€” Reconciliation metrics and resource monitoring
  • πŸ§ͺ 93.2% Test Coverage β€” Comprehensive unit and integration tests
  • πŸš€ CI/CD Ready β€” GitHub Actions for testing and publishing

Quick Start

Installation via Helm (Recommended)

# Install from Docker Hub OCI registry
helm install yanet-operator \
  oci://registry-1.docker.io/yanetplatform/yanet-operator \
  --version 0.1.5 \
  --namespace yanet-system \
  --create-namespace

# Or install from GitHub Container Registry
helm install yanet-operator \
  oci://ghcr.io/yanet-platform/yanet-operator \
  --version 0.1.5 \
  --namespace yanet-system \
  --create-namespace

Installation via kubectl

# Apply CRDs and operator deployment
kubectl apply -f https://github.com/yanet-platform/yanet-operator/releases/latest/download/install.yaml

Usage

Create a Yanet instance

apiVersion: yanet.yanet-platform.io/v1alpha1
kind: Yanet
metadata:
  name: yanet-worker-01
spec:
  nodeName: worker-01
  type: release
  dataplane:
    enable: true
    image: yanetplatform/yanet-dataplane
    tag: latest
  controlplane:
    enable: true
    image: yanetplatform/yanet-controlplane
    tag: latest
kubectl apply -f yanet-instance.yaml

Configure global settings

apiVersion: yanet.yanet-platform.io/v1alpha1
kind: YanetConfig
metadata:
  name: yanet-config
spec:
  updateWindow: 300
  autoDiscovery:
    enable: true
    namespace: default

Documentation

Development

Prerequisites

  • Go 1.26.2+
  • Docker
  • kubectl
  • Helm 3+
  • Kind (for local testing)

Getting Started

You'll need a Kubernetes cluster to run against. You can use KIND to get a local cluster for testing, or run against a remote cluster.

Note: Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster kubectl cluster-info shows).

Build and Run Locally

# Run tests
make test

# Run tests with race detector
make test-race

# Run tests in Docker (no local Go required)
make test-docker

# Build binary
make build

# Run locally (against current kubeconfig context)
make run

Build and Push Docker Image

# Build image
make docker-build IMG=yanetplatform/yanet-operator:v0.1.5

# Push to Docker Hub
make docker-push IMG=yanetplatform/yanet-operator:v0.1.5

Deploy to Cluster

# Install CRDs
make install

# Deploy operator
make deploy IMG=yanetplatform/yanet-operator:v0.1.5

# Create sample resources
kubectl apply -f config/samples/

Update Helm Chart

# 1. Update CRDs (if API changed)
make manifests
./bin/kustomize build config/crd > deploy/charts/yanet-operator/crds/yanet.yaml

# 2. Update RBAC (if permissions changed)
make manifests
./bin/kustomize build config/rbac/ | sed 's/system/{{ .Values.namespace }}/g' > deploy/charts/yanet-operator/templates/rbac.yaml

# 3. Update version in Chart.yaml
# Edit deploy/charts/yanet-operator/Chart.yaml

# 4. Test chart locally
helm lint deploy/charts/yanet-operator
helm template test deploy/charts/yanet-operator

# 5. Create git tag to trigger publishing
git tag v0.1.5
git push origin v0.1.5

Note: GitHub Actions will automatically build and publish Docker images and Helm charts when you push a version tag.

Uninstall CRDs

To delete the CRDs from the cluster:

make uninstall

Undeploy controller

UnDeploy the controller from the cluster:

make undeploy

How it works

This project aims to follow the Kubernetes Operator pattern.

It uses Controllers, which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

Test It Out

  1. Install the CRDs into the cluster:
make install
  1. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
make run

NOTE: You can also run this in one step by running: make install run

Modifying the API definitions

If you are editing the API definitions, generate the manifests such as CRs or CRDs using:

make manifests

NOTE: Run make help for more information on all potential make targets

CI/CD

The project uses GitHub Actions for automated testing and publishing:

  • Tests β€” Run on every push and PR
  • Docker Images β€” Published to Docker Hub and GHCR on version tags
  • Helm Charts β€” Published to OCI registries on version tags

See GITHUB_ACTIONS_DOCKER.md for setup instructions.

Contributing

See CONTRIBUTING.md for contribution guidelines.

Resources

License

Copyright 2023-2026 YANDEX LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

yanet operator for k8s

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages