Skip to content

Commit

Permalink
Merge pull request #9 from J-hoplin1/go-migration
Browse files Browse the repository at this point in the history
Migration : Python3 -> Golang
  • Loading branch information
J-Hoplin authored Aug 9, 2023
2 parents c51d4b8 + cd2c0c6 commit ee486c9
Show file tree
Hide file tree
Showing 42 changed files with 1,117 additions and 519 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#Shell runtime
SHELL_TYPE=bash

#Multipass Ubuntu Version
MULTIPASS_INSTANCE=22.04

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__/
.idea/
.idea/
virtual-cluster
39 changes: 26 additions & 13 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@

---

Version : 0.0.2
Version : 0.1.0

---
## What's new?

- The base language of this project has been changed to go language.
- There are more advantages than Python in CLI production, and open source called [cobra](https://github.com/spf13/cobra) was used for this project
- Apply the concept of concurrency programming using goroutine to show improved performance compared to Python version

I'll organize the details with the patch note ASAP

## Required Spec

Expand All @@ -25,7 +32,7 @@ Version : 0.0.2
- If your environment is 8GB of RAM : 1 master, 1 worker node is recommended
- Least : 16 GB of RAM
- Stable : 32 GB of RAM or upper
- Python3 : ver 3.8 upper
- Golang : **Upper than v 1.18**

---

Expand All @@ -40,6 +47,8 @@ Version : 0.0.2
- Install helm
- https://helm.sh/docs/intro/install/

**If more than one requisite is not satisfied, CLI will return error like underbelow**
![img](./img/3.png)
---

## Before start
Expand All @@ -52,12 +61,20 @@ git clone https://github.com/J-hoplin1/K3S-Virtual-Cluster.git
cd K3S-Virtual-Cluster
```

2. Install requirements.txt
2. Install required packages

```
go install
```

3. Compile

```
pip3 install -r requirements.txt
go build
```

Will going to provide a solution that is registered in the environmental variable and used in near future ☺️

3. Make your K3S Version of dotenv file. Default is `v1.26.6+k3s1`. Find available version [here](https://github.com/k3s-io/k3s/releases)

```
Expand All @@ -77,30 +94,30 @@ K3S_VERSION=v1.26.6+k3s1
- **Due to lack of computing resources, master / worker node may not initialize properly sometimes. Please check computing resource before initiate cluster. (Usually occured in 8/16 GB RAM PC)**

```
python3 cluster.py -c init
./virtual-cluster cluster init
```

- Terminate cluster

```
python3 cluster.py -c terminate
./virtual-cluster cluster terminate
```

- Add new worker-node to cluster (Scale-Out)
- `-n` option is required when using `-c add` option
```
python3 cluster.py -c add -n <new-node-name>
./virtual-cluster cluster add -n <new-node-name>
```
- Connect to node instance's shell
- `-n` option is required when using `-c shell` option
```
python3 cluster.py -c shell -n <node-name>
./virtual-cluster cluster shell -n <node-name>
```
- Delete worker-node from cluster
- **Warning : This option ignore daemonsets and delete local datas of node!**
- `-n` option is required when using `-c delete` option
```
python3 cluster.py -c delete -n <node-name>
./virtual-cluster cluster delete -n <node-name>
```

---
Expand Down Expand Up @@ -188,7 +205,3 @@ python3 cluster.py -c add -n <new-node-name>

---

## TODO List

- [ ] Polymorphism Support about helm chart
- [ ] Apply dashboard
274 changes: 0 additions & 274 deletions app.py

This file was deleted.

Loading

0 comments on commit ee486c9

Please sign in to comment.