Commit 0d8d1111 authored by Waqar Ahmed's avatar Waqar Ahmed

Update minio chart to use new format for storage

parent c03f6f5b
def migrate(values):
values.update({
'appVolumeMounts': {
'export': {
'hostPathEnabled': values['minioHostPathEnabled'],
**({'hostPath': values['minioHostPath']} if values.get('minioHostPath') else {})
},
},
})
return values
...@@ -138,28 +138,26 @@ questions: ...@@ -138,28 +138,26 @@ questions:
default: 9000 default: 9000
required: true required: true
- variable: minioHostPathEnabled - variable: appVolumeMounts
label: "Configure Host Path for Minio data" label: "Minio Storage"
group: "Storage" group: "Storage"
schema: schema:
type: boolean type: dict
default: false attrs:
show_subquestions_if: true - variable: export
subquestions: label: "Data Volume"
- variable: minioHostPath
label: "Specify HostPath for Minio data"
schema:
type: hostpath
- variable: minioDataVolume
label: "Minio Data Volume Defaults"
group: "Storage"
schema: schema:
type: dict type: dict
attrs:
- variable: datasetName
label: "Minio Data Volume Dataset Name"
schema:
type: string
$ref: $ref:
- "normalize/ixVolume" - "normalize/ixVolume"
show_if: [["minioHostPathEnabled", "=", false]] show_if: [["hostPathEnabled", "=", false]]
attrs: default: "ix-minio"
editable: false
- variable: mountPath - variable: mountPath
label: "Minio Data Mount Path" label: "Minio Data Mount Path"
description: "Path where the volume will be mounted inside the pod" description: "Path where the volume will be mounted inside the pod"
...@@ -167,9 +165,15 @@ questions: ...@@ -167,9 +165,15 @@ questions:
type: path type: path
editable: false editable: false
default: "/export" default: "/export"
- variable: datasetName - variable: hostPathEnabled
label: "Minio Dataset Name" label: "Enable Host Path for Minio Data Volume"
schema: schema:
type: string type: boolean
default: "ix-minio" default: false
editable: false show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Minio Data Volume"
schema:
type: hostpath
required: true
{{ $scheme := "http" }} {{ $scheme := "http" }}
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} {{ include "common.deployment.common_config" . | nindent 0 }}
kind: Deployment spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
metadata: template: {{ include "common.deployment.pod.metadata" . | nindent 4 }}
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 }}
spec: spec:
serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }} serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
command: command:
- "/bin/sh" - "/bin/sh"
- "-ce" - "-ce"
- "/usr/bin/docker-entrypoint.sh minio server /export {{ (.Values.extraArgs | default list) | join " " }}" - "/usr/bin/docker-entrypoint.sh minio server /export {{ (.Values.extraArgs | default list) | join " " }}"
volumeMounts:
- name: export
mountPath: /export
ports: ports:
- name: {{ $scheme }} - name: {{ $scheme }}
containerPort: 9000 containerPort: 9000
...@@ -36,7 +21,4 @@ spec: ...@@ -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_ACCESS_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }}
{{ $envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }} {{ $envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
volumes: {{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
{{ $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 }}
apiVersion: apps/v1 {{ include "common.deployment.common_config" . | nindent 0 }}
kind: Deployment
{{ include "common.deployment.metadata" . | nindent 0 }}
spec: {{ include "common.deployment.common_spec" . | nindent 2 }} spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
template: {{ include "common.deployment.pod.metadata" . | nindent 4 }} template: {{ include "common.deployment.pod.metadata" . | nindent 4 }}
spec: spec:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment