Giter VIP home page Giter VIP logo

kubefire's Introduction

What is KubeFire? πŸ”₯

KubeFire is to create and manage Kubernetes clusters running on FireCracker microVMs via weaveworks/ignite.

  • Uses independent rootfs and kernel from OCI images instead of traditional VM images like qcow2, vhd, etc
  • Uses containerd to manage Firecracker processes
  • Have different cluster bootstappers to provision Kubernetes clusters like Kubeadm, K3s, RKE2, and K0s
  • Supports deploying clusters on different architectures like x86_64/AMD64 and ARM64/AARCH64 (ex: K3s, RKE2, K0s)

kubefire in action

Getting Started

Installing KubeFire

For official releases, please install the latest release via the below command or use huber

curl -sfSL https://raw.githubusercontent.com/innobead/kubefire/master/hack/install-release-kubefire.sh | bash

or

huber install kubefire

For development purpose, please make sure go 1.14 installed, then build and install kubefire in the GOBIN path.

make install

Quickstart

Running below commands is to quickly have a cluster deployed by kubeadm running in minutes.

kubefire install
kubefire cluster create demo

Installing or Updating Prerequisites

To be able to run kubefire commands w/o issues like node/cluster management, there are some prerequisites to have. Please run kubefire install command with root permission (or sudo without password) to install or update these prerequisites via the below steps.

  • Check virtualization supported
  • Install necessary components including runc, containerd, CNI plugins, and Ignite. See below minimum required versions of components
    • RuncVersion >= v1.1.3
    • ContainerdVersion >= v1.6.6
    • CniVersion >= v1.1.1
    • IgniteVersion >= v0.10.0

Notes:

  • To uninstall the prerequisites, run kubefire uninstall.
  • To check the installation status, run kubefire info.

asciicast

Bootstrapping Cluster

Bootstrapping with command options, or a declarative config file

cluster create provides detailed options to configure the cluster, but it also provides --config to accept a cluster configuration file to bootstrap the cluster as below commands.

With command options

❯ kubefire cluster create -h
Creates cluster

Usage:
  kubefire cluster create [name] [flags]

Flags:
  -b, --bootstrapper string    Bootstrapper type, options: [kubeadm, k3s, rke2, k0s] (default "kubeadm")
  -c, --config string          Cluster configuration file (ex: use 'config-template' command to generate the default cluster config)
  -o, --extra-options string   Extra options (ex: key=value,...) for bootstrapper
  -f, --force                  Force to recreate if the cluster exists
  -h, --help                   help for create
  -i, --image string           Rootfs container image (default "ghcr.io/innobead/kubefire-opensuse-leap:15.2")
      --kernel-args string     Kernel arguments (default "console=ttyS0 reboot=k panic=1 pci=off ip=dhcp security=apparmor apparmor=1")
      --kernel-image string    Kernel container image (default "ghcr.io/innobead/kubefire-ignite-kernel:4.19.125-amd64")
      --master-count int       Count of master node (default 1)
      --master-cpu int         CPUs of master node (default 2)
      --master-memory string   Memory of master node (default "2GB")
      --master-size string     Disk size of master node (default "10GB")
      --no-cache               Forget caches
      --no-start               Don't start nodes
  -k, --pubkey string          Public key
  -v, --version string         Version of Kubernetes supported by bootstrapper (ex: v1.18, v1.18.8, empty)
      --worker-count int       Count of worker node
      --worker-cpu int         CPUs of worker node (default 2)
      --worker-memory string   Memory of worker node (default "2GB")
      --worker-size string     Disk size of worker node (default "10GB")

Global Flags:
  -l, --log-level string   log level, options: [panic, fatal, error, warning, info, debug, trace] (default "info")

With declarative config file

# Geneate a cluster template configuration, then update the config as per your needs
❯ kubefire cluster config-template > cluster.yaml

❯ cat cluster.yaml   
name: ""
bootstrapper: kubeadm
pubkey: ""
prikey: ""
version: ""
image: ghcr.io/innobead/kubefire-opensuse-leap:15.2
kernel_image: ghcr.io/innobead/kubefire-ignite-kernel:4.19.125-amd64
kernel_args: console=ttyS0 reboot=k panic=1 pci=off ip=dhcp security=apparmor apparmor=1
extra_options: {}
deployed: false
master:
  count: 1
  memory: 2GB
  cpus: 2
  disk_size: 10GB
worker:
  count: 0
  memory: 2GB
  cpus: 2
  disk_size: 10GB

# Create a cluster with the config file
❯ kubeifre cluster create demo --config=cluster.yaml

Bootstrapping with selectable Kubernetes versions

# Create a cluster with the latest versions w/o any specified version
❯ kubefire cluster create demo

# Create a cluster with the latest patch version of v1.18
❯ kubefire cluster create demo --version=v1.18

