From b20c72e903e123be596550bf74b4dd9b13016df0 Mon Sep 17 00:00:00 2001 From: avouacr Date: Wed, 19 Oct 2022 09:25:36 +0000 Subject: [PATCH] fix init script for ubuntu --- charts/ubuntu/Chart.yaml | 2 +- charts/ubuntu/templates/deployment.yaml | 13 ++----- charts/ubuntu/values.schema.json | 46 ++++++++++++------------- charts/ubuntu/values.yaml | 4 +-- 4 files changed, 28 insertions(+), 37 deletions(-) diff --git a/charts/ubuntu/Chart.yaml b/charts/ubuntu/Chart.yaml index af253efd..0c4cb92e 100644 --- a/charts/ubuntu/Chart.yaml +++ b/charts/ubuntu/Chart.yaml @@ -22,7 +22,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: 5.4.0 +version: 5.4.1 # 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 diff --git a/charts/ubuntu/templates/deployment.yaml b/charts/ubuntu/templates/deployment.yaml index f8c7d555..755c4859 100644 --- a/charts/ubuntu/templates/deployment.yaml +++ b/charts/ubuntu/templates/deployment.yaml @@ -53,7 +53,7 @@ spec: image: "{{ .Values.service.image.version }}" {{- end }} command: ["/bin/sh","-c"] - args: ["/data/{{ .Values.init.filename}} /usr/bin/tini -- /dockerstartup/startup.sh"] + args: ["{{ .Values.init.standardInitPath }} /usr/bin/tini -- /dockerstartup/startup.sh"] imagePullPolicy: {{ .Values.service.image.pullPolicy }} env: - name: VNC_PW @@ -99,16 +99,7 @@ spec: - mountPath: /dev/shm name: dshm - mountPath: /home/headless/work - name: home - initContainers: - - name: standard-init - image: "busybox" - imagePullPolicy: "IfNotPresent" - command: ["/bin/sh","-c"] - args: ["wget -O /data/{{ .Values.init.filename}} {{ .Values.init.standardInit}} && chmod +x /data/{{ .Values.init.filename}}"] - volumeMounts: - - mountPath: /data - name: {{$volumeName}} + name: home {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/ubuntu/values.schema.json b/charts/ubuntu/values.schema.json index 4c24aa84..6e7400cc 100644 --- a/charts/ubuntu/values.schema.json +++ b/charts/ubuntu/values.schema.json @@ -19,7 +19,7 @@ "version": { "description": "ubuntu supported version", "type": "string", - "enum": ["inseefrlab/ubuntu-vnc:v1.0.0"], + "enum": ["inseefrlab/ubuntu-vnc:"], "pattern": "^[a-z0-9-_./]+(:[a-z0-9-_.]+)?$", "hidden": { "value": true, @@ -600,30 +600,30 @@ "description": "Init parameters", "type": "object", "properties": { - "standardInit": { - "type": "string", - "description": "initialization script", - "default": "", - "x-form": { - "hidden": true, - "value": "{{k8s.initScriptUrl}}" - }, - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{k8s.initScriptUrl}}" - } - }, - "personalInit": { - "type": "string", - "description": "initialization script", - "default": "" + "regionInit": { + "type": "string", + "description": "region initialization script", + "default": "", + "x-form": { + "hidden": true, + "value": "{{k8s.initScriptUrl}}" }, - "personalInitArgs": { - "type": "string", - "description": "args for initialization script", - "default": "" + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{k8s.initScriptUrl}}" } + }, + "personalInit": { + "type": "string", + "description": "user initialization script", + "default": "" + }, + "personalInitArgs": { + "type": "string", + "description": "args for user initialization script", + "default": "" + } } - } + } } } \ No newline at end of file diff --git a/charts/ubuntu/values.yaml b/charts/ubuntu/values.yaml index fdec7c7d..247a0765 100644 --- a/charts/ubuntu/values.yaml +++ b/charts/ubuntu/values.yaml @@ -19,8 +19,8 @@ security: ip: "0.0.0.0/0" init: - standardInit: "https://git.lab.sspcloud.fr/innovation/plateforme-onyxia/services-ressources/-/raw/master/onyxia-init.sh" - filename: "onyxia-init.sh" + standardInitPath: "/opt/onyxia-init.sh" + regionInit: "" personalInit: "" personalInitArgs: ""