aroute / roct

This will launch a container with all of the necessary CLIs. Then, using the Kubernetes plugin, VS Code can connect to the container remotely and provide terminal and file access.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remote OCP Container Terminal (ROCT)

This solution uses a pre-configured Ubuntu container image to build a remote environment in OpenShift cluster with command line tools from several cloud vendors: IBM® Cloud, Red Hat® OpenShift®, Kubectl, Helm, etc.

The primary goal of this solution is to use Microsoft Visual Studio Code's Remote Container extension to remote connect to a Linux environment in an OpenShift cluster.

The solution integrates with IBM File or Block storage provisioner (for managed-hosted Classic OpenShift cluster) and NFS provisioner (for Technology Zone's Classic OpenShift cluster). The integration with Virtual Private Cloud (VPC) with OpenShift Data Foundation (ODF) is forthcoming.

📝 For the initial setup, this solution assumes you already have oc, kubectl client available on the system path and VS Code installed (Mac/Windows/Linux).

⛔️ Choose one: Manual or Automated

Manual Installation (MacOS/Linux)

Click to expand!
git clone https://github.com/aroute/roct.git
oc login ...
oc new-project roct
oc create serviceaccount roct
oc adm policy add-scc-to-user privileged -n roct -z roct

⛔️ Choose one: Block or File.

oc create -f roct-block.yaml
oc create -f roct-file.yaml

See below How to attach VS Code to Remote Container

Automated Installation (Windows/MacOS/Linux)

Click to expand!

MacOS/Linux

git clone https://github.com/aroute/roct.git
oc login ...

⛔️ Choose one: Block or File.

Block

chmod +x roct_block.sh
./roct_block.sh

File

chmod +x roct_file.sh
./roct_file.sh

See below How to attach VS Code to Remote Container

Windows

Download this repository (zip file) and extract (see download button above). Launch PowerShell and move into the directory where you downloaded/extracted this repository.

oc login ...

⛔️ Choose one: Block or File.

Block

.\win_roct_block.ps1

File

.\win_roct_file.ps1

See below How to attach VS Code to Remote Container

Troubleshooting PowerShell execution permission

If you receive an error message indicating that the code is not digitally signed, execute the following command:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

How to attach VS Code to Remote Container

Click to expand!
  1. From VS Code Marketplace, install Microsoft's Kubernetes and Remote Development extensions.
  2. Click on VS Code's Kubernetes extension icon. Drop-down the cluster with roct. Drop-down Workloads - Pods. Right-click roct-0 pod and select Attach VS Code.
  3. Above mentioned step opens up a new VS Code window. The extension will install some binaries on the remote container. Wait for the installation to finish and then open a folder to /home/demo/ directory. Open a Terminal and type bash to switch to the bash prompt.
  4. Log in to OpenShift oc login ...

Your pre-configured remote container environment using Ubuntu Linux is all set for you to proceed.

About

This will launch a container with all of the necessary CLIs. Then, using the Kubernetes plugin, VS Code can connect to the container remotely and provide terminal and file access.

License:Apache License 2.0


Languages

Language:Shell 36.0%Language:PowerShell 35.8%Language:Dockerfile 28.2%