Skip to content

Commit

Permalink
Merge pull request #4 from NFDI4Chem/feature/deployOnRancher
Browse files Browse the repository at this point in the history
Add image names, use default storageClass, avoid hardcoding postgres details
  • Loading branch information
NishaSharma14 authored Feb 1, 2022
2 parents b176e02 + 67b8f39 commit 72746d4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
values-dev.yaml
values-prod.yaml
nmrxiv-app*.tgz
vibspecdb*.tgz
vibspecdb*.tgz

# Editor backup files
*~
2 changes: 1 addition & 1 deletion charts/nmrxiv-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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: 0.1.3
version: 0.1.4

# 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
Expand Down
4 changes: 2 additions & 2 deletions charts/nmrxiv-app/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ data:
#DB Properties
DB_USERNAME: {{ .Values.postgresql.postgresqlUsername }}
DB_CONNECTION: {{ .Values.postgresql.connection }}
DB_HOST: {{ .Values.postgresql.host }}
DB_PORT: "{{ .Values.postgresql.port }}"
DB_HOST: {{ printf "%s-postgresql" .Release.Name | quote }}
DB_PORT: {{ .Values.postgresql.port | default 5432 | quote }}
DB_DATABASE: {{ .Values.postgresql.postgresqlDatabase }}
#Mail Properties:
MAIL_MAILER: {{ .Values.mail.mailer }}
Expand Down
17 changes: 17 additions & 0 deletions charts/nmrxiv-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: postgres-wait-ready
image: alpine
command:
- sh
- -c
- for i in $(seq 1 200); do nc -z -w3 $DB_HOST $DB_PORT && exit 0 || sleep $((2*i)); echo -n "." ; done; exit 1
envFrom:
- configMapRef:
name: {{ .Values.EnvConfigMapRef.name }}
- name: database-migrations
image: "{{ .Values.appImage.repository }}:{{ .Values.appImage.tag | default .Chart.AppVersion }}"
envFrom:
Expand All @@ -52,6 +61,14 @@ spec:
- name: {{ .Values.nginxImage.name }}
imagePullPolicy: {{ .Values.nginxImage.pullPolicy }}
image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag | default .Chart.AppVersion }}"
livenessProbe:
httpGet:
path: /css/app.css
port: 80
readinessProbe:
httpGet:
path: /css/app.css
port: 80
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
Expand Down
16 changes: 8 additions & 8 deletions charts/nmrxiv-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ingress:
# hosts:
# - chart-example.local

resources:
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
Expand All @@ -99,7 +99,7 @@ resources:
cpu: 500m
memory: 50M

mail:
mail:
enabled: true
host: 'smtp.uni-jena.de'
port: 587
Expand All @@ -111,17 +111,17 @@ mail:

postgresql:
image:
tag: 11.14.0-debian-10-r17 # immutable tags are recommended
tag: 11.14.0-debian-10-r17 # immutable tags are recommended
enabled: true
global:
storageClass: standard
host: ''
# global:
# storageClass: standard
connection: pgsql
persistence:
enabled: false
existingClaim: ''
size: 1Gi
port: 5432
# host: nmrxiv-postgresql
# port: 5432
postgresqlDatabase: nmrxiv
postgresqlPassword: secret
postgresqlUsername: user
Expand All @@ -141,7 +141,7 @@ storage:
enabled: true
existingClaim: ''
storage: 2Gi
storageClassName: ''
# storageClassName: standard

autoscaling:
enabled: false
Expand Down

0 comments on commit 72746d4

Please sign in to comment.