diff --git a/test/minio/1.0.1/migrations/migrate.py b/test/minio/1.0.1/migrations/migrate.py new file mode 100644 index 0000000000..2aad34f1a5 --- /dev/null +++ b/test/minio/1.0.1/migrations/migrate.py @@ -0,0 +1,10 @@ +def migrate(values): + values.update({ + 'appVolumeMounts': { + 'export': { + 'hostPathEnabled': values['minioHostPathEnabled'], + **({'hostPath': values['minioHostPath']} if values.get('minioHostPath') else {}) + }, + }, + }) + return values diff --git a/test/minio/1.0.1/questions.yaml b/test/minio/1.0.1/questions.yaml index ea803a6911..4a1605bf38 100644 --- a/test/minio/1.0.1/questions.yaml +++ b/test/minio/1.0.1/questions.yaml @@ -138,38 +138,42 @@ questions: default: 9000 required: true - - variable: minioHostPathEnabled - label: "Configure Host Path for Minio data" - group: "Storage" - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: minioHostPath - label: "Specify HostPath for Minio data" - schema: - type: hostpath - - - variable: minioDataVolume - label: "Minio Data Volume Defaults" + - variable: appVolumeMounts + label: "Minio Storage" group: "Storage" schema: type: dict - $ref: - - "normalize/ixVolume" - show_if: [["minioHostPathEnabled", "=", false]] attrs: - - variable: mountPath - label: "Minio Data Mount Path" - description: "Path where the volume will be mounted inside the pod" + - variable: export + label: "Data Volume" schema: - type: path - editable: false - default: "/export" - - variable: datasetName - label: "Minio Dataset Name" - schema: - type: string - default: "ix-minio" - editable: false + type: dict + attrs: + - variable: datasetName + label: "Minio Data Volume Dataset Name" + schema: + type: string + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix-minio" + editable: false + - variable: mountPath + label: "Minio Data Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + editable: false + default: "/export" + - variable: hostPathEnabled + label: "Enable Host Path for Minio Data Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Minio Data Volume" + schema: + type: hostpath + required: true diff --git a/test/minio/1.0.1/templates/deployment.yaml b/test/minio/1.0.1/templates/deployment.yaml index c184498c93..004a86e4f5 100644 --- a/test/minio/1.0.1/templates/deployment.yaml +++ b/test/minio/1.0.1/templates/deployment.yaml @@ -1,32 +1,17 @@ {{ $scheme := "http" }} -apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels" . | nindent 4 }} -spec: - strategy: - type: {{ .Values.updateStrategy }} - selector: - matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }} - template: - metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} - annotations: - checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} +{{ include "common.deployment.common_config" . | nindent 0 }} +spec: {{ include "common.deployment.common_spec" . | nindent 2 }} + template: {{ include "common.deployment.pod.metadata" . | nindent 4 }} spec: serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} + {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} command: - "/bin/sh" - "-ce" - "/usr/bin/docker-entrypoint.sh minio server /export {{ (.Values.extraArgs | default list) | join " " }}" - volumeMounts: - - name: export - mountPath: /export ports: - name: {{ $scheme }} containerPort: 9000 @@ -36,7 +21,4 @@ spec: {{ $envList = mustAppend $envList (dict "name" "MINIO_ACCESS_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }} {{ $envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }} {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} - volumes: - {{ $vols := list }} - {{ $vols = mustAppend $vols (dict "name" "export" "emptyDirVolumes" .Values.emptyDirVolumes "hostPathEnabled" .Values.minioHostPathEnabled "pathField" .Values.minioHostPath "datasetName" (.Values.minioDataVolume | default dict).datasetName ) }} - {{ include "common.storage.volumesConfiguration" (dict "ixVolumes" .Values.ixVolumes "volumes" $vols) | nindent 8 }} +{{ include "common.storage.allAppVolumes" .Values | nindent 6 }} diff --git a/test/plex/1.0.1/templates/deployment.yaml b/test/plex/1.0.1/templates/deployment.yaml index 42626ced23..6f3283aa64 100644 --- a/test/plex/1.0.1/templates/deployment.yaml +++ b/test/plex/1.0.1/templates/deployment.yaml @@ -1,6 +1,4 @@ -apiVersion: apps/v1 -kind: Deployment -{{ include "common.deployment.metadata" . | nindent 0 }} +{{ include "common.deployment.common_config" . | nindent 0 }} spec: {{ include "common.deployment.common_spec" . | nindent 2 }} template: {{ include "common.deployment.pod.metadata" . | nindent 4 }} spec: