dmpavlidis / K8sFuzzKit

Provisioning automatically a full Kubernetes Cluster on Hyper-V with Helm and Tiller, Kubernetes Dashboard and several external tools in only one click !

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

K8sFuzzKit : a new tool to deploy a full Kubernetes Cluster with embed external tools in Hyper-V in only one click !

ScreenShot

There are multiple guides on running Kubernetes and there is a lot of solutions to deploy a Kubernetes Cluster On-Premise (Kubespray, Kops, MiniKube, etc ...).

K8sFuzzKit is a new way to deploy a full Kubernetes Cluster in only "one mouse click".

But not only ...

  • You will decide the size of your Kubernetes Cluster (how many total nodes ?). K8sFuzzKit will define for you how many managers and workers nodes the tool will automatically deploy and configure for you.

Example : 3 total nodes will be convert to 1 manager node and 2 worker nodes. 5 total nodes will be convert to 2 managers nodes and 3 worker nodes. etc ...

  • K8sFuzzKit will deploy and configure a full Kubernetes Cluster in Hyper-V for you. You have only to define the configuration of each VM (name of the VM, vCPU, RAM) and, the information of your internal virtual switch like the name, the address @IP plage, etc ... (which will be automatically nat with the nic of the host to be able to go to internet). Your Cluster Kubernetes will always have the latest version of CentOS up to date (yum update), the latest version of Kubernetes and dependencies (like kubelet, dockerd, cni, ...)

  • The full installation and configuration Helm and Tiller, the cluster-side service, will be automatically done for you ! In a secured approach ...

  • You can easy activate the installation of an external tools to complete your Kubernetes Cluster installation like an external secret and configuration management service (vault, consul), a service mesh (istio, gloo, linkerd), a serverless service/framework (openfaas, kubeless, openwhisk), a CD/CI service (Jenkins-x) and more tools in the next release (Stay tuned !)

  • Your laptop/desktop will be automatically configure to use your Kubernetes Cluster matching your parameters (command kubectl for example) and all the external tools (istioctl, jx the CLI of Jenkins-X, etc ...). Cool, isn't it ?

  • A browser will be automatically open at the end of the Kubernetes Cluster deployment and you have only to paste the authentication token (RBAC) which have been automatically generated and copy to the clipboard for you ! Cool, isn't it ?

To perform all this K8sFuzzKit configuration and tasks, you have only to update a json file (K8sFuzzKit.json) and execute the Powershell Script called Install-K8sFuzzKit.ps1. THAT'S ALL !

K8sFuzzKit - Setup requirements

  • Hyper-V installed
Install-WindowsFeature -Name Hyper-V -ComputerName <computer_name> -IncludeManagementTools -Restart  
  • Severals tools installed on your laptop/desktop
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install vagrant --version 2.0.2
vagrant plugin install vagrant-reload
choco install kubernetes-cli
choco install kubernetes-helm

K8sFuzzKit - Configure your Kubernetes Cluster and external tools by editing the K8sFuzzKit.json file

Edit this json file :

  • hyper-v node : define the configuration of each VM machine (vCPU, RAM, root name of your VM in Hyper-V, name of the vSwitch, the Subnet Mask and the @IP of the first node in your Kubernetes Cluster) ;

  • vagrant node : each VM machine in Hyper-V will mount a CIFS/SMB Share with the host (your laptop/desktop). You have to define a Windows account (in preference an Administrator account but not mandatory. The Windows account have to reach a folder called shared which will create on the root folder) ;

  • kubernetes node : define the total of nodes you want for your Kubernetes Cluster, the intra-network pod type and the CIDR network (the K8sFuzzKit support only Flannel type on this actual version)

  • external-tools node : true = deploy, false = bypass (notice that the dictionary of services will grow and enable in the next version of the tool)

{
    "K8sFuzzKit": {
        "debug": false,
        "hyper-v": {
            "K8sFuzzKit_VM_CPU": 2,
            "K8sFuzzKit_VM_MEM": 3072,
            "K8sFuzzKit_VM_NAME": "K8sFuzzKit",
            "K8sFuzzKit_VM_VSWITCH": "internal_vSwitch_K8sFuzzKit",
            "K8sFuzzKit_VM_BASE_SUBNET": "10.1.100.",
            "K8sFuzzKit_VM_BASE_IPADDRESS": "10.1.100.200"
        },
        "vagrant": {
            "K8sFuzzKit_OS_IMAGE": "centos/7",
            "K8sFuzzKit_SMB_USERNAME": "vagrantsmb",
            "K8sFuzzKit_SMB_PASSWORD": "24K8sKit09!1",
            "K8sFuzzKit_VM_SSH_PASSWORD": "#K8sFuzzKit#"
        },
        "kubernetes": { 
            "number-nodes-cluster": 3,
            "dns-cluster-add-on" : true,
            "kubernetes-tls" : true,
            "pod-network-add-on" : {
                    "network-type": "Flannel",
                    "network-CIDR": "10.244.0.0/16"
            }
         },
        "external-tools": {
            "vault": false,
            "consul": false,
            "private-registry": false,
            "jenkins-x": true,
            "services-kubernetes-add-one": {
                "service-mesh" : {
                    "istio": true,
		    "gloo": false,
                    "linkerd": false                    
                },
                "serverless" : {
                    "openfaas": false,
                    "kubeless": false,
                    "openwhisk": false
                } 
            }
        }
    }   
}

K8sFuzzKit - Run the Powershell script called Install-K8sFuzzKit.ps1

  • Hyper-V result after the deployment of K8sFuzzKit tool and according the K8sFuzzKit.json configuration :

ScreenShot

  • You can paste the Kubernetes Dashboard Token (this token is write in a file called shared\token_dashboard.log and his content is automatically copy to the clipboard for you) :

ScreenShot

  • You can notice that all is up and running ... and green :o) :

ScreenShot

ScreenShot

  • You can use the CLI kubectl to manage your Kubernetes Cluster. K8sFuzzKit tool will automatically configure your laptop/desktop for you ! If there is already a folder called .kube in your Windows profile folder, K8sFuzzKit tool will backup for you !

ScreenShot

  • K8sFuzzKit will automatically install and configure Helm and Tiller for you in a secured approach.

ScreenShot

K8sFuzzKit - Stop and Start your Kubernetes Cluster

  • If you run a vagrant halt to stop all the VM machines or you have power off them with the Hyper-V options, only run the Powershell Script called Start-K8sFuzzKit.ps1 to start your K8sFuzzKit Kubernetes Cluster.

K8sFuzzKit - Feedback and Pull Requests are of course welcome !

If you have some improvements, bug fixes, some new tricks, just post a new PR. If you have questions or issues, open an issue for discussion.

About

Provisioning automatically a full Kubernetes Cluster on Hyper-V with Helm and Tiller, Kubernetes Dashboard and several external tools in only one click !

License:MIT License


Languages

Language:PowerShell 73.6%Language:Ruby 26.4%