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: about 1 year 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T02:54:42.000Z (almost 6 years ago)
- Last Synced: 2025-04-12T09:19:48.743Z (about 1 year ago)
- Language: Shell
- Homepage:
- Size: 1.89 MB
- Stars: 4
- Watchers: 1
- 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