Skip to content

Commit

Permalink
deploy thor to gen3 commons kubernetes cluster (#1622)
Browse files Browse the repository at this point in the history
* add thor deploy and service

* add thor-service.conf

* modify name to thor-service

* add authz config to thor
  • Loading branch information
jingh8 authored Jun 9, 2021
1 parent 81172d3 commit de9c2af
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kube/services/revproxy/gen3.nginx.conf/thor-service.conf
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/;
}

39 changes: 39 additions & 0 deletions kube/services/thor/thor-deploy.yaml
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

13 changes: 13 additions & 0 deletions kube/services/thor/thor-service.yaml
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

0 comments on commit de9c2af

Please sign in to comment.