Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

---
version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
cooldown:
default-days: 7
3 changes: 3 additions & 0 deletions .github/linters/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
skip-framework:
- cloudformation
skip-path:
Expand All @@ -7,3 +8,5 @@ skip-path:
- x/webhook
- x/wire
- init_wait
- "third_party/meshnet/tests/.*"
- "third_party/meshnet/manifests/.*"
3 changes: 3 additions & 0 deletions .github/linters/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = *.pdf,*.png,*.jpg,*.gif,*.ico,go.sum
ignore-words-list = notin,NotIn
1 change: 1 addition & 0 deletions .github/linters/.gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ title = "gitleaks config"
paths = [
'''^\.?gitleaks.toml$''',
'''topo/node/srl/generate_certificate_success$''', # exclude dummy test file with random cert
'''x/webhook/manifests/tls\.secret\.yaml$''',
'''(.*?)super-linter.log$''', # exclude linter logs which might contain past errored runs with keys/certs
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''',
'''(go.mod|go.sum)$'''
Expand Down
50 changes: 47 additions & 3 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
---
version: "2"

issues:
new-from-rev: origin/main
linters:
enable:
- gocritic
- gosec
- revive
- unconvert
- unparam
- wastedassign
- whitespace
settings:
errcheck:
check-blank: true
gocritic:
disabled-checks:
- singleCaseSwitch
- appendAssign
revive:
severity: warning
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- dupl
- goconst
- gosec
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- \.pb\.go
4 changes: 3 additions & 1 deletion .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
default: true
extends: markdownlint/style/prettier

MD001: false # header levels

MD013: false # line length

MD028: false # blank lines between indents

MD033: false # inline HTML
MD033: false # inline HTML
1 change: 1 addition & 0 deletions .github/linters/.protolintrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
lint:
rules:
remove: # TODO: fix proto files and remove these.
Expand Down
1 change: 1 addition & 0 deletions .github/linters/trivy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
scan:
skip-dirs:
- manifests
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,23 @@ jobs:
permissions:
contents: read
packages: read

meshnet:
name: Meshnet Go Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26"
- name: Install dependencies
run: sudo apt-get install -y libpcap-dev
- name: Run Go tests
working-directory: ./third_party/meshnet
run: make test
49 changes: 49 additions & 0 deletions .github/workflows/meshnet-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Meshnet E2E

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions: {}

jobs:
e2e:
name: E2E (${{ matrix.link }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
link: [vxlan, grpc]
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Build e2e test env
working-directory: ./third_party/meshnet
run: make up
- name: Build docker image
working-directory: ./third_party/meshnet
run: make docker
- name: Install meshnet (${{ matrix.link }})
working-directory: ./third_party/meshnet
run: |
if [ "${{ matrix.link }}" = "grpc" ]; then
make grpc=1 install
else
make install
fi
- name: Run tests
working-directory: ./third_party/meshnet
run: make e2e
103 changes: 52 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,51 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/openconfig/kne)](https://goreportcard.com/report/github.com/openconfig/kne)
[![GoDoc](https://godoc.org/istio.io/istio?status.svg)](https://pkg.go.dev/github.com/openconfig/kne)
[![License: BSD](https://img.shields.io/badge/license-Apache%202-blue)](https://opensource.org/licenses/Apache-2.0)
[![GitHub Super-Linter](https://github.com/openconfig/kne/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![Coverage Status](https://coveralls.io/repos/github/openconfig/kne/badge.svg?branch=main)](https://coveralls.io/github/openconfig/kne?branch=main)

This is not an officially supported Google product.

## Goal

For network emulation, there are many approaches using VM's for emulation of a
hardware router. Arista, Cisco, Juniper, Drivenets, and Nokia have multiple implementations
of their network operating system and various generations of hardware emulation.
These systems are very good for most validation of vendor control plane
implementations and data plane for limited certifications. The idea of this
project is to provide a standard "interface" so that vendors can produce a
standard container implementation which can be used to build complex topologies.

* Have standard lifecycle management infrastructure for allowing multiple vendor
device emulations to be present in a single "topology"
* Allow for control plane access via standard k8s networking
* Provide a common networking interface for the forwarding plane between network
pods.
* Data plane wires between pods
* Control plane wires between topology manager
* Define service implementation for allowing interaction with the topology
hardware router. Arista, Cisco, Juniper, Drivenets, and Nokia have multiple
implementations of their network operating system and various generations of
hardware emulation. These systems are very good for most validation of vendor
control plane implementations and data plane for limited certifications. The
idea of this project is to provide a standard "interface" so that vendors can
produce a standard container implementation which can be used to build complex
topologies.

- Have standard lifecycle management infrastructure for allowing multiple
vendor device emulations to be present in a single "topology"
- Allow for control plane access via standard k8s networking
- Provide a common networking interface for the forwarding plane between
network pods.
- Data plane wires between pods
- Control plane wires between topology manager
- Define service implementation for allowing interaction with the topology
manager service.
* Topology manager is the public API for allowing external users to manipulate
the link state in the topology.
* The topology manager will run as a service in k8s environment.
* It will provide a gRPC interface for tests to interact with
* It will listen to CRDs published via the network device pods for discovery
* Data plane connections for connectivity between pods must be a public
- Topology manager is the public API for allowing external users to
manipulate the link state in the topology.
- The topology manager will run as a service in k8s environment.
- It will provide a gRPC interface for tests to interact with
- It will listen to CRDs published via the network device pods for
discovery
- Data plane connections for connectivity between pods must be a public
transport mechanism
* This can't be implemented as just exposing "x eth devices on the pod"
because Linux doesn't understand the associated control messages which are
needed to make this work like a wire.
* Transceiver state, optical characteristics, wire state, packet filtering /
shaping / drops
* LACP or other port aggregation protocols or APS cannot be simulated
- This can't be implemented as just exposing "x eth devices on the pod"
because Linux doesn't understand the associated control messages which
are needed to make this work like a wire.
- Transceiver state, optical characteristics, wire state, packet filtering
/ shaping / drops
- LACP or other port aggregation protocols or APS cannot be simulated
correctly
* The topology manager will start a topology agent on each host for the pod to
directly interact with.
* The topology agent will provide the connectivity between nodes
* Define how pods boot an initial configuration
* Ideally, this method would allow for dynamic
* Define how pods express services for use in-cluster as well as external
- The topology manager will start a topology agent on each host for the
pod to directly interact with.
- The topology agent will provide the connectivity between nodes
- Define how pods boot an initial configuration
- Ideally, this method would allow for dynamic
- Define how pods express services for use in-cluster as well as external
services

## Use Cases
Expand Down Expand Up @@ -88,23 +89,23 @@ Kubernetes Network Emulation (KNE).

### Usage Metrics Reporting

The KNE CLI optionally collects anonymous usage metrics. **This is turned OFF
by default.** We use the metrics to gauge the health and performance of various
KNE operations (i.e. cluster deployment, topology creation) on an **opt-in**
basis. There is a global flag `--report_usage` that when provided shares
anonymous details about certain KNE CLI commands. Collected data can be seen in
the [event proto definition](proto/event.proto). **Usage metrics are NOT shared
by default.** Additionally the PubSub project and topic the events are published
to are configurable. If you want to track your own private metrics about your
KNE usage then that is supported by providing a Cloud PubSub project/topic of
your choosing. Full details about how/when usage events are published can be
found in the codebase [here](metrics/metrics.go). We appreciate usage metric
reporting as it helps us develop a better KNE experience for all of our users.
Whether that be detecting an abnormally high number of cluster deployment
failures due to an upgrade to an underlying dependency introduced by a new
commit, or detecting a bug from a scenario where the failure rate for topologies
over *n* links is far greater than *n-1* links. Usage metric reporting is
helpful tool for the KNE developers.
The KNE CLI optionally collects anonymous usage metrics. **This is turned OFF by
default.** We use the metrics to gauge the health and performance of various KNE
operations (i.e. cluster deployment, topology creation) on an **opt-in** basis.
There is a global flag `--report_usage` that when provided shares anonymous
details about certain KNE CLI commands. Collected data can be seen in the
[event proto definition](proto/event.proto). **Usage metrics are NOT shared by
default.** Additionally the PubSub project and topic the events are published to
are configurable. If you want to track your own private metrics about your KNE
usage then that is supported by providing a Cloud PubSub project/topic of your
choosing. Full details about how/when usage events are published can be found in
the [codebase](metrics/metrics.go). We appreciate usage metric reporting as it
helps us develop a better KNE experience for all of our users. Whether that be
detecting an abnormally high number of cluster deployment failures due to an
upgrade to an underlying dependency introduced by a new commit, or detecting a
bug from a scenario where the failure rate for topologies over _n_ links is far
greater than _n-1_ links. Usage metric reporting is helpful tool for the KNE
developers.

## Thanks

Expand Down
10 changes: 7 additions & 3 deletions api/metallb/clientset/v1beta1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ var (
)

func init() {
metallbv1.AddToScheme(Scheme)
if err := metallbv1.AddToScheme(Scheme); err != nil {
panic(err)
}

metav1.AddToGroupVersion(Scheme, groupVersion)
metav1.AddMetaToScheme(Scheme)
if err := metav1.AddMetaToScheme(Scheme); err != nil {
panic(err)
}
}

func GV() *schema.GroupVersion {
Expand All @@ -105,7 +109,7 @@ func GV() *schema.GroupVersion {
// NewForConfig returns a new Clientset based on c.
func NewForConfig(c *rest.Config) (*Clientset, error) {
config := *c
config.ContentConfig.GroupVersion = &groupVersion
config.GroupVersion = &groupVersion
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.UserAgent = rest.DefaultKubernetesUserAgent()
Expand Down
Loading
Loading