Browse Source

Added rancher chart questions and worked around its limitation for dealing with arrays

master
Fábio Kaiser Rauber 4 years ago
parent
commit
cfc8028669
  1. 3
      charts/local-path-provisioner/v0.1.0/app-readme.md
  2. 70
      charts/local-path-provisioner/v0.1.0/questions.yaml
  3. 15
      charts/local-path-provisioner/v0.1.0/templates/configmap.yaml
  4. 19
      charts/local-path-provisioner/v0.1.0/values.yaml

3
charts/local-path-provisioner/v0.1.0/app-readme.md

@ -0,0 +1,3 @@
# Portal Modelo para Casas Legislativas
Utilize o formulário abaixo para configurar seu Portal Modelo.

70
charts/local-path-provisioner/v0.1.0/questions.yaml

@ -0,0 +1,70 @@
labels:
io.cattle.role: project
categories:
- Storage
questions:
# nodePathMap is the place user can customize where to store the data on each node.
# 1. If one node is not listed on the nodePathMap, and Kubernetes wants to create volume on it, the paths specified in
# DEFAULT_PATH_FOR_NON_LISTED_NODES will be used for provisioning.
# 2. If one node is listed on the nodePathMap, the specified paths will be used for provisioning.
# 1. If one node is listed but with paths set to [], the provisioner will refuse to provision on this node.
# 2. If more than one path was specified, the path would be chosen randomly when provisioning.
#
# The configuration must obey following rules:
# 1. A path must start with /, a.k.a an absolute path.
# 2. Root directory (/) is prohibited.
# 3. No duplicate paths allowed for one node.
# 4. No duplicate node allowed.
nodePathMap:
- node: DEFAULT_PATH_FOR_NON_LISTED_NODES
paths:
- variable: storageClass.create
default: true
type: boolean
description: "Create storageClass automatically?"
label: "Create storageClass?"
required: true
group: StorageClass
show_subquestion_if: true
subquestions:
- variable: storageClass.defaultClass
default: false
type: boolean
description: "StorageClass as the default StorageClass."
label: "Is this StorageClass the default class?"
required: false
- variable: storageClass.name
default: local-path
type: string
description: "Set a StorageClass name"
label: "StorageClass Name"
required: false
- variable: storageClass.reclaimPolicy
default: "Delete"
type: enum
description: "ReclaimPolicy field of the class, which can be either Delete or Retain"
label: "Reclaim Policy"
required: false
options:
- "Delete"
- "Reclaim"
- variable: storageClass.hostDir
default: "/opt/local-path-provisioner"
type: string
description: "Path for creating volumes in every node of the cluster. If you need custom paths, please edit the YAML directly and use customNodePathMap."
label: "Local host directory for volumes."
required: true
group: StorageClass
- variable: storageClass.provisionerName
default: "rancher.io/local-path"
description: "Set a provisioner name. If unset, a name will be generated."
label: "Provisioner Name"
type: string
group: Provisioner
required: false

15
charts/local-path-provisioner/v0.1.0/templates/configmap.yaml

@ -5,10 +5,23 @@ metadata:
labels: labels:
{{ include "local-path-provisioner.labels" . | indent 4 }} {{ include "local-path-provisioner.labels" . | indent 4 }}
data: data:
{{- if .Values.customNodePathMap }}
config.json: |- config.json: |-
{ {
"nodePathMap": {{ .Values.nodePathMap | toPrettyJson | nindent 8 }} "nodePathMap": {{ .Values.customNodePathMap | toPrettyJson | nindent 8 }}
} }
{{- else }}
config.json: |-
{
"nodePathMap":[
{
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
"paths":[{{ .Values.storageClass.hostDir | quote }}]
}
]
}
{{- end }}
setup: |- setup: |-
{{ .Values.configmap.setup | nindent 4 }} {{ .Values.configmap.setup | nindent 4 }}
teardown: |- teardown: |-

19
charts/local-path-provisioner/v0.1.0/values.yaml

@ -42,10 +42,14 @@ storageClass:
## ReclaimPolicy field of the class, which can be either Delete or Retain ## ReclaimPolicy field of the class, which can be either Delete or Retain
reclaimPolicy: Delete reclaimPolicy: Delete
# nodePathMap is the place user can customize where to store the data on each node. ## Default host path for creating volumes. If you need custom paths for nodes,
## please use customNodePathMap, in which case this setting is ignored.
hostDir: /opt/local-path-provisioner
# customNodePathMap is the place user can customize where to store the data on each node.
# 1. If one node is not listed on the nodePathMap, and Kubernetes wants to create volume on it, the paths specified in # 1. If one node is not listed on the nodePathMap, and Kubernetes wants to create volume on it, the paths specified in
# DEFAULT_PATH_FOR_NON_LISTED_NODES will be used for provisioning. # DEFAULT_PATH_FOR_NON_LISTED_NODES will be used for provisioning.
# 2. If one node is listed on the nodePathMap, the specified paths will be used for provisioning. # 2. If one node is listed on the customNodePathMap, the specified paths will be used for provisioning.
# 1. If one node is listed but with paths set to [], the provisioner will refuse to provision on this node. # 1. If one node is listed but with paths set to [], the provisioner will refuse to provision on this node.
# 2. If more than one path was specified, the path would be chosen randomly when provisioning. # 2. If more than one path was specified, the path would be chosen randomly when provisioning.
# #
@ -54,10 +58,13 @@ storageClass:
# 2. Root directory (/) is prohibited. # 2. Root directory (/) is prohibited.
# 3. No duplicate paths allowed for one node. # 3. No duplicate paths allowed for one node.
# 4. No duplicate node allowed. # 4. No duplicate node allowed.
nodePathMap: customNodePathMap: []
- node: DEFAULT_PATH_FOR_NON_LISTED_NODES # - node: DEFAULT_PATH_FOR_NON_LISTED_NODES
paths: # paths:
- /opt/local-path-provisioner # - /opt/local-path-provisioner
# - node: node1
# paths:
# - /mnt/otherfolder
rbac: rbac:
# Specifies whether RBAC resources should be created # Specifies whether RBAC resources should be created

Loading…
Cancel
Save