This project used to launch multiple code server instances in k8s cluster.
- Release compute resource if the code server keeps inactive for some time.
- Release volume resource if the code server has not been used for a period of long time.
- Git clone code automatically before running code sever.
- TLS/SSL enabled.
- x86&arm supported
The sample yaml can be found in example
folder:
apiVersion: cs.tommylike.com/v1alpha1
kind: CodeServer
metadata:
name: codeserver-tommy
spec:
url: codeservertommy
image: "codercom/code-server:v2"
volumeSize: "200m"
storageClassName: "local-nfs"
inactiveAfterSeconds: 600
recycleAfterSeconds: 1200
resources:
requests:
cpu: "2"
memory: "2048m"
serverCipher: "1234"
initPlugins:
git:
- --repourl
- https://github.com/TommyLike/tommylike.me.git
Supported base images are list below:
OS\Arch | x86 | aarch64 |
---|---|---|
Ubuntu | ✅ | ✅ |
Centos | ❎ | ❎ |
openEuler | ❎ | ❎ |
We use kind to boot up the kubernetes cluster, please use the script file to prepare cluster.
./local_development/local_up.sh
export KUBECONFIG
:
export KUBECONFIG="$(kind get kubeconfig-path development)"
generate latest CRD yaml file:
make manifests
apply CRD into cluster:
make install
then test locally:
make run