Skip to content

Commit

Permalink
Added ingress for K8s deployments (#97)
Browse files Browse the repository at this point in the history
* Added ingress for K8s and fixed API version for the deployment

* Added ingress options for K8s

* Fixed link to deployment on REAMDE

* Fixed the default issuer name

---------

Co-authored-by: Alvaro Gonzalez <[email protected]>
Co-authored-by: Alex Kanitz <[email protected]>
  • Loading branch information
3 people authored Jul 9, 2024
1 parent 2c7aef7 commit 6525831
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ curl -X GET "http://localhost:8080/ga4gh/trs/v2/tools" -H "accept: application/j
To quickly install the service for development/testing purposes, we recommend
deployment via [`docker-compose`][res-docker-compose], as described below. For
more durable deployments on cloud native infrastructure, we also provide a
[Helm][res-helm] chart and [basic deployment instructions][trs-filer-
deployment] (details may need to be adapted for your specific infrastructure).
[Helm][res-helm] chart and [basic deployment instructions][trs-filer-deployment] (details may need to be adapted for your specific infrastructure).

### Requirements

Expand Down
2 changes: 1 addition & 1 deletion deployment/templates/trs-filer-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.trs_filer.appName }}
Expand Down
31 changes: 31 additions & 0 deletions deployment/templates/trs-filer-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,35 @@ spec:
wildcardPolicy: None
status:
ingress: []
{{ else if eq .Values.clusterType "kubernetes" }}
{{ if .Values.kubernetes.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ if .Values.kubernetes.ingress.enabled }}
cert-manager.io/cluster-issuer: {{ .Values.kubernetes.https.issuer }}
kubernetes.io/tls-acme: "true"
{{ end }}
name: {{ .Values.trs_filer.appName }}-ingress
spec:
rules:
- host: {{ .Values.host_name }}
http:
paths:
- backend:
service:
name: {{ .Values.trs_filer.appName }}
port:
number: 8080
path: /
pathType: Prefix
{{ if .Values.kubernetes.https.enabled }}
tls:
- hosts:
- {{ .Values.host_name }}
secretName: {{ .Values.trs_filer.appName }}-ingress-secret
{{ end }}
{{ end }}
{{ end }}
11 changes: 11 additions & 0 deletions deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ trs_filer:

apiServer: kubernetes.default.svc:443 # address of k8s API server

# If you are running kubernetes select whether you would like
# to access the service via Ingress. Also, if you have the cert manager
# installed, you can provision a certificate for https
kubernetes:
ingress:
enabled: true
https:
enabled: true
issuer: letsencrypt-prod

mongodb:
image: mongo:3.6
volumeSize: 1Gi

0 comments on commit 6525831

Please sign in to comment.