Giter VIP home page Giter VIP logo

codeserver's Introduction

Code Server OpenShift Container

This repository contains the source code for a code server (https://coder.com/docs/code-server/latest) container configured for Red Hat OpenShift Container Platform.

It also contains the Kubernetes resource files necessary to deploy a code server to an OpenShift cluster.

This repository contains two containers sharing a Persistent Volume Claim for storage:

  • The Main Container (the VSCode container): this container is configured with

    • Code Server

    • OpenJDK 11

    • git

    • Maven

    • Google Chrome (headless, necessary for the browser preview extension)

  • The Init Container. This container is run only once when the application is started for the first time. It will set up the code server environment. The init container uses the following environment variables:

    • CODE_WORKSPACE_NAME: The name of the workspace to create for code server (Lower and uppercase letters are allowed, no spaces allowed)

      - name: CODE_WORKSPACE_NAME
        value: MyWorkspace
    • CODE_PASSWORD: The password for the code server. If no password is specified a 16 character random password is generated and can be retrieved by examining the init container’s log

      Example
      - name: CODE_PASSWORD
        value: my_super_secret_password
    • CODE_REPO_LIST: A JSON list of repositories to clone into the environment. For private repositories encode the userid and password in the repository URL.

    Example
    - name: CODE_REPO_LIST:
      value: '[{"name":"app-mod-projects","url":"https://user1:[email protected]/user1/app-mod-projects.git","branch":"main"}, {"name":"codeserver","url":"https://github.com/redhat-gpte-devopsautomation/codeserver.git","branch":"main"}]'
    • CODE_EXTENSIONS_LIST: a JSON list of extensions to be installed in code server. URL should contain the full download path.

      Example
      - name: CODE_EXTENSIONS_LIST
        value: '[{"filename":"auchenberg.vscode-browser-preview-0.7.2.vsix", "url": "https://gpte-public.s3.amazonaws.com/vscode-plugins/auchenberg.vscode-browser-preview-0.7.2.vsix"}]'

Building

To build each container image a build.sh shell script is provided in the respective subdirectory. Adjust the script with your registry URL, log into your registry and simply run the build script. Note that the build script uses podman but it should also work with docker.

Deploying

The k8s directory has OpenShift manifests that can be applied to your cluster.

  1. Adjust the variables in the file deployment.yaml to match your desired configuration.

  2. Adjust the image locations in the file deployment.yaml to match your container registry.

  3. Create a namespace to run code server in

  4. Use oc apply -k k8s -n <yournamespace> to deploy the application

codeserver's People

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.