Skip to content

Commit

Permalink
Fixes to kubernetes deployment helmcharts (#468)
Browse files Browse the repository at this point in the history
* Add data dir to helmchart, make log dir writable, fix project dir version prefix

* Simplify helmchart conditionals into values.yaml
  • Loading branch information
rtuck99 authored Sep 13, 2024
1 parent 055840c commit 794469f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
20 changes: 11 additions & 9 deletions helmchart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ spec:
hostPath:
path: "{{ .Values.dodal.projectDir | clean }}"
type: Directory
{{- if .Values.hyperion.dev }}
- name: devlogs
- name: logs
hostPath:
path: "{{ .Values.hyperion.projectDir }}/tmp"
type: Directory
{{- end }}
path: "{{ .Values.hyperion.logDir }}"
- name: data
hostPath:
type: Directory
path: "{{ .Values.hyperion.dataDir }}"
containers:
- name: hyperion
image: {{ .Values.hyperion.imageRepository}}/hyperion:{{ .Values.hyperion.appVersion }}
Expand All @@ -66,7 +68,7 @@ spec:
protocol: TCP
env:
- name: HYPERION_LOG_DIR
value: {{ .Values.hyperion.logDir }}
value: /var/log/bluesky
- name: BEAMLINE
value: "{{ .Values.hyperion.beamline }}"
{{- if not .Values.hyperion.dev }}
Expand Down Expand Up @@ -105,7 +107,7 @@ spec:
name: utility-scripts
- mountPath: "/app/dodal"
name: dodal
{{- if .Values.hyperion.dev }}
- mountPath: "/app/hyperion/tmp"
name: devlogs
{{ end }}
- mountPath: "/var/log/bluesky"
name: logs
- mountPath: "/dls/{{ .Values.hyperion.beamline }}/data"
name: data
1 change: 1 addition & 0 deletions helmchart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ hyperion:
beamline: i03
dev: false
logDir: "/dls_sw/i03/logs/bluesky"
dataDir: "/dls/i03/data"
# These should be overridden at install time
projectDir: SET_ON_INSTALL
appVersion: SET_ON_INSTALL
Expand Down
7 changes: 4 additions & 3 deletions utility_scripts/deploy/deploy_hyperion_to_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ hyperion.dev=true,\
hyperion.runAsUser=$EUID,\
hyperion.runAsGroup=$GID,\
hyperion.supplementalGroups=[$SUPPLEMENTAL_GIDS],\
hyperion.logDir=/app/hyperion/tmp,\
hyperion.logDir=$PROJECTDIR/tmp,\
hyperion.dataDir=$PROJECTDIR/tmp/data,\
hyperion.externalHostname=test-hyperion.diamond.ac.uk "
mkdir -p $PROJECTDIR/tmp
mkdir -p $PROJECTDIR/tmp/data
DEPLOYMENT_DIR=$PROJECTDIR
else
DEPLOYMENT_DIR=/dls_sw/i03/software/bluesky/mx_bluesky_v${APP_VERSION}/hyperion
DEPLOYMENT_DIR=/dls_sw/i03/software/bluesky/mx_bluesky_${APP_VERSION}/hyperion
fi

HELM_OPTIONS+="--set hyperion.appVersion=$APP_VERSION,\
Expand Down

0 comments on commit 794469f

Please sign in to comment.