# Create a cluster with a valid specific version v1.18.8
❯ kubefire cluster create demo --version=v1.18.8

# Create a cluster with the latest patch version of supported minor releases
❯ kubefire cluster create demo --version=v1.17
❯ kubefire cluster create demo --version=v1.16

# If the version is outside the supported versions (last 3 minor versions given the latest is v1.18), the cluster creation will be not supported 
❯ kubefire cluster create demo --version=v1.15

Bootstrapping with Kubeadm

Supports the latest supported version and last 3 minor versions.

❯ kubefire cluster create demo --bootstrapper=kubeadm

Add extra Kubeadm deployment options

To add extra deployment options of the control plane components, use --extra-options of cluster create command to provide init_options, api_server_options, controller_manager_options or scheduler_options key-value pairs as the below example.

Note: the key-value pairs in --extra-options are separated by comma.

  • Add extra options of kubeadm init into init_options='<option>,...'.
  • Add extra options of API Server into api_server_options='<option>,...'.
  • Add extra options of Controller Manager into controller_manager_options='<option>,...'.
  • Add extra options of Scheduler into scheduler_options='<option>,...'.
❯ kubefire cluster create demo --bootstrapper=kubeadm --extra-options="init_options='--service-dns-domain=yourcluster.local' api_server_options='--audit-log-maxage=10'"

asciicast

Bootstrapping with K3s

Supports the latest supported version and last 3 minor versions.

Please note that K3s only officially supports Ubuntu 16.04 and 18.04, the kernel versions of which are 4.4 and 4.15. Therefore, if using the prebuilt kernels, please use 4.19 (which is the default kernel used) instead of 5.4, otherwise there will be some unexpected errors happening. For rootfs, it's no problem to use other non-Ubuntu images.

❯ kubefire cluster create demo --bootstrapper=k3s

Bootstrapping with K3s on ARM64

From 0.3.0, it's able to deploy K3s cluster on ARM64 architecture.

Notes: K3s supported only, and Kubeadm will be planned to support in the future.

asciicast

Add extra K3s deployment options

To add extra deployment options of the server or agent nodes, use --extra-options of cluster create command to provide server_install_options or agent_install_options key-value pairs as the below example.

Note: the key-value pairs in --extra-options are separated by a comma.

  • Add extra options of k3s server into server_install_options='<k3s server option>,...'.
  • Add extra options of k3s agent into agent_install_options='<k3s agent option>,...'.
❯ kubefire cluster create demo --bootstrapper=k3s --extra-options="server_install_options='--disable=traefik,--disable=metrics-server'"

asciicast

Bootstrapping with RKE2

❯ kubefire cluster create demo --bootstrapper=rke2

Add extra RKE2 deployment options

To add extra deployment options of the RKE2 cluster, use --extra-options of cluster create command to provide the below options as key-value pairs.

Note: the key-value pairs in --extra-options are separated by a comma.

  • Add extra options of rke2 server into server_install_options='<rke2 server option>,...'.
  • Add extra options of rke2 agent into agent_install_options='<rke2 agent option>,...'.
❯ kubefire cluster create demo --bootstrapper=rke2 --extra-options="server_install_options='--node-label=label1,--node-taint=key=value:NoSchedule'"

Bootstrapping with K0s

❯ kubefire cluster create demo --bootstrapper=k0s

Add extra K0s deployment options

To add extra deployment options of the K0s cluster, use --extra-options of cluster create command to provide the below options as key-value pairs.

Note: the key-value pairs in --extra-options are separated by a comma.

  • Add extra options of k0s server into server_install_options='<k0s server option>,...'
  • Add extra options of k0s worker into worker_install_options='<k0s worker option>,...'
  • Add cluster_config_file into cluster_config_file='<k0s customized cluster.yaml>,...'
❯ kubefire cluster create demo --bootstrapper=k0s --extra-options="server_install_options='--debug' cluster_config_file=/tmp/cluster.yaml"

Accessing Cluster

During bootstrapping, the cluster folder is created at ~/.kubefire/clusters/<cluster name>. After bootstrapping, there are several files generated in the folder.

  • admin.conf

    The kubeconfig, downloaded from one of master nodes

  • cluster.yaml

    The cluster config manifest is for creating the cluster. There is no declarative management based on it for now, but maybe it will be introduced in the future.

  • key, key.pub

    The private and public keys for SSH authentication to all nodes in the cluster.

There are two ways below to operate the deployed cluster. After having a valid KUBECONFIG setup, run kubectl commands as usual.

  1. run eval $(kubefire cluster env <cluster name>) to update KUBECONFIG pointing to ~/.kubefire/clusters/<cluster name>/admin.conf.
  2. run kubefire node ssh <master node name> to ssh to one of master nodes, then update KUBECONFIG pointing to /etc/kubernetes/admin.conf. For K3s, the kubeconfig is /etc/rancher/k3s/k3s.yaml instead.

Usage

CLI Commands

Make sure to run kubefire commands with root permission or sudo without password, because ignite needs root permission to manage Firecracker VMs for now, but it is planned to improve in the future release.

❯ kubefire -h
KubeFire, creates and manages Kubernetes clusters using FireCracker microVMs

Usage:
  kubefire [flags]
  kubefire [command]

Available Commands:
  cache       Manages caches
  cluster     Manages clusters
  help        Help about any command
  image       Shows supported RootFS and Kernel images
  info        Shows info of prerequisites, supported K8s/K3s versions
  install     Installs or updates prerequisites
  kubeconfig  Manages kubeconfig of clusters
  node        Manages nodes
  uninstall   Uninstalls prerequisites
  version     Shows version

Flags:
  -h, --help               help for kubefire
  -l, --log-level string   log level, options: [panic, fatal, error, warning, info, debug, trace] (default "info")
# Show version
❯ kubefire version

# Show supported RootFS and Kernel images
❯ kubefire image

# Show prerequisites information
❯ kubefire info

# Show supported K8s/K3s versions by builtin bootstrappers
❯ kubefire info -b

# Install or Update prerequisites
❯ kubefire install 

# Uninstall prerequisites
❯ kubefire uninstall

# Create a cluster
❯ kubefire cluster create

# Create a cluster w/ a selected version
❯ kubefire cluster create --version=[v<MAJOR>.<MINOR>.<PATCH> | v<MAJOR>.<MINOR>]

# Delete clusters
❯ kubefire cluster delete

# Show a cluster info
❯ kubefire cluster show

# Show a cluster config
❯ kubefire cluster config

# Create the default cluster config template
❯ kubefire cluster config-template

# Stop a cluster
❯ kubefire cluster stop

# Start a cluster
❯ kubefire cluster start

# Restart a cluster
❯ kubefire cluster restart

# List clusters
❯ kubefire cluster list

# Print environment variables of cluster (ex: KUBECONFIG)
❯ kubefire cluster env

# Print cluster kubeconfig
❯ kubefire kubeconfig show

# Download cluster kubeconfig
❯ kubefire kubeconfig download

# SSH to a node
❯ kubefire node ssh

# Show a node info
❯ kubefire node show

# Stop a node
❯ kubefire node stop

# Start a node
❯ kubefire node start

# Restart a node
❯ kubefire node restart

# Show cache info
❯ kubefire cache show

# Delete caches
❯ kubefire cache delete

Troubleshooting

If encountering any unexpected behavior like ignite can't allocate valid IPs to the created VMs. Please try to clean up the environment, then verify again. If the issues still cannot be resolved by environment cleanup, please help create issues.

kubefire unisntall
kubefire install

Supported Container Images for RootFS and Kernel

Besides below prebuilt images, you can also use the images provided by weaveworks/ignite.

RootFS images

  • ghcr.io/innobead/kubefire-opensuse-leap:15.3
  • ghcr.io/innobead/kubefire-sle15:15.3
  • ghcr.io/innobead/kubefire-rocky:8
  • ghcr.io/innobead/kubefire-centos:8
  • ghcr.io/innobead/kubefire-ubuntu:18.04, 20.04, 20.10

Kernel images (w/ AppArmor enabled)

  • ghcr.io/innobead/kubefire-ignite-kernel:5.4.43-amd64
  • ghcr.io/innobead/kubefire-ignite-kernel:4.19.125-amd64 (default)
  • ghcr.io/innobead/kubefire-ignite-kernel:5.4.43-arm64
  • ghcr.io/innobead/kubefire-ignite-kernel:4.19.125-arm64 (default)

References

kubefire's People

Contributors

dependabot[bot] avatar innobead avatar serjs avatar spurin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubefire's Issues

Support K0s deployment

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Update cilium to 1.9 for kubeadm bootstrapper

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support agnostic plain ssh deployment

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Unable to create a cluster with continuous K8s release

Describe the bug
Because K8s releases on github are not well sorted, need to have a way to sort to retrieve the correct versions of releases.

➜  Downloads kubefire cluster create demo --force
INFO[2020-10-16T03:16:09+08:00] getting the cri-tools release versions info less than/equal to v1.19.3  bootstrapper=kubeadm
INFO[2020-10-16T03:16:09+08:00] getting the latest kube release tool release version info  bootstrapper=kubeadm
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6bc7b7]

goroutine 1 [running]:
github.com/innobead/kubefire/pkg/config.(*LocalConfigManager).SaveBootstrapperVersions(0xdf3cc0, 0x0, 0x0, 0xc0000a0240, 0x3, 0x4, 0x7, 0x4)
        /home/davidko/github/innobead/kubefire/pkg/config/local.go:125 +0x37
