https://github.com/davidzisky/kloud3s
Deploys VMs + k3s cluster + cloud controllers
https://github.com/davidzisky/kloud3s
digitalocean gcp k3s kubernetes kubernetes-deployment
Last synced: 3 months ago
JSON representation
Deploys VMs + k3s cluster + cloud controllers
- Host: GitHub
- URL: https://github.com/davidzisky/kloud3s
- Owner: DavidZisky
- License: gpl-3.0
- Created: 2019-08-05T08:39:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-09T09:36:30.000Z (almost 3 years ago)
- Last Synced: 2023-03-09T00:51:18.235Z (over 2 years ago)
- Topics: digitalocean, gcp, k3s, kubernetes, kubernetes-deployment
- Language: Shell
- Homepage:
- Size: 760 KB
- Stars: 69
- Watchers: 4
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Kloud3s
K3S Cluster Deployer. Simple bash script which spins up VMs in GCP/DigitalOcean, installs [k3s](https://k3s.io/) on them and downloads `kubeconfig`.
Perfect for POCs and other testing whenever you need a real (instead of `minikube` or `kind`) K8s cluster quickly.
## Getting Started
Please follow the instructions below depending on the cloud provider you want to use.
### DigitalOcean
#### PrerequisitesFor DigitalOcean, the only thing you need is token ([How to get token](https://www.digitalocean.com/docs/api/create-personal-access-token/)) and ssh key fingerprints. DigitalOcean CLI is not required. Simply paste your token on line 7:
```
# Paste your DO token below
do_api_token=""
```
And ssh key fingerprint (you can get it from the "Security" menu on your DigitalOcean account) in both JSON files in DigitalOcean folder. Feel free to change droplet size, region, whatever according to your needs.```
"ssh_keys": ["8b:f9:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"],
```#### Usage
If you wish not to overwrite your existing `kubeconfig` (which script does by default), set `load_kube_config` to false (line 9 in k3s_deployer.sh)
Simply execute
```
./k3s_deployer.sh
```On DigitalOcean process takes around 2 minutes.
### Google Cloud
#### PrerequisitesIn order to use 60sk3s with Google Cloud, you need to have `gcloud` CLI installed ([How to do it](https://cloud.google.com/sdk/docs/quickstarts)) and preferably default zone and project set. You can do that by executing:
```
gcloud auth login
gcloud config set compute/region europe-west4-agcloud config set core/project my-project
```
It also assumes that you have your ssh key added to project metadata (therefore it's loaded into every VM you spin up in that project). If you don't, then you can either do that ([How-to](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys)) or provide you ssh key in the script itself. For that, you need to uncomment and fill lines 43 and 54 in GCP/deploy.shJust keep in mind that you need to put it in format `username:your_ssh_key`. So if You do `$cat your_id_rsa.pub` at the end there will be something like john@host, so then your metadata parameter should look like:
```
--metadata=ssh-keys="john:ssh-rsa AAAAB3Nz[...]ktk/HB3 john@host" \
```#### Usage
Execute:
```
./deployer.sh [cluster_name]
```To destroy the cluster:
```
./deployer.sh [cluster_name] delete
```On Google Cloud process takes less than 60 seconds.
### Contributing
Simply raise a GitHub issue or send a PR.
### License
This project is licensed under the GPL-3.0 license - see the [LICENSE.md](LICENSE.md) file for details