Unverified Commit 7e5b66e3 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by GitHub

Merge pull request #59 from truenas/NAS-110610

Allow specifying host path volumes/environment variables for chia
parents 1e3e4f26 14578c89
apiVersion: v1 apiVersion: v1
description: Global, Versioned, peer-to-peer filesystem. description: Global, Versioned, peer-to-peer filesystem.
name: chia name: chia
version: 1.0.0 version: 1.1.0
appVersion: 1.1.4 appVersion: 1.1.4
keywords: keywords:
- storage - storage
......
...@@ -3,6 +3,3 @@ image: ...@@ -3,6 +3,3 @@ image:
tag: 1.1.4 tag: 1.1.4
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
updateStrategy: Recreate updateStrategy: Recreate
environmentVariables:
- name: "keys"
value: "/plots/keyfile"
groups: groups:
- name: "Storage" - name: "Storage"
description: "Configure Storage for Chia" description: "Configure Storage for Chia"
- name: "Chia Environment Variables"
description: "Set the environment that will be visible to the container"
questions: questions:
- variable: appVolumeMounts - variable: appVolumeMounts
...@@ -79,3 +81,49 @@ questions: ...@@ -79,3 +81,49 @@ questions:
schema: schema:
type: hostpath type: hostpath
required: true required: true
- variable: extraAppVolumeMounts
label: "Chia Extra Host Path Volumes"
group: "Storage"
schema:
type: list
items:
- variable: extraAppVolume
label: "Chia Host Path Volume"
description: "Add an extra host path volume for chia application"
schema:
type: dict
attrs:
- variable: mountPath
label: "Mount Path in Pod"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
required: true
- variable: hostPath
label: "Host Path"
description: "Host path"
schema:
type: hostpath
required: true
- variable: environmentVariables
label: "Environment Variables for Chia"
group: "Chia Environment Variables"
schema:
type: list
default: []
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
...@@ -18,11 +18,22 @@ spec: ...@@ -18,11 +18,22 @@ spec:
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 }} volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
mountPath: {{ $hostPathConfiguration.mountPath }}
{{ end }}
ports: ports:
- name: chia-network - name: chia-network
protocol: TCP protocol: TCP
containerPort: 8444 containerPort: 8444
hostPort: 8444 hostPort: 8444
{{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }} {{ $envList := (default list .Values.environmentVariables) }}
{{ include "common.storage.allAppVolumes" .Values | nindent 6 }} {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }}
{{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ end }}
...@@ -3,9 +3,6 @@ image: ...@@ -3,9 +3,6 @@ image:
tag: 1.1.4 tag: 1.1.4
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
updateStrategy: Recreate updateStrategy: Recreate
environmentVariables:
- name: "keys"
value: "/plots/keyfile"
appVolumeMounts: appVolumeMounts:
staging: staging:
......
apiVersion: v1 apiVersion: v1
description: Global, Versioned, peer-to-peer filesystem. description: Global, Versioned, peer-to-peer filesystem.
name: chia name: chia
version: 1.0.0 version: 1.1.0
appVersion: 1.1.4 appVersion: 1.1.4
keywords: keywords:
- storage - storage
......
...@@ -3,6 +3,3 @@ image: ...@@ -3,6 +3,3 @@ image:
tag: 1.1.4 tag: 1.1.4
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
updateStrategy: Recreate updateStrategy: Recreate
environmentVariables:
- name: "keys"
value: "/plots/keyfile"
groups: groups:
- name: "Storage" - name: "Storage"
description: "Configure Storage for Chia" description: "Configure Storage for Chia"
- name: "Chia Environment Variables"
description: "Set the environment that will be visible to the container"
questions: questions:
- variable: appVolumeMounts - variable: appVolumeMounts
...@@ -79,3 +81,49 @@ questions: ...@@ -79,3 +81,49 @@ questions:
schema: schema:
type: hostpath type: hostpath
required: true required: true
- variable: extraAppVolumeMounts
label: "Chia Extra Host Path Volumes"
group: "Storage"
schema:
type: list
items:
- variable: extraAppVolume
label: "Chia Host Path Volume"
description: "Add an extra host path volume for chia application"
schema:
type: dict
attrs:
- variable: mountPath
label: "Mount Path in Pod"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
required: true
- variable: hostPath
label: "Host Path"
description: "Host path"
schema:
type: hostpath
required: true
- variable: environmentVariables
label: "Environment Variables for Chia"
group: "Chia Environment Variables"
schema:
type: list
default: []
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
...@@ -3,4 +3,4 @@ dependencies: ...@@ -3,4 +3,4 @@ dependencies:
repository: file://../../../library/common/2105.0.0 repository: file://../../../library/common/2105.0.0
version: 2105.0.0 version: 2105.0.0
digest: sha256:11522ab36487826700d7ad0f86f713a4bb5d35248014bcef690fe94acbc09ef6 digest: sha256:11522ab36487826700d7ad0f86f713a4bb5d35248014bcef690fe94acbc09ef6
generated: "2021-05-10T13:07:35.493091+05:00" generated: "2021-05-17T18:26:46.201544+05:00"
...@@ -18,11 +18,22 @@ spec: ...@@ -18,11 +18,22 @@ spec:
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 }} volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
mountPath: {{ $hostPathConfiguration.mountPath }}
{{ end }}
ports: ports:
- name: chia-network - name: chia-network
protocol: TCP protocol: TCP
containerPort: 8444 containerPort: 8444
hostPort: 8444 hostPort: 8444
{{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }} {{ $envList := (default list .Values.environmentVariables) }}
{{ include "common.storage.allAppVolumes" .Values | nindent 6 }} {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }}
{{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ end }}
...@@ -3,9 +3,6 @@ image: ...@@ -3,9 +3,6 @@ image:
tag: 1.1.4 tag: 1.1.4
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
updateStrategy: Recreate updateStrategy: Recreate
environmentVariables:
- name: "keys"
value: "/plots/keyfile"
appVolumeMounts: appVolumeMounts:
staging: staging:
......
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