Skip to content

Files

Latest commit

43a9b33 · Dec 9, 2024

History

History

openshift

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 13, 2024
Nov 13, 2024
Nov 12, 2024
Nov 12, 2024
Nov 13, 2024
Dec 9, 2024
Dec 9, 2024

Deploying a Private OpenVSX Registry on OpenShift

This guide provides the necessary steps to deploy a private OpenVSX registry on OpenShift. By following the instructions, you'll have a fully operational OpenVSX server and CLI deployed within your OpenShift cluster, ready to be used by Eclipse Che or other services.

Prerequisites

Step-by-Step Instructions

In the workspace, you'll find a set of predefined commands from the devfile.yaml that will assist you in preparing and deploying a private OpenVSX registry. To execute any of these commands within your workspace, navigate to Terminal -> Run Task -> devfile:

  • 2.1. Build and Publish OpenVSX Image

Build the OpenVSX image and push it to the OpenShift internal registry. You'll ask to enter the OpenVSX version to deploy (default is v0.18.0).

  • 2.2. Build and Publish OpenVSX CLI Image

Build the OpenVSX CLI image and push it to the OpenShift internal registry.

  • 2.3. Deploy OpenVSX

Deploy the OpenVSX registry using the provided openvsx-deployment.yml template

  • 2.4. Add OpenVSX user with PAT to the DB

This command adds a new OpenVSX user along with a Personal Access Token (PAT) to the PostgreSQL database.

  • 2.5. Configure Che to use the internal OpenVSX registry

In case you have deployed Eclipse Che on the cluster, you can patch it to use your private OpenVSX registry.

  • 2.6. Publish VS Code Extension to the internal OpenVSX

This command facilitates publishing a VS Code extension to the local OpenVSX registry. It prompts the user to provide the extension's namespace name and download URL. The extension is then downloaded into a temporary folder inside the ovsx-cli pod, a namespace is created (if not already present), and the extension is published to the OpenVSX registry. Afterward, the temporary file is deleted. This command is ideal for adding custom or internal extensions to a local OpenVSX instance.

  • 2.7. Publish list of VS Code Extensions

This command facilitates publishing a list of VS Code extensions to a local OpenVSX registry based on URLs specified in the extensions.txt file. For each extension listed, it downloads the .vsix file into a temporary directory on the ovsx-cli pod, creates a namespace if it doesn’t already exist, and publishes the extension to the OpenVSX registry. After each extension is published, the temporary file is deleted from the pod. This command is ideal for managing multiple extensions by automating the download, namespace creation, and publishing steps, making it easy to maintain a custom set of extensions in a local OpenVSX instance.

OpenShift Template (openvsx-deployment.yml)

You can find the deployment YAML configuration in the openvsx-deployment.yml file. This template defines the deployments, services, and route for the PostgreSQL database, Elasticsearch, OpenVSX Server, and OpenVSX CLI.

Important Parameters

  • ROUTE_NAME: The name of the route to access the OpenVSX server (default: internal)
  • NAMESPACE: The namespace where OpenVSX will be deployed (default: openvsx)
  • POSTGRESQL_IMAGE: The PostgreSQL image to use for the database (default: image-registry.openshift-image-registry.svc:5000/openshift/postgresql:15-el8)
  • OPENVSX_ELASTICSEARCH_IMAGE: The image for Elasticsearch (default: docker.elastic.co/elasticsearch/elasticsearch:8.7.1).
  • OPENVSX_SERVER_IMAGE: The image for the OpenVSX Server.
  • OPENVSX_CLI_IMAGE: The image for the OpenVSX CLI.
  • OVSX_PAT_BASE64: Base64 encoded OVSX personal access token.
  • GITHUB_CLIENT_ID_BASE64 and GITHUB_CLIENT_SECRET_BASE64: Base64 encoded GitHub Client ID and Secret to setup GitHub OAuth.