• Stars
    star
    241
  • Rank 167,643 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Project Neco

GitHub release CircleCI GoDoc Go Report Card

neco logo

Neco is a project to build and maintain highly automated on-premise data centers using Kubernetes at the center of its system. The project is led by a CNCF Silver member Cybozu which is also known as Kintone in the United States.

Neco is also the name of the architecture for systems built on the deliverables of the project.

Please read about Project Neco: Building Cloud Native On-Premise Data Centers.

Table of Contents:

Resources

Blogs

Repositories

The project consists of a lot of repositories including:

System overview

necosystem

A Neco data center consists of a few (from 3 to 5) management servers called boot sever and thousands of servers for a Kubernetes cluster; pretty big, huh? In fact, Neco is designed to manage such large clusters.

Boot servers

Boot servers are symmetrical with each other except for host names and IP addresses.

All persistent data are stored in an etcd cluster. Thanks to etcd, adding or removing a boot server can be done easily.

Sabakan is a network boot server that supports DHCP and HTTP. It can also manage an inventory of Node servers and assign IP addresses automatically. Node servers should use UEFI HTTP boot to load Flatcar from sabakan.

CKE, or Cybozu Kubernetes Engines, is a CNCF certified Kubernetes installer. It queries Node server status to Sabakan and chooses Nodes to construct Kubernetes control plane and worker nodes. TLS certificates required for Kubernetes are issued by Vault.

Boot servers are set up using a custom Ubuntu installer. installer directory contains the tools to build the custom installer.

Neco Continuous Delivery System (Neco CD)

To bootstrap and maintain boot servers, a simple continuous delivery system called Neco CD is implemented in this repository.

Neco CD consists of these programs and artifacts:

  • neco-updater: a daemon to watch GitHub and notify neco-worker of new artifacts.
  • neco-worker: a daemon to install/update programs on a boot server.
  • neco: CLI tool to bootstrap and configure boot servers.
  • Neco debian package: archive of program binaries to be installed on boot servers.

Debian packages are built by CircleCI and released on GitHub releases.

Read docs/cicd.md for details.

Kubernetes

A Kubernetes cluster created with CKE is a vanilla installation; it almost has nothing useful.

We have selected a set of applications such as MetalLB, Calico, or Teleport to make the vanilla Kubernetes fully featured. The manifests of the applications are maintained in neco-apps repository and continuously delivered by Argo CD.

Network

Design

Network of Neco is designed with these goals:

  • Bare-metal performance, i.e., no overlays like VXLAN
  • Scalability, especially for east-west traffic
  • Vendor neutrality

The data center network for Neco should employ leaf-spine topology. More specifically, each data center rack works as an autonomous system (AS) and exchanges routes with BGP.

Since BGP is a layer-3 routing protocol, use of layer-2 can be limited within a single rack.

leaf-spine

Node BGP and redundancy

Kubernetes nodes need to route packets for Pods. Without overlay networking, this means that each node needs to advertise routing information. In Neco, each node runs BIRD to speak BGP and advertise routes for Pods.

For high availability, network links must be redundant. Therefore, Neco requires that each rack has two Top-of-Rack (ToR) switches and each server has two ethernet links. To reduce convergence time of BGP, BFD is used together.

This means that ToR switches and node servers in a rack are all BGP speakers and need to connect each other as iBGP peers. To make configurations simple and flexible, ToR switches are configured as route reflectors.

The two ToR switches are independent; each has its own managing subnet. As a result, each server has two IP addresses for each ToR switch. To tolerate single link or ToR switch failure, the server has another IP address called the node address with /32 netmask and advertises it via BGP.

iBGP

DHCP and location of boot servers

UEFI HTTP Boot requires a DHCP server which requires layer-2 broadcast domain. Without DHCP relay servers, a dedicated server must be run as a boot server for each rack because layer-2 domain does not span racks.

If ToR switches can provide DHCP relay, this requirement can be relaxed.

Tests

Virtual data center

To make continuous delivery reliable enough, thorough and comprehensive system tests need to be performed. Since Neco is the system to bootstrap and maintain an on-premise data center, this means that the tests should do the same thing, that is, to bootstrap and maintain a data center!

To simulate an on-premise data center, we have created placemat, a tool to construct a virtual data center using containers, virtual machines and Linux network stacks.

The virtual data center implements the aforementioned leaf-spine networks with BGP routers. To create the virtual data center, run the following commands on Ubuntu 22.04:

