Git Product home page Git Product logo

erikgb / accurate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cybozu-go/accurate

0.0 0.0 0.0 582 KB

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

Home Page: https://cybozu-go.github.io/accurate/

License: Apache License 2.0

Go 95.90% Makefile 3.28% Smarty 0.61% Dockerfile 0.21%

accurate's Introduction

GitHub release CI PkgGoDev Go Report Card

Accurate

Accurate is a Kubernetes controller for soft multi-tenancy environments.

Accurate resembles Hierarchical Namespace Controller (HNC). It propagates resources between namespaces and allows tenant users to create/delete sub-namespaces.

Features

  • Resource propagation between namespaces
    • Any namespace-scoped resource can be propagated.
    • Generated resources can be automatically checked and propagated.
  • Inheriting labels and annotations from parent namespaces
  • Template namespaces
  • SubNamespace custom resource for tenant users
  • kubectl plugin

Comparison to Hierarchical Namespace Controller (HNC)

Both Accurate and HNC aim the same goal -- to provide better namespace usability on soft multi-tenancy Kubernetes environments.

Accurate is more accurate than HNC in propagating resources because Accurate adopts an opt-in manner while HNC adopts an opt-out manner. With Accurate, only resources annotated with accurate.cybozu.com/propagate will be propagated. With HNC, all resources will be propagated except for ones that are specially annotated.

Suppose you want to propagate only a Secret for pulling private images. With HNC, this can be quite difficult because Secrets are often generated from another resource. Such generated Secrets are often not possible to have custom annotations. As a consequence, such Secrets would be propagated to sub-namespaces, which may cause security problems.

There are many other differences between Accurate and HNC. Please check them in the documentation.

Demo

Run and try Accurate on a kind (Kubernetes-In-Docker) cluster as follows:

  1. Prepare a Linux box running Docker.

  2. Checkout this repository.

    $ git clone https://github.com/cybozu-go/accurate
  3. Install aqua.

    https://aquaproj.github.io/docs/tutorial-basics/quick-start

  4. Go to e2e directory, setup shell variables, and execute make start.

    $ cd e2e
    $ PATH=$(cd ..; pwd)/bin:$PATH
    $ KUBECONFIG=$(pwd)/.kubeconfig
    $ export KUBECONFIG
    $ make start
  5. Create a root namespace and a sub-namespace using kubectl accurate.

    $ kubectl create ns root1
    $ kubectl accurate ns set-type root1 root
    $ kubectl accurate sub create sub1 root1
    $ kubectl accurate list
    $ kubectl accurate ns describe root1
    $ kubectl accurate ns describe sub1
  6. Create a Secret in root1 and see it will be propagated to sub1.

    $ kubectl -n root1 create secret generic s1 --from-literal=foo=bar
    $ kubectl -n root1 annotate secrets s1 accurate.cybozu.com/propagate=update
    $ sleep 1
    $ kubectl -n sub1 get secrets
  7. Stop the kind cluster.

    $ make stop

Documentation

Read the documentation at https://cybozu-go.github.io/accurate/ .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.