github.com/innobead/kubefire/pkg/bootstrap.GenerateSaveBootstrapperVersions(0xa0f08f, 0x7, 0x7fce083aa2f8, 0xdf3cc0, 0x7fce3052a048, 0xc0000ba620, 0xc0000ba601, 0x199, 0x5, 0x4, ...)
        /home/davidko/github/innobead/kubefire/pkg/bootstrap/bootstrapper.go:135 +0x7e2
github.com/innobead/kubefire/cmd/kubefire/cmd/cluster.glob..func6(0xdb80a0, 0xc000121820, 0x1, 0x2, 0x0, 0x0)
        /home/davidko/github/innobead/kubefire/cmd/kubefire/cmd/cluster/create.go:58 +0x11d
github.com/spf13/cobra.(*Command).execute(0xdb80a0, 0xc000121800, 0x2, 0x2, 0xdb80a0, 0xc000121800)
        /home/davidko/go/pkg/mod/github.com/spf13/[email protected]/command.go:831 +0x530
github.com/spf13/cobra.(*Command).ExecuteC(0xdba2c0, 0xc00017bf18, 0x1, 0x1)
        /home/davidko/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/davidko/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main()
        /home/davidko/github/innobead/kubefire/cmd/kubefire/kubefire.go:72 +0x13f

To Reproduce
Steps to reproduce the behavior with debug log enabled. --log-level=debug

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
    • run kubefire version
  • Kubefire runtime info
    • run kubefire info

Additional context
Add any other context about the problem here.

Always deployed the cluster with latest selected K8s minor version even using a specific old version

Describe the bug
kubefire cluster create demo --version=1.17.12, but the cluster actually deployed with 1.17.13.

To Reproduce
Steps to reproduce the behavior with debug log enabled. --log-level=debug

Expected behavior
The cluster should be deployed with the valid version, 1.17.12 instead of the latest minor version.

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
    • run kubefire version
  • Kubefire runtime info
    • run kubefire info

Additional context
Add any other context about the problem here.

Add clean cache command

Is your feature request related to a problem? Please describe.
Sometimes, you get something running incorrectly and would like to clean up ignite cache like imported images like #32 . It's better to have a command to clean up.

Describe the solution you'd like
The clean cache command like uninstall but focus on deleting clusters and ignite caches.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Update ignite 0.8.0

Is your feature request related to a problem? Please describe.
https://github.com/weaveworks/ignite/releases/tag/v0.8.0

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Can't deploy 1.19.1 via kubeadm

Describe the bug
There is an error happening when figuring out the supported versions.

To Reproduce

kubefire cluster create --bootstrapper=kubeadm

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
➜ kubefire version
Version: v0.2.0
Build: 1a747b0-20200827025425
  • Kubefire runtime info
➜  kubefire info                     
CONTAINERD	IGNITE	CNI   	RUNC      	CNIPLUGIN                 
v1.4.0    	v0.7.1	v0.8.6	1.0.0-rc92	0.4.0/kubefire-cni-bridge

Additional context
Add any other context about the problem here.

Support cluseter semver w/ prerelease

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add image command to show supported rootfs/kernel images

Is your feature request related to a problem? Please describe.
Having a command to show supported images instead of documentation.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Import local container images to the cluster

Is your feature request related to a problem? Please describe.
For development purposes, it will be helpful to bring the locally built container image to the cluster container runtime engines of specific nodes.

Describe the solution you'd like
By using containerd export/import function to achieve.

Support scaling up the nodes of cluster

Is your feature request related to a problem? Please describe.
There are no ways to scale the deployed cluster.

Describe the solution you'd like
Have a command to scale out the cluster.

kubefire install failed with unable to install script install-prerequisites.sh: exit status 1

Describe the bug
Prerequisites installation failed

To Reproduce

  1. Install kubefire curl -sfSL https://raw.githubusercontent.com/innobead/kubefire/master/hack/install-release-kubefire.sh | bash
  2. Run kubefire install --log-level=debug

Expected behavior
I expected to not have error when command execution ends

Environment

  • OS version
    • run cat /etc/os-release
cat /etc/os-release
NAME="Zorin OS"
VERSION="16"
ID=zorin
ID_LIKE=ubuntu
PRETTY_NAME="Zorin OS 16"
VERSION_ID="16"
HOME_URL="https://zorin.com/os/"
SUPPORT_URL="https://zorin.com/help/"
BUG_REPORT_URL="https://zorin.com/os/feedback/"
PRIVACY_POLICY_URL="https://zorin.com/legal/privacy/"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • Kubefire version
    • run kubefire version
Version: v0.3.6
Build: 9413383-20210502190639
  • Kubefire runtime info
    • run kubefire info
CONTAINERD         	IGNITE             	CNI                	RUNC                   	CNIPLUGIN                              
 (expected: v1.4.4)	 (expected: v0.9.0)	 (expected: v0.9.1)	 (expected: 1.0.0-rc93)	 (expected: 0.4.0/kubefire-cni-bridge)

