Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runlevel5/kubernetes-cluster-libvirt-vagrant
A simple way to bring up a K8S with libvirt/vagrant for learning purpose
https://github.com/runlevel5/kubernetes-cluster-libvirt-vagrant
Last synced: 2 months ago
JSON representation
A simple way to bring up a K8S with libvirt/vagrant for learning purpose
- Host: GitHub
- URL: https://github.com/runlevel5/kubernetes-cluster-libvirt-vagrant
- Owner: runlevel5
- Created: 2020-03-30T13:11:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T02:54:42.000Z (over 4 years ago)
- Last Synced: 2024-10-13T17:51:44.253Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 1.89 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Kubernetes Cluster with libvirt/kvm
Have you just picked up k8s? Well firstly you should look into `minikube` if you
are after a simple one-node cluster for learning.If you fail to get minikube to work on your machine, you could set up a local
cluster with libvirt. DO NOT USE it for production.This cluster consists of 1 master and 2 worker nodes that are configured with:
* CRI: containerd
* CNI: calico
* SMI: none### Prerequisites
* Linux (amd64|ppc64le|arm64)
* qemu
* vagrant
* vagrant-libvirt### Get started
1. Orchestrate cluster:
```
cd [alpine|ubuntu] && vagrant up
```4. Verify that you could ssh into either master or worker:
```
vagrant ssh kmaster
vagrant ssh kworker1
vagrant ssh kworker2
```5. Check the health of the cluster:
```
vagrant ssh kmaster
kubectl cluster-info
kubectl get cs # should show everything healthy
```6. Setting up connection to cluster from your host:
```
vagrant ssh-config >> ~/.ssh/config
scp kmaster:/home/ubuntu/.kube/config ~/.kube/
config
kubectl cluster-info
```### Issues
If Vagrant gets stuck at "waiting to get IP address" part, it is likely that libvirt VM fail to assign IP address.
The workaround is to Ctrl-C to cancel the operation, then `vagrant destroy && vagrant up` again.### Credits
Codes are based on:
* https://github.com/osuosl/packer-templates
* https://github.com/justmeandopensource/kubernetes