Skip to content

Commit

Permalink
Re-add wetty support
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfgang Kulhanek authored and Wolfgang Kulhanek committed Dec 12, 2023
1 parent b3b2a30 commit bc86d72
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/showroom-single-pod/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.17
version: 0.0.18

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 8 additions & 0 deletions charts/showroom-single-pod/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
{{- if .Values.terminal.setup }}
<button class="tablinks" onclick="openTerminal(event, 'terminal_tab')" id="defaultOpen" tabindex="0">Terminal</button>
{{- end }}
{{- if .Values.wetty.setup }}
<button class="tablinks" onclick="openTerminal(event, 'terminal_tab')" id="defaultOpen" tabindex="0">Terminal</button>
{{- end }}
{{- if .Values.codeserver.setup }}
<button class="tablinks" onclick="openTerminal(event, 'codeserver_tab')">Code Server</button>
{{- end }}
Expand All @@ -28,6 +31,11 @@
<iframe id="terminal_01" src="https://{{ .Release.Name }}-{{ .Release.Namespace }}.{{ .Values.deployer.domain }}/terminal" width="100%" style="border:none;"></iframe>
</div>
{{- end }}
{{- if .Values.wetty.setup }}
<div id="terminal_tab" class="tabcontent">
<iframe id="terminal_01" src="https://{{ .Release.Name }}-{{ .Release.Namespace }}.{{ .Values.deployer.domain }}/wetty" width="100%" style="border:none;"></iframe>
</div>
{{- end }}
{{- if .Values.codeserver.setup }}
<div id="codeserver_tab" class="tabcontent">
<iframe id="codeserver" src="https://{{ .Release.Name }}-{{ .Release.Namespace }}.{{ .Values.deployer.domain }}/codeserver" width="100%" style="border:none;"></iframe>
Expand Down
33 changes: 31 additions & 2 deletions charts/showroom-single-pod/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ spec:
httpGet:
path: /
port: 8000
{{- if .Values.terminal.setup }}

{{- if .Values.terminal.setup }}
- name: terminal
image: {{ .Values.terminal.image }}
imagePullPolicy: IfNotPresent
Expand All @@ -84,7 +85,35 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.terminal.resources | nindent 10 }}
{{- end }}
{{- end }}

{{- if .Values.wetty.setup }}
- name: wetty
image: {{ .Values.wetty.image }}
imagePullPolicy: IfNotPresent
args:
- --base={{ .Values.wetty.wetty.base }}
- --port={{ .Values.wetty.wetty.port }}
{{- if .Values.wetty.wetty.autoSshToBastion }}
- --ssh-host={{ .Values.wetty.wetty.sshHost }}
- --ssh-port={{ .Values.wetty.wetty.sshPort }}
- --ssh-user={{ .Values.wetty.wetty.sshUser }}
- --ssh-auth={{ .Values.wetty.wetty.sshAuth }}
- --ssh-pass={{ .Values.wetty.wetty.sshPass }}
{{- end }}
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: GUID
value: "{{ .Values.guid }}"
ports:
- containerPort: 7681
protocol: TCP
resources:
{{- toYaml .Values.wetty.resources | nindent 10 }}
{{- end }}

volumes:
- name: showroom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data:
proxy_set_header X-Forwarded-Proto $scheme;
}
{{- if .Values.terminal.setup }}
location /terminal/ {
proxy_pass http://localhost:7681;
rewrite ^/terminal/(.*)$ /$1 break;
Expand All @@ -57,7 +58,24 @@ data:
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
{{- end }}

{{- if .Values.wetty.setup }}
location ^~ /wetty {
proxy_pass http://localhost:{{ .Values.wetty.port }}/wetty;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 43200000;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
{{- end }}

{{- if .Values.ocpConsole.setup }}
location /ocp/ {
# not working, don't know why
# keeps looking for assets on / of the nginx
Expand All @@ -72,5 +90,6 @@ data:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
{{- end }}
}
}
24 changes: 24 additions & 0 deletions charts/showroom-single-pod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ terminal:
# Use default Storage Class when empty
storageClass: ""

wetty:
setup: false
image: docker.io/wettyoss/wetty:latest
name: wetty
resources:
limits:
memory: 256Mi
requests:
cpu: 500m
memory: 256Mi
wetty:
autoSshToBastion: false
base: '/wetty/'
port: 8001
sshHost: shared-410-bastion.openshift.redhatworkshops.io
sshPort: 22
sshUser: ec2-user
sshAuth: password
sshPass: password

codeserver:
setup: false
image: docker.io/codercom/code-server:latest
Expand All @@ -58,3 +78,7 @@ codeserver:
requests:
cpu: 500m
memory: 512Mi

# To be fully implemented
ocpConsole:
setup: false

0 comments on commit bc86d72

Please sign in to comment.