diff --git a/README.adoc b/README.adoc index a5ae9d2..3cae311 100644 --- a/README.adoc +++ b/README.adoc @@ -64,16 +64,16 @@ helm template ./showroom-single-pod \ --set documentation.repoUrl=https://github.com/rhpds/showroom_template_default \ | oc apply -f - ---- - ++ NOTE: If the above doesn't work, the following worked for me: + ---- +---- helm template showroom showroom-single-pod \ --set deployer.domain=apps.shared-410.openshift.redhatworkshops.io \ --set general.guid=my-test \ --set documentation.repoUrl=https://github.com/rhpds/showroom_template_default \ | oc apply -f - ---- +---- === Deploy as cluster-admin with `helm install` diff --git a/charts/showroom-single-pod/Chart.yaml b/charts/showroom-single-pod/Chart.yaml index a20572a..5513f1c 100644 --- a/charts/showroom-single-pod/Chart.yaml +++ b/charts/showroom-single-pod/Chart.yaml @@ -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: 1.2.1 +version: 1.3.0 # 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 diff --git a/charts/showroom-single-pod/files/index.html b/charts/showroom-single-pod/files/index.html index 7b0564e..952f398 100644 --- a/charts/showroom-single-pod/files/index.html +++ b/charts/showroom-single-pod/files/index.html @@ -16,12 +16,31 @@
-{{- if eq .Values.terminal.setup "true" }} - + + +{{- if eq .Values.stacked_terminals.setup "false" }} + {{- if eq .Values.terminal.setup "true" }} + + {{- end }} + {{- if eq .Values.terminal2.setup "true" }} + + {{- end }} + {{- if eq .Values.wetty.setup "true" }} + + {{- end }} + {{- if eq .Values.wetty2.setup "true" }} + + {{- end }} {{- end }} -{{- if eq .Values.wetty.setup "true" }} - + + + +{{- if eq .Values.stacked_terminals.setup "true" }} + {{- end }} + + + {{- if eq .Values.codeserver.setup "true" }} {{- end }} @@ -31,22 +50,56 @@ {{- if eq .Values.novnc.setup "true" }} {{- end }} +
-{{- if eq .Values.terminal.setup "true" }} -
- -
-{{- end }} -{{- if eq .Values.wetty.setup "true" }} -
- -
+ + + +{{- if eq .Values.stacked_terminals.setup "false" }} + {{- if eq .Values.terminal.setup "true" }} +
+ +
+ {{- end }} + {{- if eq .Values.terminal2.setup "true" }} +
+ +
+ {{- end }} + {{- if eq .Values.wetty.setup "true" }} +
+ +
+ {{- end }} + {{- if eq .Values.wetty2.setup "true" }} +
+ +
+ {{- end }} + {{- if eq .Values.codeserver.setup "true" }} +
+ +
+ {{- end }} {{- end }} -{{- if eq .Values.codeserver.setup "true" }} -
- -
+ + +{{- if eq .Values.stacked_terminals.setup "true" }} + +
+
+ +
+
+ +
+
+ {{- end }} + + + + {{- if eq .Values.ocpconsole.setup "true" }}
@@ -60,6 +113,7 @@
{{- end }}
+ diff --git a/charts/showroom-single-pod/templates/deployment.yaml b/charts/showroom-single-pod/templates/deployment.yaml index 3df32c1..f6139c3 100644 --- a/charts/showroom-single-pod/templates/deployment.yaml +++ b/charts/showroom-single-pod/templates/deployment.yaml @@ -87,6 +87,26 @@ spec: resources: {{- toYaml .Values.terminal.resources | nindent 10 }} {{- end }} +{{- if eq .Values.terminal2.setup "true" }} + - name: terminal2 + image: {{ .Values.terminal2.image }} + imagePullPolicy: IfNotPresent + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: GUID + value: "{{ .Values.guid }}" + volumeMounts: + - name: terminal-lab-user-home + mountPath: /home/lab-user + ports: + - containerPort: {{ .Values.terminal2.port }} + protocol: TCP + resources: + {{- toYaml .Values.terminal2.resources | nindent 10 }} +{{- end }} {{- if eq .Values.ocpconsole.setup "true" }} - name: console-app image: "quay.io/openshift/origin-console:4.14" @@ -151,6 +171,34 @@ spec: {{- toYaml .Values.wetty.resources | nindent 10 }} {{- end }} +{{- if eq .Values.wetty2.setup "true" }} + - name: wetty2 + image: {{ .Values.wetty2.image }} + imagePullPolicy: IfNotPresent + args: + - --base="/{{ .Values.wetty2.base }}/" + - --port={{ .Values.wetty2.port }} +{{- if eq .Values.wetty2.ssh.autoSshToBastion "true" }} + - --ssh-host={{ .Values.wetty2.ssh.sshHost }} + - --ssh-port={{ .Values.wetty2.ssh.sshPort }} + - --ssh-user={{ .Values.wetty2.ssh.sshUser }} + - --ssh-auth={{ .Values.wetty2.ssh.sshAuth }} + - --ssh-pass={{ .Values.wetty2.ssh.sshPass }} +{{- end }} + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: GUID + value: "{{ .Values.guid }}" + ports: + - containerPort: {{ .Values.wetty2.port }} + protocol: TCP + resources: + {{- toYaml .Values.wetty2.resources | nindent 10 }} +{{- end }} + {{- if eq .Values.novnc.setup "true" }} - name: novnc image: {{ .Values.novnc.image }} diff --git a/charts/showroom-single-pod/templates/proxy/configmap-nginx-config.yaml b/charts/showroom-single-pod/templates/proxy/configmap-nginx-config.yaml index 8cfa86b..6fd16b5 100644 --- a/charts/showroom-single-pod/templates/proxy/configmap-nginx-config.yaml +++ b/charts/showroom-single-pod/templates/proxy/configmap-nginx-config.yaml @@ -60,6 +60,23 @@ data: } {{- end }} +{{- if eq .Values.terminal2.setup "true" }} + location /terminal2/ { + proxy_pass http://localhost:{{ .Values.terminal2.port }}; + rewrite ^/terminal2/(.*)$ /$1 break; + + 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 eq .Values.wetty.setup "true" }} location ^~ /wetty { proxy_pass http://localhost:{{ .Values.wetty.port }}/{{ .Values.wetty.base }}; @@ -75,6 +92,21 @@ data: } {{- end }} +{{- if eq .Values.wetty2.setup "true" }} + location ^~ /wetty2 { + proxy_pass http://localhost:{{ .Values.wetty2.port }}/{{ .Values.wetty2.base }}; + 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 eq .Values.ocpconsole.setup "true" }} location /ocp/ { # JM: not working, don't know why diff --git a/charts/showroom-single-pod/values.yaml b/charts/showroom-single-pod/values.yaml index dacb810..48b5aff 100644 --- a/charts/showroom-single-pod/values.yaml +++ b/charts/showroom-single-pod/values.yaml @@ -32,10 +32,21 @@ content: user_data: | bastion_password: from_helm +# to have two terminals in one tab +# set stacked_terminals to "true" +# and indicate which two terminals you want +stacked_terminals: + setup: "false" + name: stacked-terminal + display_name: "Stacked Terminal" + top: "terminal" + bottom: "wetty2" + terminal: setup: "true" image: quay.io/rhpds/openshift-showroom-terminal-ocp:latest name: terminal + display_name: "Terminal 1" port: 7681 resources: limits: @@ -51,10 +62,31 @@ terminal: # Use default Storage Class when empty storageClass: "" +terminal2: + setup: "false" + image: quay.io/rhpds/openshift-showroom-terminal-ocp:latest + name: terminal2 + display_name: "Terminal 2" + port: 7682 + resources: + limits: + cpu: 500m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + # Set up persistent storage for the lab-user's home directory + storage: + setup: "true" + pvcSize: 5Gi + # Use default Storage Class when empty + storageClass: "" + wetty: setup: "false" image: quay.io/rhpds/wetty:latest name: wetty + display_name: "Login Terminal 1" port: 8001 base: "wetty" resources: @@ -71,6 +103,27 @@ wetty: sshAuth: password sshPass: password +wetty2: + setup: "true" + image: quay.io/rhpds/wetty:latest + name: wetty2 + display_name: "Login Terminal 2" + port: 8002 + base: "wetty2" + resources: + limits: + memory: 256Mi + requests: + cpu: 500m + memory: 256Mi + ssh: + autoSshToBastion: "false" + sshHost: shared-410-bastion.openshift.redhatworkshops.io + sshPort: 22 + sshUser: ec2-user + sshAuth: password + sshPass: password + # To be fully implemented codeserver: setup: "false"