Giter Site home page Giter Site logo

vcode-operator's Introduction

vcode-operator

Kubernetes operator based on microsoft/vscode and developed with python3 using kubernetes and kopf libraries.

What it does?

It gives you a declarative way to deploy instances of vscode on-the-web automating the creation of related native objects:

  • Deployment
  • Service
  • Ingresses
  • Persitent volume claim
$ cat qa/sample1.yaml 
---
apiVersion: davidp1404.github.com/v1
kind: vcodeWorkspace
metadata:
  name: sample1
  namespace: default
spec:
  volumeSize: "100Mi"
  storageClassName: "nfs-volumes"
  resources:
    requests:
      cpu: "1"
  password: "1234"
 
$ k get vcws sample1 
NAME      STORAGECLASSNAME   VOLUMESIZE   RESOURCES                                                                     AGE
sample1   nfs-volumes        100Mi        {"limits":{"cpu":"1","memory":"1Gi"},"requests":{"cpu":"1","memory":"1Gi"}}   29m

$ k get vcws sample1 -o yaml
apiVersion: davidp1404.github.com/v1
kind: vcodeWorkspace
metadata:
  name: sample1
  namespace: default
spec:
  image: codercom/code-server
  ingress-class: nginx
  ingress-host: ""
  password: "1234"
  resources:
    limits:
      cpu: "1"
      memory: 1Gi
    requests:
      cpu: "1"
      memory: 1Gi
  storageClassName: nfs-volumes
  volumeSize: 100Mi

As a result and instance of microsoft/vscode will become available at address https://<your_ingress_fqdn>/<namespace>/<name>/

Screenshot

What problems does it solve?

  • Allow developing of apps from inside the k8s instance, solving issues that port-forward doesn't usually solve well (like connect to kafka brokers or any distributted component).
  • Restrict access to sensible code avoiding copies outside your control.

Installation:

$ git clone --depth 1 --branch v1.0 https://github.com/davidp1404/vcode-operator.git
$ cd vcode-operator
# Tune the docker-image defintion in the Makefile to reflect your scenario
# Modify yaml/vcode-operator-deployment.yaml file with the image url/tag chosen 
# Ensure your kubeconfig/context grants you the privileges needed to create crds, clusterroles, clusterrolebindings, serviceaccounts, configmaps, deployments
$ make docker-image
$ make install-crd
$ make install-operator
$ make install-qasamples

Uninstallation

$ make uninstall-crd
$ make uninstall-operator
$ make uninstall-qasamples

Status:

Maturity: early beta
Limitations:

  • WIP to manage pvc changes

To-Do:

  • Based on jinja2 templates you can easily adapt to your particularities
  • Makefile to create docker images and install
  • Operator with multiple replicas
  • Package with kustomize
  • Replace password for something better like oidc2 auth

References:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.