-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
308 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# web-terminal | ||
|
||
Start a Web Terminal in your browser with common CLI tools for interacting with | ||
the cluster. | ||
|
||
**Note:** The Web Terminal Operator integrates with the OpenShift Console in | ||
OpenShift 4.5.3 and higher to simplify Web Terminal instance creation and | ||
automate OpenShift login. In earlier versions of OpenShift, the operator can | ||
be installed but Web Terminals will have to be created and accessed manually. | ||
|
||
## Description | ||
The Web Terminal Operator leverages the | ||
[DevWorkspace Operator](https://github.com/devfile/devworkspace-operator) | ||
to provision enviroments which support common cloud CLI tools. When this | ||
operator is installed, the DevWorkspace Operator will be installed as a | ||
dependency. | ||
|
||
## How to Install | ||
Press the **Install** button, choose the upgrade strategy, and wait for the | ||
**Installed** Operator status. | ||
|
||
When the operator is installed, you will see a terminal button appear on the | ||
top right of the console after refreshing the OpenShift console window. | ||
|
||
## How to Uninstall | ||
The Web Terminal Operator requires manual steps to fully uninstall the operator. | ||
As the Web Terminal Operator is designed as a way to access the OpenShift | ||
cluster, Web Terminal instances store user credentials. To avoid exposing these | ||
credentials to unwanted parties, the operator deploys webhooks and finalizers | ||
that aren't removed when the operator is uninstalled. See the | ||
[uninstall guide](https://docs.openshift.com/container-platform/latest/web_console/odc-about-web-terminal.html) | ||
for more details. | ||
|
||
## Known Issues | ||
1. [Occasionally you will need to press enter to get a prompt inside of the web-terminal](https://issues.redhat.com/browse/WTO-43) | ||
2. [DevWorkspace is created but not opened after previous devworkspace is removed](https://issues.redhat.com/browse/WTO-44) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,32 @@ | ||
# OpenShift Web Terminal Operator | ||
# Web Terminal | ||
|
||
Installs the Web Terminal Operator. | ||
|
||
This operator enables you to run a web terminal within the OpenShift Console GUI giving easy availability to tools like oc, helm, etc. | ||
|
||
This operator depends on the DevWorkspace Operator which will be installed automatically when you install this operator. | ||
Install Web Terminal. | ||
|
||
Do not use the `base` directory directly, as you will need to patch the `channel` based on the version of OpenShift you are using, or the version of the operator you want to use. | ||
|
||
The current *overlays* available are for the following channels: | ||
|
||
* [fast](operator/overlays/fast) | ||
|
||
## Usage | ||
|
||
If you have cloned the `gitops-catalog` repository, you can install the OpenShift Data Foundation operator based on the overlay of your choice by running from the root `gitops-catalog` directory | ||
If you have cloned the `gitops-catalog` repository, you can install Web Terminal based on the overlay of your choice by running from the root (`gitops-catalog`) directory. | ||
|
||
``` | ||
oc apply -k web-terminal-operator/overlays/<channel> | ||
oc apply -k web-terminal/operator/overlays/<channel> | ||
``` | ||
|
||
Or, without cloning: | ||
|
||
``` | ||
oc apply -k https://github.com/redhat-cop/gitops-catalog/web-terminal-operator/operator/overlays/<channel> | ||
oc apply -k https://github.com/redhat-cop/gitops-catalog/web-terminal/operator/overlays/<channel> | ||
``` | ||
|
||
As part of a different overlay in your own GitOps repo: | ||
|
||
``` | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- github.com/redhat-cop/gitops-catalog/web-terminal-operator/operator/overlays/<channel>?ref=main | ||
- https://github.com/redhat-cop/gitops-catalog/web-terminal/operator/overlays/<channel>?ref=main | ||
``` | ||
|
||
## A Note on Previous Versions | ||
|
||
Older versions of the Web Terminal Operator required users to configure a DevWorkspaces instance which is no longer required in the current version of the Web Terminal Operator. The Web Terminal Operator will automatically configure any necessary DevWorkspaces components automatically. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
commonAnnotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
|
||
resources: | ||
- ../../operator/overlays/stable | ||
- ../../instance/overlays/aws |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
commonAnnotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
|
||
resources: | ||
- ../../operator/overlays/fast | ||
- ../../instance/overlays/default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- web-terminal-tooling.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: workspace.devfile.io/v1alpha2 | ||
kind: DevWorkspaceTemplate | ||
metadata: | ||
annotations: | ||
controller.devfile.io/allow-import-from: '*' | ||
name: web-terminal-tooling | ||
namespace: openshift-operators | ||
labels: | ||
console.openshift.io/terminal: 'true' | ||
spec: | ||
components: | ||
- container: | ||
args: | ||
- tail | ||
- '-f' | ||
- /dev/null | ||
cpuLimit: 400m | ||
cpuRequest: 100m | ||
image: registry.redhat.io/web-terminal/web-terminal-tooling-rhel8@sha256:657874adad93a9e6c2b746b836015de410d2e280f85c079c81e24ae81343fa6c | ||
memoryLimit: 512Mi | ||
memoryRequest: 128Mi | ||
mountSources: false | ||
sourceMapping: /projects | ||
name: web-terminal-tooling |
6 changes: 6 additions & 0 deletions
6
web-terminal/instance/overlays/default/exclude-default-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$patch: delete | ||
apiVersion: workspace.devfile.io/v1alpha2 | ||
kind: DevWorkspaceTemplate | ||
metadata: | ||
name: web-terminal-tooling | ||
namespace: openshift-operators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
|
||
patches: | ||
- path: exclude-default-template.yaml |
13 changes: 13 additions & 0 deletions
13
web-terminal/instance/overlays/enhanced/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
|
||
patches: | ||
# https://github.com/redhat-developer/web-terminal-operator | ||
- target: | ||
group: workspace.devfile.io | ||
kind: DevWorkspaceTemplate | ||
name: web-terminal-tooling | ||
path: web-terminal-tooling.yaml |
65 changes: 65 additions & 0 deletions
65
web-terminal/instance/overlays/enhanced/web-terminal-tooling.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: workspace.devfile.io/v1alpha2 | ||
kind: DevWorkspaceTemplate | ||
metadata: | ||
annotations: | ||
controller.devfile.io/allow-import-from: '*' | ||
web-terminal.redhat.com/unmanaged-state: 'true' | ||
name: web-terminal-tooling | ||
namespace: openshift-operators | ||
labels: | ||
console.openshift.io/terminal: 'true' | ||
spec: | ||
components: | ||
- container: | ||
args: | ||
- "/bin/bash" | ||
- "-c" | ||
- | | ||
#!/bin/bash | ||
GIT_REPO=https://github.com/codekow/demo-ai-gitops-catalog.git | ||
echo " | ||
echo | ||
GIT_REPO=${GIT_REPO} | ||
printf 'This terminal has been \e[0;32m~Enhanced~\e[0m\n' | ||
printf 'See \033[34;1;1m'${GIT_REPO}'\e[0m\n\n' | ||
" >> ~/.bashrc | ||
git clone "${GIT_REPO}" gitops | ||
echo " | ||
cd gitops; . scripts/functions.sh; cd .. | ||
__git_branch(){ | ||
git name-rev --name-only @ 2>/dev/null | ||
} | ||
PS1='\e]\s\a\n\e[33m\w \e[36m\$(__git_branch)\e[m$ ' | ||
[ -e ~/.venv/bin/activate ] && . ~/.venv/bin/activate | ||
[ -e ~/gitops/scratch/bin/restic.bash ] && . ~/gitops/scratch/bin/restic.bash | ||
cd ~/gitops | ||
" >> ~/.bashrc | ||
cd gitops | ||
. scripts/functions.sh | ||
[ -d ~/.venv ] || pyvenv-3.6 ~/.venv | ||
bin_check busybox | ||
bin_check oc-mirror | ||
bin_check rclone | ||
bin_check restic | ||
sleep infinity | ||
cpuLimit: 400m | ||
cpuRequest: 100m | ||
image: registry.redhat.io/web-terminal/web-terminal-tooling-rhel8@sha256:657874adad93a9e6c2b746b836015de410d2e280f85c079c81e24ae81343fa6c | ||
memoryLimit: 256Mi | ||
memoryRequest: 128Mi | ||
mountSources: false | ||
sourceMapping: /projects | ||
name: web-terminal-tooling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- web-terminal-tooling.yaml |
24 changes: 24 additions & 0 deletions
24
web-terminal/instance/web-terminal/base/web-terminal-tooling.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: workspace.devfile.io/v1alpha2 | ||
kind: DevWorkspaceTemplate | ||
metadata: | ||
annotations: | ||
controller.devfile.io/allow-import-from: '*' | ||
name: web-terminal-tooling | ||
namespace: openshift-operators | ||
labels: | ||
console.openshift.io/terminal: 'true' | ||
spec: | ||
components: | ||
- container: | ||
args: | ||
- tail | ||
- '-f' | ||
- /dev/null | ||
cpuLimit: 400m | ||
cpuRequest: 100m | ||
image: registry.redhat.io/web-terminal/web-terminal-tooling-rhel8@sha256:657874adad93a9e6c2b746b836015de410d2e280f85c079c81e24ae81343fa6c | ||
memoryLimit: 512Mi | ||
memoryRequest: 128Mi | ||
mountSources: false | ||
sourceMapping: /projects | ||
name: web-terminal-tooling |
5 changes: 5 additions & 0 deletions
5
web-terminal/instance/web-terminal/overlays/default/exclude-default-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$patch: delete | ||
apiVersion: workspace.devfile.io/v1alpha2 | ||
kind: DevWorkspaceTemplate | ||
metadata: | ||
name: web-terminal-tooling |
8 changes: 8 additions & 0 deletions
8
web-terminal/instance/web-terminal/overlays/default/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
|
||
patches: | ||
- path: exclude-default-template.yaml |
13 changes: 13 additions & 0 deletions
13
web-terminal/instance/web-terminal/overlays/enhanced/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
|
||
patches: | ||
# https://github.com/redhat-developer/web-terminal-operator | ||
- target: | ||
group: workspace.devfile.io | ||
kind: DevWorkspaceTemplate | ||
name: web-terminal-tooling | ||
path: web-terminal-tooling.yaml |
65 changes: 65 additions & 0 deletions
65
web-terminal/instance/web-terminal/overlays/enhanced/web-terminal-tooling.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: workspace.devfile.io/v1alpha2 | ||
kind: DevWorkspaceTemplate | ||
metadata: | ||
annotations: | ||
controller.devfile.io/allow-import-from: '*' | ||
web-terminal.redhat.com/unmanaged-state: 'true' | ||
name: web-terminal-tooling | ||
namespace: openshift-operators | ||
labels: | ||
console.openshift.io/terminal: 'true' | ||
spec: | ||
components: | ||
- container: | ||
args: | ||
- "/bin/bash" | ||
- "-c" | ||
- | | ||
#!/bin/bash | ||
GIT_REPO=https://github.com/codekow/demo-ai-gitops-catalog.git | ||
echo " | ||
echo | ||
GIT_REPO=${GIT_REPO} | ||
printf 'This terminal has been \e[0;32m~Enhanced~\e[0m\n' | ||
printf 'See \033[34;1;1m'${GIT_REPO}'\e[0m\n\n' | ||
" >> ~/.bashrc | ||
git clone "${GIT_REPO}" gitops | ||
echo " | ||
cd gitops; . scripts/functions.sh; cd .. | ||
__git_branch(){ | ||
git name-rev --name-only @ 2>/dev/null | ||
} | ||
PS1='\e]\s\a\n\e[33m\w \e[36m\$(__git_branch)\e[m$ ' | ||
[ -e ~/.venv/bin/activate ] && . ~/.venv/bin/activate | ||
[ -e ~/gitops/scratch/bin/restic.bash ] && . ~/gitops/scratch/bin/restic.bash | ||
cd ~/gitops | ||
" >> ~/.bashrc | ||
cd gitops | ||
. scripts/functions.sh | ||
[ -d ~/.venv ] || pyvenv-3.6 ~/.venv | ||
bin_check busybox | ||
bin_check oc-mirror | ||
bin_check rclone | ||
bin_check restic | ||
sleep infinity | ||
cpuLimit: 400m | ||
cpuRequest: 100m | ||
image: registry.redhat.io/web-terminal/web-terminal-tooling-rhel8@sha256:657874adad93a9e6c2b746b836015de410d2e280f85c079c81e24ae81343fa6c | ||
memoryLimit: 256Mi | ||
memoryRequest: 128Mi | ||
mountSources: false | ||
sourceMapping: /projects | ||
name: web-terminal-tooling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: openshift-operators | ||
|
||
resources: | ||
- subscription.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: openshift-operators | ||
|
||
resources: | ||
- ../../base | ||
|
||
patches: | ||
- path: patch-channel.yaml | ||
target: | ||
- target: | ||
kind: Subscription | ||
name: web-terminal | ||
path: patch-channel.yaml |