Additional context
image

Thanks in advance for your help

Can't provision K3s agent node

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior with debug log enabled. --log-level=debug

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
    • run kubefire version
  • Kubefire runtime info
    • run kubefire info

Additional context
Add any other context about the problem here.

Support default selective addons to install

Is your feature request related to a problem? Please describe.
Having default selective addons installation will help people when doing development or testing.

Describe the solution you'd like

  • Default addons like ingress controller (traefki), storage classes (local), service mesh (likerd), dashboard (default or octant), registry, load balancer (metallb), data protection (velero), observablity stack (logging, monitoring, tracing), gitops (flux), progressive delivery (flagger), etc.
  • Helm chart with kustomize support

Describe alternatives you've considered
N/A

Additional context
N/A

Support downloading adaptive kubectl for clusters

Is your feature request related to a problem? Please describe.
It's easy to use the correct compatible CLI client to access the deployed clusters of different versions

Describe the solution you'd like

kubefire cluster exec --runtime=<kubectl | k9s> --shell=/usr/bin/zsh

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Failed to establish a connection with cluster after creation

It was working just fine but after my computer lost power while I had a cluster running I am unable to start subsequent clusters.

➜  ~ kubefire cluster create --bootstrapper=kubeadm demo
INFO[2020-08-03T14:29:06+02:00] initializing cluster configuration            cluster=demo
INFO[2020-08-03T14:29:06+02:00] saving cluster configurations                 cluster=demo
INFO[2020-08-03T14:29:06+02:00] creating cluster (demo)                      
INFO[2020-08-03T14:29:06+02:00] creating master nodes of cluster (demo)      
INFO[2020-08-03T14:29:06+02:00] creating node (demo-master-1)                
[sudo] password for rugwiro: 
INFO[0015] Created VM with ID "fcff98a0b99793bb" and name "demo-master-1" 
INFO[0028] Networking is handled by "cni"               
INFO[0028] Started Firecracker VM "fcff98a0b99793bb" in a container with ID "ignite-fcff98a0b99793bb" 
INFO[2020-08-03T14:29:45+02:00] waiting nodes of cluster (demo) are running  
INFO[2020-08-03T14:29:45+02:00] initializing cluster (demo)                  
INFO[2020-08-03T14:29:45+02:00] waiting all nodes initialization finished    
INFO[2020-08-03T14:29:47+02:00] bootstrapping the first master node (demo-master-1) 
Usage:
............

FATA[2020-08-03T14:29:47+02:00] failed to run kubefire                        error="failed to deploy cluster (demo): dial tcp :22: connect: connection refused"

Support multiple hosts deployment

The current version only supports single-host deployment, but in some cases, people are looking for having multiple hosts to bootstrap a large cluster for the purposes of resilience and fault tolerance.

Add 'cluster config-template' command to generate the default cluster configuration

Is your feature request related to a problem? Please describe.
Have a command to generate the default cluster configuration for the declarative cluster configuration purpose.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support declarative configuration to deploy cluster

Is your feature request related to a problem? Please describe.
The current way to deploy a cluster is using command options. There is no declarative way to do that.

Describe the solution you'd like
Have a new option of kubefire create to support deploy by a declarative configuration file. ex: kubefire create --config=<file>

Have cluster running after the nodes restart

For now, after stopping the VMs, there are no ways to restart the VMs w/ the same configured IPs and still make the cluster running w/o issues.

Look for a solution to make cluster management during node state change.

Support the public transient DNS for a cluster for development purpose

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Create a installer script to automatically install the latest kubefire version

Is your feature request related to a problem? Please describe.
The below current way is only support installing the specific version.

curl -LO https://github.com/innobead/kubefire/releases/download/v0.1.0/kubefire && chmod +x kubefire && sudo mv kubefire /usr/local/bin 

Describe the solution you'd like

curl -LO https://raw.githubusercontent.com/innobead/kubefire/master/installer.sh | sudo sh -

Support updating installed prerequisites

Is your feature request related to a problem? Please describe.
There is no way to update installed prerequisites except uninstall and install again.

Describe the solution you'd like
Have an option or new command to support prerequisites update. ex: kubefire install --update or kubefire update

Add ubuntu:20.04 LTS image

Is your feature request related to a problem? Please describe.
ref: https://ubuntu.com/about/release-cycle

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Update containerd (1.4.3) and runc (1.0.0-rc93)

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support running on aarch64 arch

Is your feature request related to a problem? Please describe.
Support using kubefire on aarch64 arch.

Describe the solution you'd like

  • have rootfs images for aarch64
  • have kernel images for aarch64
  • install dependent components for aarch64 (ex: containerd, runc, cni plugins, firecracker prepared by ignite)
    • install-prerequisites.sh
    • uninstall-prerequisites.sh
  • only allow to use k3s bootstrapper for aarch64

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Remove admin node support

