• This repository has been archived on 25/Sep/2021
  • Stars
    star
    670
  • Rank 67,354 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated almost 4 years ago

Reviews

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

Repository Details

The hypervisor-based container runtime for Kubernetes.

Frakti

Build Status Go Report Card

The hypervisor-based container runtime for Kubernetes

Frakti lets Kubernetes run pods and containers directly inside hypervisors via runV. It is light weighted and portable, but can provide much stronger isolation with independent kernel than linux-namespace-based container runtimes.

Frakti serves as a CRI container runtime server. Its endpoint should be configured while starting kubelet. In the deployment, hyperd is also required as the API wrapper of runV.

QuickStart

Build frakti:

mkdir -p $GOPATH/src/k8s.io
git clone https://github.com/kubernetes/frakti.git $GOPATH/src/k8s.io/frakti
cd $GOPATH/src/k8s.io/frakti
make && make install

Install docker and hyperd:

apt-get install qemu libvirt0 docker.io -y
curl -sSL https://hypercontainer.io/install | bash

Configure hyperd with gRPC endpoint 127.0.0.1:22318:

cat >/etc/hyper/config <<EOF
# Boot kernel
Kernel=/var/lib/hyper/kernel
# Boot initrd
Initrd=/var/lib/hyper/hyper-initrd.img
# Storage driver for hyperd, valid value includes devicemapper, overlay, and aufs
StorageDriver=overlay
# Hypervisor to run containers and pods, valid values are: libvirt, qemu, kvm, xen
Hypervisor=qemu
# The tcp endpoint of gRPC API
gRPCHost=127.0.0.1:22318
EOF

systemctl restart hyperd

Setup CNI networking using bridge plugin