$ sudo curl -o /etc/apt/keyrings/docker-key.asc -fsSL https://download.docker.com/linux/ubuntu/gpg 
$ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker-key.asc] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt update
$ sudo apt install -y build-essential systemd-container lldpd qemu qemu-kvm socat picocom swtpm cloud-utils bird2 squid chrony dnsmasq jq freeipmi-tools unzip skopeo fakeroot docker-ce docker-ce-cli containerd.io
$ wget https://github.com/qemu/qemu/raw/master/pc-bios/bios.bin
$ wget https://github.com/qemu/qemu/raw/master/pc-bios/bios-256k.bin
$ sudo install -m 0644 -b bios.bin bios-256k.bin /usr/share/seabios/
$ wget https://github.com/cybozu-go/placemat/releases/download/v2.4.0/placemat2_2.4.0_amd64.deb
$ sudo dpkg -i ./placemat2_2.4.0_amd64.deb
$ git clone https://github.com/cybozu-go/neco
$ cd neco/dctest
$ make setup
$ make placemat
$ make test
  • To login a boot server in the virtual data center, run ./dcssh boot-0.
  • To stop and delete the virtual data center, run make stop.

The setup commands above are examined on a GCP VM based on the Ubuntu 22.04 disk image. Some more setup steps are needed for the GCP environment.

Large tests

dctest directory contains test suites to run large tests using the virtual data center. Details are described in docs/dctest.md.

Middle/Small tests

Other than large tests, this repository contains smaller tests that can be run as follows:

  1. Setup the environment by make setup. This is a one shot job.
  2. Run etcd by make start-etcd
  3. Run tests by go test -v -count 1 -race ./...
  4. Stop etcd by make stop-etcd

Directories

Other than Go packages, this repository has the following directories:

  • dctest/: Large tests using a virtual data center.
  • debian/: Ingredients for Debian package.
  • docs/: miscellaneous documentation.
  • etc/: Kubernetes manifests for networking and other configuration files.
  • ignitions/: Ignition template files.

More Repositories

1

transocks

Transparent SOCKS5 / HTTP proxy in Go
Go
465
star
2

moco

MySQL operator on Kubernetes using GTID-based semi-synchronous replication.
Go
246
star
3

cke

Cybozu Kubernetes Engine
Go
193
star
4

coil

CNI plugin for Kubernetes designed for scalability and extensibility
Go
164
star
5

usocksd

SOCKS4/5 server library and command in Go
Go
142
star
6

well

Go framework for well-behaving commands
Go
125
star
7

goma

An extensible monitoring agent in Go.
Go
124
star
8

aptutil

Go utilities for Debian APT repositories
Go
123
star
9

sabakan

A versatile network boot server for large data centers
Go
122
star
10

placemat

Virtual data center construction tool
Go
82
star
11

etcdpasswd

Distributed Linux user management using etcd
Go
46
star
12

accurate

Kubernetes controller for multi-tenancy. It propagates resources between namespaces accurately and allows tenant users to create/delete sub-namespaces.
Go
28
star
13

log

Logging framework for Cybozu Go products
Go
28
star
14

contour-plus

Enhance contour for external-dns and cert-manager
Go
25
star
15

meows

Kubernetes controller for GitHub actions self-hosted runners
Go
19
star
16

netutil

Add-ons for Go networking
Go
17
star
17

kkok

Alert routing and filtering service
Go
10
star
18

scim

generic SCIM server/client library in Go
Go
7
star
19

options

A small library that provides Option[T], which represents an optional value of type T
Go
5
star
20

cat-gate

A Kubernetes controller to delay pod deployment using scheduling gates
Go
5
star
21

setup-hw

Build container image to configure BMC and BIOS
Go
5
star
22

nginx-i2c

ip2country.conf generation tool for nginx
Go
4
star
23

scim-server

Go
4
star
24

pod-security-admission

A Kubernetes admission webhook to ensure pod security standards
Go
4
star
25

nyamber

Custom controllers to create Neco environment
Go
1
star
26

neco-template

Template repository for Neco
Makefile
1
star
27

neco-gcp

GCP management tools for project Neco
Go
1
star
28

necotiator

ResourceQuota Controller for soft multi-tenancy
Go
1
star
29

etcdutil

Add-ons for etcd
Go
1
star
30

cattage

Kubernetes controller that enhances the multi-tenancy of Argo CD with Accurate.
Go
1
star
31

tenet

Tenet is a Kubernetes controller that aims to facilitate setting-up Network Policies on tenant namespaces.
Go
1
star
32

necoperf

necoperf provides the ability to easily retrieve profiles of containers running on Kubernetes.
Go
1
star
33

zombie-detector

Go
1
star