Is your feature request related to a problem? Please describe.
There are no meaningful reasons to keep admin node management, suggest to remove.

Describe the solution you'd like
Remove --admin-* from cluster create command, but make sure no side effect causing any existing clusters.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support selective Kubernetes version to create different versions of clusters

Is your feature request related to a problem? Please describe.
For development/testing purposes, sometimes we need to install different versions of Kubernetes.

Describe the solution you'd like
Except for a specific supported cycle version of the release, it should have a better user experience w/o extra kubefire downloads.

Describe alternatives you've considered
N/A

Additional context
N/A

Support bottlerocket?

Is your feature request related to a problem? Please describe.
To see if it's possible to use bottlerocket as rootfs, but need to understand how to do the host change and authentication. Maybe this needs relying on the following versions of Ignite.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support deployment proxy to cache artifacts

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support RKE2 for development purpose

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support volume mounts

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support k3s correct version parsing

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Kubefire can't connect to ignite vm

➜  ~  kubefire cluster create --bootstrapper=kubeadm openfaas                 
INFO[2020-07-31T10:58:40+02:00] initializing cluster configuration            cluster=openfaas
INFO[2020-07-31T10:58:40+02:00] saving cluster configurations                 cluster=openfaas
INFO[2020-07-31T10:58:40+02:00] creating cluster (openfaas)                  
INFO[2020-07-31T10:58:40+02:00] creating master nodes of cluster (openfaas)  
INFO[2020-07-31T10:58:40+02:00] creating node (openfaas-master-1)            
INFO[0014] Created VM with ID "b59cb57875bd2743" and name "openfaas-master-1" 
ERRO[0017] failed to setup network for namespace "ignite-b59cb57875bd2743": unable to allocate IP address: Post http://127.0.0.1:6784/ip/ignite-b59cb57875bd2743: dial tcp 127.0.0.1:6784: connect: connection refused 
FATA[0017] unable to allocate IP address: Post http://127.0.0.1:6784/ip/ignite-b59cb57875bd2743: dial tcp 127.0.0.1:6784: connect: connection refused 
ERRO[2020-07-31T10:58:58+02:00] failed to create node (openfaas-master-1)     error="exit status 1"
INFO[2020-07-31T10:58:58+02:00] waiting nodes of cluster (openfaas) are running

I previously had an old ignite installation so I thought it maybe a compatibility issue and so I uninstalled it and let kubefire install do the work. Perhaps it's the CNI plugin cause uninstalling ignite doesn't seem to remove it. Here its a part of kubefire install:

+ TMP_DIR=/tmp/kubefire
++ go env GOARCH
++ echo amd64
+ GOARCH=amd64
+ CONTAINERD_VERSION=v1.3.4
+ IGNITE_VERION=v0.7.1
+ CNI_VERSION=v0.8.6
+ RUNC_VERSION=v1.0.0-rc91
+ mkdir -p /tmp/kubefire

Update containerd to 1.4.1 and CNI plugins 0.8.7

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Move pre-builtin rootfs and kernel OCI images to github container registry

Is your feature request related to a problem? Please describe.
Because of the latest docker hub usage policy change, moving the builtin container images to github container registry to avoid any surprise.

Describe the solution you'd like
Integrate building container images in github action pipeline, then deliver to the github container registry.

Add complete node/cluster management commands

Is your feature request related to a problem? Please describe.
Have complete commands to start/stop/restart node/cluster.

Describe the solution you'd like

kubefire node start/stop/restart
kubefire cluster restart

Support customized kubeadm control plane configurations

Is your feature request related to a problem? Please describe.
There is no way to customize the cluster configurations when deploying with kubeadm.

Describe the solution you'd like
Being able to provision a cluster w/ customized kubeadm configs including control planes and kubelet.

Describe alternatives you've considered
N/A

Additional context
N/A

Bootstrapping k3s does not work

Describe the bug

When trying to bootstrap a k3s cluster, it ends up with a panic (goroutine)

To Reproduce

Execute command

kubefire cluster create demo --bootstrapper=k3s -v v1.22 -l trace

Output:

DEBU[2021-12-29T19:49:13Z]       di.go:46   github.com/innobead/kubefire/internal/di.DelayInit() initializing dependency injection system
DEBU[2021-12-29T19:49:13Z]       di.go:119  github.com/innobead/kubefire/internal/di.DelayInit() completed dependency injection system
DEBU[2021-12-29T19:49:13Z]       di.go:42   github.com/innobead/kubefire/internal/di.DelayInit() forcibly reinitializing dependency injection system
DEBU[2021-12-29T19:49:13Z]       di.go:119  github.com/innobead/kubefire/internal/di.DelayInit() completed dependency injection system
DEBU[2021-12-29T19:49:13Z]      k3s.go:69   github.com/innobead/kubefire/pkg/bootstrap/versionfinder.(*K3sVersionFinder).GetLatestVersion() getting the latest released version info      bootstrapper=k3s
DEBU[2021-12-29T19:49:13Z]      k3s.go:28   github.com/innobead/kubefire/pkg/bootstrap/versionfinder.(*K3sVersionFinder).GetVersionsAfterVersion() getting the released versions info            bootstrapper=k3s
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/innobead/kubefire/pkg/bootstrap/versionfinder.(*K3sVersionFinder).GetVersionsAfterVersion(0xc00009cbd0, 0xa0434e, 0x1, 0xa11817, 0x2, 0xa04352, 0x1, 0x0, 0x0, 0xc00053a1d8, ...)
	/home/runner/work/kubefire/kubefire/pkg/bootstrap/versionfinder/k3s.go:47 +0x6e6