$ sudo mkdir -p /etc/cni/net.d  /opt/cni/bin
$ git clone https://github.com/containernetworking/plugins $GOPATH/src/github.com/containernetworking/plugins
$ cd $GOPATH/src/github.com/containernetworking/plugins
$ ./build.sh
$ sudo cp bin/* /opt/cni/bin/
$ sudo sh -c 'cat >/etc/cni/net.d/10-mynet.conflist <<-EOF
{
    "cniVersion": "0.3.1",
    "name": "mynet",
    "plugins": [
        {
            "type": "bridge",
            "bridge": "cni0",
            "isGateway": true,
            "ipMasq": true,
            "ipam": {
                "type": "host-local",
                "subnet": "10.30.0.0/16",
                "routes": [
                    { "dst": "0.0.0.0/0"   }
                ]
            }
        },
        {
            "type": "portmap",
            "capabilities": {"portMappings": true},
            "snat": true
        }
    ]
}
EOF'
$ sudo sh -c 'cat >/etc/cni/net.d/99-loopback.conf <<-EOF
{
    "cniVersion": "0.3.1",
    "type": "loopback"
}
EOF'

Then start frakti:

frakti --v=3 --logtostderr --listen=/var/run/frakti.sock --hyper-endpoint=127.0.0.1:22318 &

Finally, start kubernetes with frakti runtime:

cd $GOPATH/src/k8s.io/kubernetes
hack/install-etcd.sh
export PATH=$GOPATH/src/k8s.io/kubernetes/third_party/etcd:${PATH}
export KUBERNETES_PROVIDER=local
export CONTAINER_RUNTIME=remote
export CONTAINER_RUNTIME_ENDPOINT=/var/run/frakti.sock
hack/local-up-cluster.sh

To start using the cluster, open up another terminal and run:

cd $GOPATH/src/k8s.io/kubernetes
export KUBECONFIG=/var/run/kubernetes/admin.kubeconfig
cluster/kubectl.sh

Documentation

Further information could be found at:

The differences between frakti with other Linux container runtimes

  • Better Security and Isolation
    • frakti provides hardware virtualization based Pod sandbox for Kubernetes.
  • No Kernel Sharing
    • Every Pod in frakti has its own kernel (Bring Your Own Kernel), LinuxKit image support is on the way
  • Match k8s QoS Classes.
    • frakti is best to run Pod with resources.limits being set (i.e. all Guaranteed and most Burstable Pods), otherwise, frakti will set default resource limit for Pod.
    • This behavior is configurable by --defaultCPUNum and --defaultMemoryMB of frakti
  • Mixed Runtimes Mode.
    • frakti support mixed runtimes on the same Node (runV and Docker). We recommend user to run BestEffort Pods, daemon Pods in Docker runtime by adding runtime.frakti.alpha.kubernetes.io/OSContainer annotation to them.
    • Additionally, special cases like privileged Pods, host network Pods etc will be automatically run in Docker runtime.
  • Persistent Volume
    • All k8s PVs are supported in frakti.
    • Block device as volume directly: in this way, frakti will mount block device directly to VM based Pod, which gives you better performance than first approach, now we support:
      • Cinder RBD: Stackube for an example (k8s + frakti + Cinder + Keystone + Neutron).
      • GCE Persistent Disk
  • Cross-host Networking
    • frakti is fully based on CNI (bridge mode only for now), so there's no big difference here.
    • Network plug-ins like Flannel & Calico can work out-of-box with frakti based Kubernetes.

Besides the lists above, all behaviors of frakti are 100% the same with other Linux container runtimes like Docker, please enjoy it!

License

The work done has been licensed under Apache License 2.0.The license file can be found here. You can find out more about license at http://www.apache.org/licenses/LICENSE-2.0.

More Repositories

1

external-storage

[EOL] External storage plugins, provisioners, and helper libraries
Go
2,696
star
2

heapster

[EOL] Compute Resource Usage Analysis and Monitoring of Container Clusters
Go
2,626
star
3

kubefed

Kubernetes Cluster Federation
Go
2,484
star
4

contrib

[EOL] This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.
Go
2,467
star
5

bootkube

This project now lives at https://github.com/kinvolk/bootkube
Go
1,154
star
6

kube-aws

[EOL] A command-line tool to declaratively manage Kubernetes clusters on AWS
Go
1,130
star
7

kubeadm-dind-cluster

[EOL] A Kubernetes multi-node test cluster based on kubeadm
Shell
1,109
star
8

kube-batch

A batch scheduler of kubernetes for high performance workload, e.g. AI/ML, BigData, HPC
Go
1,065
star
9

service-catalog

Consume services in Kubernetes using the Open Service Broker API
Go
1,049
star
10

multi-tenancy

A working place for multi-tenancy related proposals and prototypes.
Go
950
star
11

kube-deploy

[EOL] A place for cluster deployment automation
Go
535
star
12

kubernetes-anywhere

[EOL] {concise,reliable,cross-platform} turnup of Kubernetes clusters
Shell
534
star
13

poseidon

[EOL] A Firmament-based Kubernetes scheduler
Go
409
star
14

kubernetes-bootcamp

[EOL] please see https://kubernetes.io/docs/tutorials/kubernetes-basics/ instead
JavaScript
268
star
15

cluster-registry

[EOL] Cluster Registry API
Go
237
star
16

kubernetes-docs-zh

[EOL] Chinese-language Kubernetes documentation
HTML
219
star
17

kubedash

[EOL] Analytics dashboard for Kubernetes
JavaScript
217
star
18

federation

[EOL] Cluster Federation
Go
209
star
19

kube-ui

[EOL] Deprecated Web UI for Kubernetes; please try dashboard instead
Go
150
star
20

drivers

[EOL] Example CSI Drivers
Go
139
star
21

rktlet

[EOL] The rkt implementation of the Kubernetes Container Runtime Interface
Go
138
star
22

kube-mesos-framework

[EOL] Kubernetes as a Mesos framework
HTML
108
star
23

minibroker

A minibroker for your minikube!
Go
89
star
24

csi-driver-image-populator

[EOL] CSI driver that uses a container image as a volume
Go
88
star
25

spartakus

[EOL] Anonymous Usage Collector
Go
75
star
26

nfs-provisioner

Go
71
star
27

cluster-api-bootstrap-provider-kubeadm

LEGACY REPO. NEW CODE IS https://github.com/kubernetes-sigs/cluster-api/tree/master/bootstrap/kubeadm
Go
62
star
28

go-open-service-broker-client

A golang client for service brokers implementing the Open Service Broker API
Go
60
star
29

cluster-api-provider-docker

A Cluster API Provider implementation using docker containers as the infra provider. Cluster API locally for a change!
Go
51
star
30

application-images

[EOL] Image build contents for Kubernetes applications.
Shell
48
star
31

kubernetes-docs-ko

[EOL] Korean-language Kubernetes documentation
HTML
34
star
32

testing_frameworks

[EOL] test frameworks for testing kubernetes
Go
34
star
33

csi-api

[EOL] CSIDriver CRD object
Go
23
star
34

mutating-trace-admission-controller

[EOL] a mutating admission controller which enables experimental tracing of kubernetes object lifecycle
Go
22
star
35

funding

Funding requests for project infrastructure, events, and consulting.
16
star
36

kubernetes-docs-ja

[EOL] Japanese-language Kubernetes documentation
HTML
16
star
37

k8s-gsm-tools

Controllers to sync and rotate kubernetes secrets with google secret manager
Go
14
star
38

contributor-tweets

Repo for automating tweets to the K8sContributor twitter account owned by the k8s Contributor Comms Team within SIG-contribex (https://github.com/kubernetes/community/tree/master/communication/contributor-comms)).
JavaScript
14
star
39

typescript

[EOL] see https://github.com/kubernetes-client/javascript instead
TypeScript
11
star
40

csi-driver-flex

[EOL] CSI Flexadapter driver and its build and dependent configuration files.
Shell
9
star
41

sig-usability

[EOL] SIG-Usability related docs and code
8
star
42

staging-noderesourcetopology-api

NodeResourceTopology API enables Topology aware scheduling in Kubernetes.
Shell
8
star
43

cosi-driver-minio

[EOL] Sample Driver that provides reference implementation for Container Object Storage Interface (COSI) API
Go
7
star
44

architecture-tracking

[EOL] Program management board for Kubernetes SIG-Architecture governed processes
7
star
45

csi-lib-fc

[EOL] A go package that can be imported to help CSI plugins with connecting to fibre channel devices
Go
6
star
46

csi-driver-fibre-channel

[EOL] Fibre Channel CSI Driver
Makefile
3
star
47

md-check

Go
2
star
48

kubernetes-csi-migration-library

[EOL] created due to https://github.com/kubernetes/org/issues/153
Go
1
star