Skip to content

Commit

Permalink
Merge pull request #44 from natrontech/7-enhance-docs
Browse files Browse the repository at this point in the history
Enhance Documentation and Update vCluster
  • Loading branch information
janlauber authored Nov 5, 2023
2 parents a58c908 + 799fa1a commit ad0a942
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 9 deletions.
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ Welcome to KubeLab! Our advanced web-based platform offers a rich set of interac
KubeLab is a proud offering by [Natron Tech](https://natron.io), and if you're interested in a tailor-made Kubernetes workshop for your company, do not hesitate to reach out to us!

KubeLab is built using:

- [kubelab-agent](https://github.com/natrontech/kubelab-agent)
- [xterm.js](https://xtermjs.org/)
- [code-server](https://docs.linuxserver.io/images/docker-code-server/)
- [pocketbase](https://pocketbase.io)

<p align="center">
<img height="400px" src="assets/screenshot.png" />
<img height="500px" src="assets/screenrecording.gif" />
</p>

**Please note:** This project is still in its early stages, and we're diligently working to enhance your experience. However, bugs might appear, and your patience and feedback will be greatly appreciated.
Expand All @@ -51,21 +53,31 @@ KubeLab is built using:
## Features

### Web Terminal

KubeLab features a smooth in-browser terminal, letting you execute commands and interact with your Kubernetes cluster in real-time, without needing any additional setup or software.

### Code Editor

KubeLab comes with a vscode-based code editor, allowing you to edit and run code directly from your browser. The editor supports syntax highlighting, code completion, and more. Watch out for the code editor button in the bottom left corner of your screen.

### Dedicated Cluster Per Session

Every learning session on KubeLab has its own isolated Kubernetes cluster. This design ensures a secure and dedicated learning environment, enabling you to experiment with Kubernetes without impacting others.

### Custom Kubernetes Labs

With KubeLab, you can define your own labs and exercises. Check out our workshops [here](https://github.com/natrontech/kubelab-workshops).

## Getting Started

To get started, ensure that you have a Kubernetes cluster (v1.23+). More information on installation and documentation will be provided soon.

---

## Development

Interested in contributing to KubeLab? Please make sure you have the following prerequisites:

- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [Node.js](https://nodejs.org/en/download/) (v20+)
Expand All @@ -74,6 +86,34 @@ Interested in contributing to KubeLab? Please make sure you have the following p

Please refer to our detailed development guides for the [backend](./kubelab-backend/README.md) and [frontend](./kubelab-ui/README.md) to get started. For contributing, please read our [CONTRIBUTING.md](CONTRIBUTING.md) for information on code conduct and the process for submitting pull requests.

## Deployment

KubeLab is deployed in a Kubernetes cluster. Please check out the example [deployment](./deployment) for more information.

### Environment Variables

The following environment variables are required for KubeLab to function properly:

| Variable Name | Default | Description |
| --- | --- | --- |
| `LOCAL` | `false` | Set to `true` if you're running KubeLab locally. It will take your local kubeconfig under .kube/config |
| `KUBELAB_AGENT_IMAGE` | `ghcr.io/natrontech/kubelab-agent:latest` | The image for the agent |
| `CODE_SERVER_IMAGE` | `ghcr.io/natrontech/kubelab-code-server:latest` | The image for the code-server |
| `ALLOWED_HOSTS` | `*` | The allowed hosts for the backend |
| `RESOURCE_NAME` | `kubelab` | The name of the resource |
| `AGENT_INGRESS_CLASS` | `nginx` | The ingress class for the agent |
| `PODS_LIMIT` | `70` | The maximum number of pods allowed per session |
| `STORAGE_LIMIT` | `50Gi` | The maximum storage allowed per session |
| `VCLUSTER_CHART_VERSION` | `0.16.4` | The version of the vcluster chart |
| `VCLUSTER_VALUES_FILE_PATH` | `./vcluster-values.yaml` | The path to the vcluster values file |

## Known Issues

- Some links in the frontend are hardcoded to `kubelab.ch`. This is a temporary workaround until we have a proper solution to serve the static frontend files dynamically.
- The labs need to be manually created via an upload script in [./kubelab-fill](./kubelab-fill). This will be automated in the future.
- Signup is not yet implemented. We're working on it and want to make a free signup with a limited number of sessions available soon.
- The frontend is not yet optimized for mobile devices. This is not a priority for us at the moment, but we'll get to it eventually.

---

Begin your Kubernetes journey with KubeLab today!
Binary file added assets/screenrecording.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions deploy/persistentvolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: hostpath-pv
namespace: kubelab
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi # Adjust size as needed
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/kubelab" # Directory on the host
22 changes: 15 additions & 7 deletions deploy/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,32 @@ spec:
ports:
- containerPort: 8090
volumeMounts:
- name: pb-data
- name: pb-data-hostpath
mountPath: /app/kubelab/pb_data
envFrom:
- configMapRef:
name: kubelab-config
resources:
requests:
memory: "128Mi"
cpu: "100m"
memory: "16Gi"
cpu: "4"
limits:
memory: "256Mi"
cpu: "500m"
memory: "16Gi"
cpu: "8"
nodeSelector:
hostpath-node: "true"
volumes:
- name: pb-data-hostpath
persistentVolumeClaim:
claimName: hostpath-pvc
volumeClaimTemplates:
- metadata:
name: pb-data
name: pb-data-hostpath
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
storageClassName: nfs-data
storageClassName: manual
volumeMode: Filesystem
volumeName: hostpath-pv
2 changes: 1 addition & 1 deletion kubelab-backend/pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type config struct {
IngressClass string `env:"AGENT_INGRESS_CLASS" envDefault:"nginx"`
PodsLimit string `env:"PODS_LIMIT" envDefault:"70"`
StorageLimit string `env:"STORAGE_LIMIT" envDefault:"50Gi"`
VClusterChartVersion string `env:"VCLUSTER_CHART_VERSION" envDefault:"0.15.5"`
VClusterChartVersion string `env:"VCLUSTER_CHART_VERSION" envDefault:"0.16.4"`
VClusterValuesFilePath string `env:"VCLUSTER_VALUES_FILE_PATH" envDefault:"./vcluster-values.yaml"`
}

Expand Down
3 changes: 3 additions & 0 deletions kubelab-ui/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export AGENT_INGRESS_CLASS=nginx-external
export ALLOWED_HOSTS=kubelab.ch
export LOCAL=true
1 change: 1 addition & 0 deletions kubelab-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The above produces `build` output directory which is then used by PocketBase to

```bash
# start the backend, if not already running ...
source .env
npm run dev:backend
# and then start the frontend ...
npm run dev
Expand Down

0 comments on commit ad0a942

Please sign in to comment.