github.com/innobead/kubefire/pkg/bootstrap.GenerateSaveBootstrapperVersions(0x7fff3a3c97cb, 0x3, 0x7f6d106203f8, 0xdbfaa8, 0x4, 0x199, 0x9aa560, 0xc0000c65a0, 0x9342e0, 0xc0000c65a0, ...)
	/home/runner/work/kubefire/kubefire/pkg/bootstrap/bootstrapper.go:91 +0x2d5
github.com/innobead/kubefire/cmd/kubefire/cmd/cluster.glob..func6(0xd86460, 0xc000136e40, 0x1, 0x6, 0x0, 0x0)
	/home/runner/work/kubefire/kubefire/cmd/kubefire/cmd/cluster/create.go:61 +0x14a
github.com/spf13/cobra.(*Command).execute(0xd86460, 0xc000136de0, 0x6, 0x6, 0xd86460, 0xc000136de0)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:831 +0x523
github.com/spf13/cobra.(*Command).ExecuteC(0xd88680, 0xc00017df18, 0x1, 0x1)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main()
	/home/runner/work/kubefire/kubefire/cmd/kubefire/kubefire.go:73 +0x13f

or

kubefire cluster create demo --bootstrapper=k3s -l trace

Output:

DEBU[2021-12-29T19:53:03Z]       di.go:46   github.com/innobead/kubefire/internal/di.DelayInit() initializing dependency injection system
DEBU[2021-12-29T19:53:03Z]       di.go:119  github.com/innobead/kubefire/internal/di.DelayInit() completed dependency injection system
DEBU[2021-12-29T19:53:03Z]       di.go:42   github.com/innobead/kubefire/internal/di.DelayInit() forcibly reinitializing dependency injection system
DEBU[2021-12-29T19:53:03Z]       di.go:119  github.com/innobead/kubefire/internal/di.DelayInit() completed dependency injection system
DEBU[2021-12-29T19:53:03Z]      k3s.go:69   github.com/innobead/kubefire/pkg/bootstrap/versionfinder.(*K3sVersionFinder).GetLatestVersion() getting the latest released version info      bootstrapper=k3s
DEBU[2021-12-29T19:53:04Z]      k3s.go:28   github.com/innobead/kubefire/pkg/bootstrap/versionfinder.(*K3sVersionFinder).GetVersionsAfterVersion() getting the released versions info            bootstrapper=k3s
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/innobead/kubefire/pkg/bootstrap/versionfinder.(*K3sVersionFinder).GetVersionsAfterVersion(0xc0001eaac0, 0xa0434e, 0x1, 0xa11817, 0x2, 0xa04352, 0x1, 0x0, 0x0, 0xc0000fe0f8, ...)
	/home/runner/work/kubefire/kubefire/pkg/bootstrap/versionfinder/k3s.go:47 +0x6e6
github.com/innobead/kubefire/pkg/bootstrap.GenerateSaveBootstrapperVersions(0x7ffc906fc7d4, 0x3, 0x7f9a6cd3e4e8, 0xdbfaa8, 0x4, 0x199, 0x9aa560, 0xc0001d74a0, 0x9342e0, 0xc0001d74a0, ...)
	/home/runner/work/kubefire/kubefire/pkg/bootstrap/bootstrapper.go:91 +0x2d5
github.com/innobead/kubefire/cmd/kubefire/cmd/cluster.glob..func6(0xd86460, 0xc000166e80, 0x1, 0x4, 0x0, 0x0)
	/home/runner/work/kubefire/kubefire/cmd/kubefire/cmd/cluster/create.go:61 +0x14a
github.com/spf13/cobra.(*Command).execute(0xd86460, 0xc000166e40, 0x4, 0x4, 0xd86460, 0xc000166e40)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:831 +0x523
github.com/spf13/cobra.(*Command).ExecuteC(0xd88680, 0xc00017df18, 0x1, 0x1)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main()
	/home/runner/work/kubefire/kubefire/cmd/kubefire/kubefire.go:73 +0x13f

Expected behavior

Cluster is provisioned using k3s as bootstrap

