2021-02-25 16:09:50 +00:00
# TrueNAS SCALE Chart Structure
2021-09-29 10:47:48 +00:00
This is a general synopsis about the structure of a SCALE App and/or Helm Chart, it does not directly reflect TrueCharts specific settings.
2021-02-25 16:09:50 +00:00
2021-09-29 10:47:48 +00:00
The following files are generally considered to be a "normal" Helm chart:
2021-02-25 16:09:50 +00:00
```
2021-05-23 16:30:34 +00:00
charts/< train > /< chart name > /
2021-02-25 16:09:50 +00:00
charts/ # Directory containing dependency charts
Chart.yaml # Required Helm chart information file
README.md # Optional: Helm Readme file (will be rendered in TrueNAS SCALE UI as well)
templates/ # A directory of templates that, when combined with values.yml will generate K8s YAML
values.yaml # The default configuration values for this chart
```
2021-05-23 16:30:34 +00:00
2021-09-29 10:47:48 +00:00
The following files are specific for TrueNAS SCALE:
2021-05-23 16:30:34 +00:00
```
2021-09-29 10:47:48 +00:00
charts/< train > /< chart name > /SCALE/
app-readme.md # TrueNAS SCALE Specific: Readme file for display in TrueNAS SCALE UI, automatically generated
2021-05-23 16:30:34 +00:00
questions.yaml # TrueNAS SCALE Specific: File containing questions for TrueNAS SCALE UI
ix_values.yaml # Hidden configuration values when installing using TrueNAS SCALE
2021-09-29 10:47:48 +00:00
item.yaml # Contains generic information about the App for the TrueNAS SCALE UI
2021-05-23 16:30:34 +00:00
```
2021-03-01 19:42:26 +00:00
*See the upstream Helm chart [developer reference ](https://helm.sh/docs/chart_template_guide/ ) for a complete walk through of developing charts.*
2021-02-25 16:09:50 +00:00
To convert an upstream chart to take advantage of TrueNAS SCALE enhanced UX, first create an `item.yaml` file.
This file among other catalog item information provides a list of categories that this chart fits into. This helps users navigate and filtering when browsing the catalog UI.
```
2021-05-23 16:30:34 +00:00
$ cat charts/< train > /< chart name > /SCALE/item.yaml
2021-02-25 16:09:50 +00:00
categories:
- generic
icon_url: "http://ix_url"
```
Then add a `questions.yaml` file to prompt the user for something.
```
groups:
- name: "Container Images"
description: "Image to be used for container"
questions:
- variable: image
description: "Docker Image Details"
group: "Container Images"
schema:
type: dict
required: true
attrs:
- variable: repository
description: "Docker image repository"
label: "Image repository"
schema:
type: string
required: true
- variable: tag
description: "Tag to use for specified image"
label: "Image Tag"
schema:
type: string
default: "latest"
- variable: pullPolicy
description: "Docker Image Pull Policy"
label: "Image Pull Policy"
schema:
type: string
default: "IfNotPresent"
enum:
- value: "IfNotPresent"
description: "Only pull image if not present on host"
- value: "Always"
description: "Always pull image even if present on host"
- value: "Never"
description: "Never pull image even if it's not present on host"
```
The above will prompt the user with 2 text fields and a dropdown in the UI getting details for image configuration in a helm chart.
2021-03-01 19:42:26 +00:00
_More information about questions.yaml is available [here ](https://wiki.truecharts.org/development/questions-yaml/ )_