Skip to content

Commit

Permalink
Merge pull request #1612 from DSD-DBS/no-session-token
Browse files Browse the repository at this point in the history
feat(routing): Add redundancy and 401 error handling to session routing
  • Loading branch information
MoritzWeber0 authored Jun 11, 2024
2 parents 640790f + 3dd47d7 commit 4964f08
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
12 changes: 12 additions & 0 deletions helm/templates/sessions/guacamole.disruptionbudget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: Apache-2.0

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ .Release.Name }}-session-nginx
spec:
minAvailable: 1
selector:
matchLabels:
id: {{ .Release.Name }}-deployment-session-nginx
25 changes: 25 additions & 0 deletions helm/templates/sessions/sessions.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ data:
root /usr/share/nginx/html;
error_page 502 /502.html;
error_page 401 /401.html;
resolver {{ .Values.cluster.dns.service }}.{{ .Values.cluster.dns.namespace }}.svc.cluster.local;
Expand Down Expand Up @@ -82,3 +83,27 @@ data:
</div>
</body>
</html>
401.html: |-
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h2>Not authenticated against session - 401 Authorization Required</h2>
<div>
The error can occur for various reasons:
<ul>
<li>The session has been terminated in the Capella Collaboration Manager.</li>
<li>You've tried to connect to a session directly. You have to connect via the Capella Collaboration Manager.</li>
</div>
<div>
If you think this error shouldn't appear, please contact your system administrator.
</div>
</body>
</html>
5 changes: 4 additions & 1 deletion helm/templates/sessions/sessions.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/sessions/sessions.configmap.yaml") . | sha256sum }}
spec:
replicas: 1
replicas: 2
selector:
matchLabels:
id: {{ .Release.Name }}-deployment-session-nginx
Expand Down Expand Up @@ -63,6 +63,9 @@ spec:
- name: {{ .Release.Name }}-session-nginx
mountPath: /usr/share/nginx/html/502.html
subPath: 502.html
- name: {{ .Release.Name }}-session-nginx
mountPath: /usr/share/nginx/html/401.html
subPath: 401.html
{{ if .Values.cluster.containers }}
{{- toYaml .Values.cluster.containers | nindent 10 }}
{{ end }}

0 comments on commit 4964f08

Please sign in to comment.