Environment

  • OS version
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • Kubefire version
Version: v0.3.6
Build: 9413383-20210502190639
  • Kubefire runtime info
CONTAINERD	IGNITE	CNI   	RUNC      	CNIPLUGIN
v1.4.4    	v0.9.0	v0.9.1	1.0.0-rc93	0.4.0/kubefire-cni-bridge

Update dependent binaries

Is your feature request related to a problem? Please describe.

ContainerdVersion := v1.4.4
IgniteVersion := v0.9.0
CniVersion := v0.9.1

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Support an intermediate solution to resolve duplicated IP allocation issue when nodes get stopped unexpectedly

Is your feature request related to a problem? Please describe.
The partial issue of #3 is about the fix merged in ignite, but it's not released yet.

Describe the solution you'd like
Come out another executable (kubefire-helper) to handle this disassociation between the stopped node and it's IP. Then, it will be used to fix this issue until the next version of ignite released which includes the fix.

Support RancherD deployment

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Bug: kubefire install messes with unit files

Describe the bug
I have recently come to realize that every time there is a new version and I do kubefire installl it modifies my containerd systemd configuration: /etc/systemd/system/containerd.service

Specifically the location of chgrp binary:

....
[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd
ExecStartPost=/usr/bin/chgrp containerd /run/containerd/containerd.sock
....

Running $ which chgrp on my system shows me mine is at /bin/chgrp. Thus on my next start up docker fails to start since it has been changed to usr/bin/chgrp:

 docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─hosts.conf
   Active: inactive (dead)
     Docs: https://docs.docker.com

Ukw 01 17:26:12 citronus systemd[1]: Dependency failed for Docker Application Container Engine.
Ukw 01 17:26:12 citronus systemd[1]: docker.service: Job docker.service/start failed with result 'dependency'.
Ukw 01 17:26:21 citronus systemd[1]: Dependency failed for Docker Application Container Engine.
Ukw 01 17:26:21 citronus systemd[1]: docker.service: Job docker.service/start failed with result 'dependency'.
Ukw 01 17:26:26 citronus systemd[1]: Dependency failed for Docker Application Container Engine.
Ukw 01 17:26:26 citronus systemd[1]: docker.service: Job docker.service/start failed with result 'dependency'.

To Reproduce
Run kubefire install on a system whose required binaries are not in the expected location.

Expected behavior
Should not modify the unit files without warning or approval

Environment

  • OS version
➜  ~ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

  • Kubefire version
➜  ~ kubefire version
Version: v0.3.0
Build: 344f34d-20200924143906

  • Kubefire runtime info
➜  ~ kubefire info
CONTAINERD	IGNITE	CNI   	RUNC      	CNIPLUGIN                 
v1.4.1    	v0.7.1	v0.8.7	1.0.0-rc92	0.4.0/kubefire-cni-bridge	

Additional context
My docker environment was installed via the official tutorial for Ubuntu system: https://docs.docker.com/engine/install/ubuntu/

Invalid version ctr tool used when deploying 1.19.0 with kubeadm

Describe the bug
1.19.0 just released. When deploying 1.19.0 for kubeadm, there will an invalid version of ctr tool got selected to cause deployment failed.

To Reproduce
kubefire cluster create demo --bootstrapper=kubeadm or kubefire info -b

Expected behavior
Work correctly

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
    • run kubefire version
  • Kubefire runtime info
    • run kubefire info

Additional context
N/A

Add RKE bootstrapper

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Failed to deploy the latest version (1.21) K3s cluster

Describe the bug

kubefire info -b encountered null exception because of incorrect K3s version parsing

To Reproduce
Steps to reproduce the behavior with debug log enabled. --log-level=debug

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
    • run kubefire version
  • Kubefire runtime info
    • run kubefire info

Additional context
Add any other context about the problem here.

Ubuntu rootfs image from ghcr has no systemd installed

Describe the bug
When using ghcr ubuntu rootfs image, nodes can not be booted successfully, and this is the day 1 issue.

[    1.105972] Freeing unused decrypted memory: 2040K
[    1.111372] Freeing unused kernel image memory: 1356K
[    1.125832] Write protecting the kernel read-only data: 14336k
[    1.130261] Freeing unused kernel image memory: 2020K
[    1.132682] Freeing unused kernel image memory: 524K
[    1.134148] Run /sbin/init as init process
[    1.136179] Run /etc/init as init process
[    1.137887] Run /bin/init as init process
[    1.139641] Run /bin/sh as init process
/bin/sh: 0: can't access tty; job control turned off
# [    6.128637] random: fast init done
[    9.414738] random: crng init done

To Reproduce
Steps to reproduce the behavior with debug log enabled. --log-level=debug

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS version
    • run cat /etc/os-release
  • Kubefire version
    • run kubefire version
  • Kubefire runtime info
    • run kubefire info

Additional context
Add any other context about the problem here.

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.