This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Creating a Helm Chart that Supports Form Input

    Users can create a Helm chart that supports form input.

    Note
    Only available in Helm 3 or later versions.

    Form Input Support Helm Chart

    Using a Helm chart that supports form input, users can input each item through a user interface when installing the Helm chart.

    Helm Chart File Composition and values.schema.json File

    Helm Chart File Composition

    To support form input, a values.schema.json file is required in addition to the basic Helm chart file composition.

    Helm Chart Directory Structure
    Figure. Helm Chart Directory Structure

    Relationship between values.schema.json and values.yaml Files

    Relationship between values.schema.json and values.yaml files
    Figure. Relationship between values.schema.json and values.yaml files

    values.schema.json

    • A file defined in JSON Schema to validate the values entered in the values.yaml file.
    • DevOps Console provides additional features to display forms on the screen and allow users to easily input values.

    JSON Schema Basics

    The values.schema.json file used in DevOps Console supports the standard format defined in JSON Schema.

    Note

    For detailed guides on standard formats, please refer to the following sites:

    The basic properties are described as follows:

    PropertyDescriptionData TypeAllowed Values
    $schemastringhttp://json-schema.org/schema#
    typeData type
    • Determines the default rendering form based on the data type
    string
    • string
      • Creates an input field for string input
      • Combobox rendering if oneOf or enum exists
      • Password input rendering if render is password
    • number
      • Creates an input field for integer and decimal input
    • integer
      • Creates an input field for integer input
    • object
      • Defines a form group with properties
      • Used for hierarchical structure processing
    • array
      • Renders a list of input fields for multiple data input
    • boolean
      • Renders a checkbox
    • null
    titleLabelstringDefines the label for the item
    descriptionDescriptionstringDisplays as a tooltip
    readOnlyRead-only statusboolean
    • Default: false
    • The created form is displayed as read-only
    requiredList of required input itemsarraye.g., "required": ["username", "password"]
    Table. JSON Schema Property Items

    DevOps Console Defined Items

    The following items are defined in DevOps Console and only work in DevOps Console.

    PropertyDescriptionData TypeAllowed Values
    formDevOps Console screen display status
    • Only displays on the screen if set to true
    booleandefault: false
    renderRenderer changestring
    • password: Used for special processing (masking) in the form
    formatString format referencestring
    • ip, hostname, uri, etc.: Input formats provided by JSON Schema
    • password_confirm: Creates an input field for password confirmation
    form_localeDefined for internationalization processing
    • Uses the default property value if the set locale is not available
    • Supports Korean (ko) and English (en)
    object
    • ko
      • label
      • description
    • en
      • label
      • description
    Table. DevOps Console Defined Items

    Hierarchical Processing

    To process hierarchical structures, JSON Schema defines the "type": "object" property value and the properties property. Sub-properties are defined under the properties item.

    The following example defines the service.internalPort property.

    Color mode
    "service": {
        "type": "object",
        "form": true,
        "properties": {
            "internalPort": {
                "type": "number",
                "title": "Container Port",
                "description": "HTTP port to expose at container level",
                "form": true
            }
    <omitted>
    "service": {
        "type": "object",
        "form": true,
        "properties": {
            "internalPort": {
                "type": "number",
                "title": "Container Port",
                "description": "HTTP port to expose at container level",
                "form": true
            }
    <omitted>
    Hierarchical Processing Example

    Internationalization Processing

    For internationalization processing, use the form_locale property and define it as follows.

    Supports Korean and English.

    Color mode
    "db": {
      "type": "string",
      "title": "DB",
      "description": "choose db type",
      "oneOf": [
        {
          "const": "in",
          "title": "internal"
        },
        {
          "const": "ex",
          "title": "external"
        }
      ],
      "form": true,
      "form_locale": {
        "ko": {
          "label": "데이터베이스",
          "description": "데이터베이스 타입을 선택하세요",
          "internal": "내부",
          "external": "외부"
        },
        "en": {
          "label": "Database"
        }
      }
    }
    "db": {
      "type": "string",
      "title": "DB",
      "description": "choose db type",
      "oneOf": [
        {
          "const": "in",
          "title": "internal"
        },
        {
          "const": "ex",
          "title": "external"
        }
      ],
      "form": true,
      "form_locale": {
        "ko": {
          "label": "데이터베이스",
          "description": "데이터베이스 타입을 선택하세요",
          "internal": "내부",
          "external": "외부"
        },
        "en": {
          "label": "Database"
        }
      }
    }
    Internationalization Processing Example

    values.schema.json Writing Example

    Form Type Examples

    Input

    To display the defined fields in the values.schema.json file as a form on the screen, set the form field value to true.

    Color mode
    {
      "$schema": "http://json-schema.org/schema#",
      "type": "object",
      "properties": {
        "form_field": {
          "type": "string", 
          "form": true 
        },
        "hide_field": { 
          "type": "string"
        }
      }
    }
    {
      "$schema": "http://json-schema.org/schema#",
      "type": "object",
      "properties": {
        "form_field": {
          "type": "string", 
          "form": true 
        },
        "hide_field": { 
          "type": "string"
        }
      }
    }
    Input Processing Example

    Password

    Color mode
    {
      "$schema": "http://json-schema.org/schema#",
      "type": "object",
      "properties": {
        "password_field": {
          "type": "string",
          "form": true,
          "render": "password", 
          "format": "password_confirm" 
        }
      }
    }
    {
      "$schema": "http://json-schema.org/schema#",
      "type": "object",
      "properties": {
        "password_field": {
          "type": "string",
          "form": true,
          "render": "password", 
          "format": "password_confirm" 
        }
      }
    }
    Password Processing Example

    Checkbox

    Color mode
    "enabled": {
      "title": "enable persistence",
      "type": "boolean",
      "form": true
    }
    "enabled": {
      "title": "enable persistence",
      "type": "boolean",
      "form": true
    }
    Checkbox Processing Example

    To display a dropdown field on the screen and specify allowed values, use the enum and oneOf properties.

    enum

    Used when the displayed text and stored value are the same.

    Color mode
    "postgres": {
      "type": "string",
      "title": "Postgres",
      "description": "choose PostgreSQL type.",
      "enum": [
        "internal",
        "external",
        "both"
      ],
      "form": true
    }
    "postgres": {
      "type": "string",
      "title": "Postgres",
      "description": "choose PostgreSQL type.",
      "enum": [
        "internal",
        "external",
        "both"
      ],
      "form": true
    }
    enum Processing Example

    oneOf

    Used when the displayed text and stored value are different.

    Color mode
    "Oneof": {
      "type": "string",
      "title": "DB",
      "description": "choose db type",
      "oneOf": [
        {
          "const": "in", 
          "title": "internal" 
        },
        {
          "const": "ex",
          "title": "external"
        }
      ],
      "form": true
    }
    "Oneof": {
      "type": "string",
      "title": "DB",
      "description": "choose db type",
      "oneOf": [
        {
          "const": "in", 
          "title": "internal" 
        },
        {
          "const": "ex",
          "title": "external"
        }
      ],
      "form": true
    }
    oneOf Processing Example

    Array

    Color mode
    "Array": {
      "type": "array",
      "items": {
        "type": "string",
        "form": true
      },
      "form": true
    }
    "Array": {
      "type": "array",
      "items": {
        "type": "string",
        "form": true
      },
      "form": true
    }
    Array Processing Example

    Object Array

    Color mode
    "objectArray": {
      "type": "array",
      "title": "Object Array",
      "form": true,
      "items": {
        "type": "object",
        "form": true,
        "properties": {
          "host": {
            "type": "string",
            "form": true
          },
          "path": {
            "type": "string",
            "form": true
          }
        }
      }
    }
    "objectArray": {
      "type": "array",
      "title": "Object Array",
      "form": true,
      "items": {
        "type": "object",
        "form": true,
        "properties": {
          "host": {
            "type": "string",
            "form": true
          },
          "path": {
            "type": "string",
            "form": true
          }
        }
      }
    }
    Object Array Processing Example

    values.schema.json full file writing example

    system-nginx

    Color mode
    {
        "$schema": "http://json-schema.org/schema#",
        "type": "object",
        "form": true,
        "properties": {
            "service": {
                "type": "object",
                "form": true,
                "properties": {
                    "type": {
                        "type": "string",
                        "title": "Service Type",
                        "form": true,
                        "enum": ["ClusterIP", "NodePort", "LoadBalancer", "ExternalName"]
                    },
                    "externalPort": {
                        "type": "number",
                        "title": "Service Port",
                        "description": "HTTP port to expose at service level",
                        "form": true
                    },
                    "internalPort": {
                        "type": "number",
                        "title": "Container Port",
                        "description": "HTTP port to expose at container level",
                        "form": true
                    }
                },
                "required": ["type", "externalPort", "internalPort"]
            },
            "ingress": {
                "type": "object",
                "form": true,
                "properties": {
                    "enabled": {
                        "type": "boolean",
                        "title": "Use Ingress",
                        "form": true
                    },
                    "domain": {
                        "type": ["string", "null"],
                        "format": "hostname",
                        "title": "Ingress Domain",
                        "description": "Default host for the ingress resource (required when `ingress.enabled=true`)",
                        "form": true
                    }
                }
            },
            "networkPolicy": {
                "type": "object",
                "form": true,
                "properties": {
                    "enabled": {
                        "type": "boolean",
                        "title": "Use NetworkPolicy",
                        "form": true
                    }
                }
            }
        }
    }
    {
        "$schema": "http://json-schema.org/schema#",
        "type": "object",
        "form": true,
        "properties": {
            "service": {
                "type": "object",
                "form": true,
                "properties": {
                    "type": {
                        "type": "string",
                        "title": "Service Type",
                        "form": true,
                        "enum": ["ClusterIP", "NodePort", "LoadBalancer", "ExternalName"]
                    },
                    "externalPort": {
                        "type": "number",
                        "title": "Service Port",
                        "description": "HTTP port to expose at service level",
                        "form": true
                    },
                    "internalPort": {
                        "type": "number",
                        "title": "Container Port",
                        "description": "HTTP port to expose at container level",
                        "form": true
                    }
                },
                "required": ["type", "externalPort", "internalPort"]
            },
            "ingress": {
                "type": "object",
                "form": true,
                "properties": {
                    "enabled": {
                        "type": "boolean",
                        "title": "Use Ingress",
                        "form": true
                    },
                    "domain": {
                        "type": ["string", "null"],
                        "format": "hostname",
                        "title": "Ingress Domain",
                        "description": "Default host for the ingress resource (required when `ingress.enabled=true`)",
                        "form": true
                    }
                }
            },
            "networkPolicy": {
                "type": "object",
                "form": true,
                "properties": {
                    "enabled": {
                        "type": "boolean",
                        "title": "Use NetworkPolicy",
                        "form": true
                    }
                }
            }
        }
    }
    values.schema.json full file writing example