-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploy thor to gen3 commons kubernetes cluster (#1622)
* add thor deploy and service * add thor-service.conf * modify name to thor-service * add authz config to thor
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 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,19 @@ | ||
location /thor/ { | ||
if ($csrf_check !~ ^ok-\S.+$) { | ||
return 403 "failed csrf check"; | ||
} | ||
|
||
error_page 403 @errorworkspace; | ||
set $authz_resource "/thor"; | ||
set $authz_method "access"; | ||
set $authz_service "thor"; | ||
# be careful - sub-request runs in same context as this request | ||
auth_request /gen3-authz; | ||
|
||
set $proxy_service "thor-service"; | ||
set $upstream http://thor-service$des_domain; | ||
rewrite ^/thor/(.*) /$1 break; | ||
proxy_pass $upstream; | ||
proxy_redirect http://$host/ https://$host/thor/; | ||
} | ||
|
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,39 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: thor-deployment | ||
spec: | ||
selector: | ||
# Only select pods based on the 'app' label | ||
matchLabels: | ||
app: thor | ||
revisionHistoryLimit: 2 | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
template: | ||
metadata: | ||
labels: | ||
app: thor | ||
public: "yes" | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 100 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- thor | ||
topologyKey: "kubernetes.io/hostname" | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: thor | ||
image: quay.io/cdis/thor:master | ||
imagePullPolicy: Always | ||
|
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 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: thor-service | ||
spec: | ||
selector: | ||
app: thor | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
name: http | ||
|