TommyLike / code-server-operator

Running multiple code server instances in k8s cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code sever operator

Publish Docker images

This project used to launch multiple code server instances in k8s cluster.

Features

  1. Release compute resource if the code server keeps inactive for some time.
  2. Release volume resource if the code server has not been used for a period of long time.
  3. Git clone code automatically before running code sever.
  4. TLS/SSL enabled.
  5. x86&arm supported

Sample Yaml

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

Image templates

Supported base images are list below:

OS\Arch x86 aarch64
Ubuntu
Centos
openEuler

Develop

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

About

Running multiple code server instances in k8s cluster


Languages

Language:Go 83.2%Language:Dockerfile 7.1%Language:Shell 5.7%Language:Makefile 3.3%Language:JavaScript 0.8%