From 7def30045257f38d81afdc21b41c1811096bbfaa Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sat, 29 May 2021 13:57:47 +0200 Subject: [PATCH] Add new GUI prototype (#524) * initial work at re-adding ingress * add externalInterfaces gui * Add Controller section * mark some things as "Advanced" * fix mistake * add empty controller label * Add resources section --- charts/develop/prototype-gui/.helmignore | 24 + charts/develop/prototype-gui/CONFIG.md | 8 + charts/develop/prototype-gui/Chart.yaml | 23 + charts/develop/prototype-gui/README.md | 56 ++ charts/develop/prototype-gui/SCALE/item.yaml | 3 + .../prototype-gui/SCALE/ix_values.yaml | 15 + .../prototype-gui/SCALE/questions.yaml | 619 ++++++++++++++++++ charts/develop/prototype-gui/app-readme.md | 2 + .../prototype-gui/templates/common.yaml | 1 + charts/develop/prototype-gui/values.yaml | 33 + docs/development/app development/ingress.md | 110 ++-- 11 files changed, 834 insertions(+), 60 deletions(-) create mode 100644 charts/develop/prototype-gui/.helmignore create mode 100644 charts/develop/prototype-gui/CONFIG.md create mode 100644 charts/develop/prototype-gui/Chart.yaml create mode 100644 charts/develop/prototype-gui/README.md create mode 100644 charts/develop/prototype-gui/SCALE/item.yaml create mode 100644 charts/develop/prototype-gui/SCALE/ix_values.yaml create mode 100644 charts/develop/prototype-gui/SCALE/questions.yaml create mode 100644 charts/develop/prototype-gui/app-readme.md create mode 100644 charts/develop/prototype-gui/templates/common.yaml create mode 100644 charts/develop/prototype-gui/values.yaml diff --git a/charts/develop/prototype-gui/.helmignore b/charts/develop/prototype-gui/.helmignore new file mode 100644 index 00000000000..e559de0a012 --- /dev/null +++ b/charts/develop/prototype-gui/.helmignore @@ -0,0 +1,24 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# OWNERS file for Kubernetes +OWNERS diff --git a/charts/develop/prototype-gui/CONFIG.md b/charts/develop/prototype-gui/CONFIG.md new file mode 100644 index 00000000000..6d760c18421 --- /dev/null +++ b/charts/develop/prototype-gui/CONFIG.md @@ -0,0 +1,8 @@ +# Configuration Options + +##### Connecting to other apps +If you need to connect this App to other Apps on TrueNAS SCALE, please refer to our "Linking Apps Together" guide: +https://truecharts.org/manual/linking/ + +##### Available config options +In the future this page is going to contain an automated list of options available in the installation/edit UI. diff --git a/charts/develop/prototype-gui/Chart.yaml b/charts/develop/prototype-gui/Chart.yaml new file mode 100644 index 00000000000..9578a056548 --- /dev/null +++ b/charts/develop/prototype-gui/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +appVersion: auto +dependencies: +- name: common + repository: https://truecharts.org/ + version: 5.1.1 +deprecated: false +description: App to test GUI prototypes +home: https://github.com/truecharts/apps/tree/master/develop/prototype-gui +icon: https://truecharts.org/_static/img/jackett-icon.png +keywords: +- dev +- prototype +kubeVersion: '>=1.16.0-0' +maintainers: +- email: info@truecharts.org + name: TrueCharts + url: truecharts.org +name: prototype-gui +sources: +- https://github.com/truecharts/apps/tree/master/develop/prototype-gui +type: application +version: 0.0.1 diff --git a/charts/develop/prototype-gui/README.md b/charts/develop/prototype-gui/README.md new file mode 100644 index 00000000000..88c3c913b18 --- /dev/null +++ b/charts/develop/prototype-gui/README.md @@ -0,0 +1,56 @@ +# Introduction + +![Version: 3.1.5](https://img.shields.io/badge/Version-3.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: auto](https://img.shields.io/badge/AppVersion-auto-informational?style=flat-square) + +API Support for your favorite torrent trackers. + +TrueCharts are designed to be installed as TrueNAS SCALE app only. We can not guarantee this charts works as a stand-alone helm installation. +**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/apps/issues/new/choose)** + +## Source Code + +* +* +* +* + +## Requirements + +Kubernetes: `>=1.16.0-0` + +## Dependencies + +| Repository | Name | Version | +|------------|------|---------| +| https://truecharts.org/ | common | 3.5.5 | + +## Installing the Chart + +To install the chart with the release name `jackett` + +- Open TrueNAS SCALE +- Go to Apps +- Click "Install" for this specific Apps +- Fill out the configuration form + +## Uninstalling the Chart + +To uninstall the `jackett` deployment + +- Open TrueNAS SCALE +- Go to Apps +- Go to "Installed Apps" +- Expand the menu in the top-right corner of this App +- Click "Remove" for this specific Apps + +The command removes all the Kubernetes components associated with the chart **including storage volumes** _(Except hostPath Storage)_ and deletes the release. + +## Support + +- See the [Wiki](https://truecharts.org) +- Open a [issue](https://github.com/truecharts/apps/issues/new/choose) +- Ask a [question](https://github.com/truecharts/apps/discussions) + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) +All Rights Reserved - The TrueCharts Project diff --git a/charts/develop/prototype-gui/SCALE/item.yaml b/charts/develop/prototype-gui/SCALE/item.yaml new file mode 100644 index 00000000000..8d747307488 --- /dev/null +++ b/charts/develop/prototype-gui/SCALE/item.yaml @@ -0,0 +1,3 @@ +categories: + - media +icon_url: https://truecharts.org/_static/img/jackett-icon.png diff --git a/charts/develop/prototype-gui/SCALE/ix_values.yaml b/charts/develop/prototype-gui/SCALE/ix_values.yaml new file mode 100644 index 00000000000..a3e7980fa84 --- /dev/null +++ b/charts/develop/prototype-gui/SCALE/ix_values.yaml @@ -0,0 +1,15 @@ +## +# This file contains Values.yaml content that gets added to the output of questions.yaml +# It's ONLY meant for content that the user is NOT expected to change. +# Example: Everything under "image" is not included in questions.yaml but is included here. +## + +image: + repository: ghcr.io/truecharts/jackett + pullPolicy: IfNotPresent + tag: v0.18.145 + +## +# Most other defaults are set in questions.yaml +# For other options please refer to the wiki, default_values.yaml or the common library chart +## diff --git a/charts/develop/prototype-gui/SCALE/questions.yaml b/charts/develop/prototype-gui/SCALE/questions.yaml new file mode 100644 index 00000000000..a75545c0e4d --- /dev/null +++ b/charts/develop/prototype-gui/SCALE/questions.yaml @@ -0,0 +1,619 @@ +groups: + - name: "Container Image" + description: "Image to be used for container" + - name: "Controller" + description: "Configure workload deployment" + - name: "Configuration" + description: "additional container configuration" + - name: "Networking" + description: "Configure Network and Services for container" + - name: "Storage" + description: "Persist and share data that is separate from the lifecycle of the container" + - name: "Ingress" + description: "Ingress Configuration" + - name: "Security" + description: "Configure security context" + - name: "Resources and Devices" + description: "Specify resources/devices to be allocated to workload" + - name: "Advanced" + description: "Advanced Configuration" + - name: "WARNING" + description: "WARNING" +portals: + web_portal: + protocols: + - "$kubernetes-resource_configmap_portal_protocol" + host: + - "$kubernetes-resource_configmap_portal_host" + ports: + - "$kubernetes-resource_configmap_portal_port" +questions: + - variable: portal + group: "Container Image" + label: "Configure Portal Button" + schema: + type: dict + hidden: true + attrs: + - variable: enabled + label: "Enable" + description: "enable the portal button" + schema: + hidden: true + editable: false + type: boolean + default: true + - variable: controller + group: "Controller" + label: "" + schema: + type: dict + attrs: + - variable: type + description: "Please specify type of workload to deploy" + label: "(Advanced) Controller Type" + schema: + type: string + default: "Deployment" + required: true + enum: + - value: "Deployment" + description: "Deploy a Deployment workload" + - value: "Job" + description: "Deploy job workload" + - value: "CronJob" + description: "Deploy cronjob workload" + - variable: replicas + description: "Number of desired pod replicas" + label: "Desired Replicas" + schema: + type: int + default: 1 + required: true + - variable: strategy + description: "Please specify type of workload to deploy" + label: "(Advanced) Update Strategy" + schema: + type: string + default: "Recreate" + required: true + enum: + - value: "Recreate" + description: "Kill existing pods before creating new ones" + - value: "RollingUpdate" + description: "Create new pods and then kill old ones" + - value: "OnDelete" + description: "Do not automatically update a StatefullSet with changes to .spec.template" + + - variable: env + group: "Configuration" + label: "Image Environment" + schema: + type: dict + attrs: + - variable: TZ + label: "Timezone" + schema: + type: string + default: "Etc/UTC" + $ref: + - "definitions/timezone" + - variable: UMASK + label: "UMASK" + description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" + schema: + type: string + default: "002" + # Configure Enviroment Variables + - variable: envList + label: "Image environment" + group: "Configuration" + schema: + type: list + default: [] + items: + - variable: envItem + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: externalInterfaces + description: "Add External Interfaces" + label: "(Advanced) Add external Interfaces" + group: "Networking" + schema: + type: list + items: + - variable: interfaceConfiguration + description: "Interface Configuration" + label: "Interface Configuration" + schema: + type: dict + $ref: + - "normalize/interfaceConfiguration" + attrs: + - variable: hostInterface + description: "Please specify host interface" + label: "Host Interface" + schema: + type: string + required: true + $ref: + - "definitions/interface" + - variable: ipam + description: "Define how IP Address will be managed" + label: "IP Address Management" + schema: + type: dict + required: true + attrs: + - variable: type + description: "Specify type for IPAM" + label: "IPAM Type" + schema: + type: string + required: true + enum: + - value: "dhcp" + description: "Use DHCP" + - value: "static" + description: "Use static IP" + show_subquestions_if: "static" + subquestions: + - variable: staticIPConfigurations + label: "Static IP Addresses" + schema: + type: list + items: + - variable: staticIP + label: "Static IP" + schema: + type: ipaddr + cidr: true + - variable: staticRoutes + label: "Static Routes" + schema: + type: list + items: + - variable: staticRouteConfiguration + label: "Static Route Configuration" + schema: + type: dict + attrs: + - variable: destination + label: "Destination" + schema: + type: ipaddr + cidr: true + required: true + - variable: gateway + label: "Gateway" + schema: + type: ipaddr + cidr: false + required: true + - variable: hostNetwork + group: "Networking" + label: "(Advanced) Enable Host Networking" + schema: + type: boolean + default: false + - variable: service + group: "Networking" + label: "Configure Service(s)" + schema: + type: dict + attrs: + - variable: main + label: "Main Service" + description: "The Primary service on which the healthcheck runs, often the webUI" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable the service" + schema: + type: boolean + default: true + hidden: true + - variable: type + label: "Service Type" + description: "ClusterIP's are only internally available, nodePorts expose the container to the host node System, Loadbalancer exposes the service using the system loadbalancer" + schema: + type: string + default: "NodePort" + enum: + - value: "NodePort" + description: "NodePort" + - value: "ClusterIP" + description: "ClusterIP" + - value: "LoadBalancer" + description: "(Advanced) LoadBalancer" + - variable: loadBalancerIP + label: "LoadBalancer IP" + description: "LoadBalancerIP" + schema: + show_if: [["type", "=", "LoadBalancer"]] + type: string + default: "" + - variable: externalIPs + label: "External IP's" + description: "External IP's" + schema: + show_if: [["type", "=", "LoadBalancer"]] + type: list + default: [] + items: + - variable: externalIP + label: "External IP" + schema: + type: string + - variable: ports + label: "Service's Port(s) Configuration" + schema: + type: dict + attrs: + - variable: main + label: "Main Service Port Configuration" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable the port" + schema: + type: boolean + default: true + hidden: true + - variable: protocol + label: "Port Type" + schema: + type: string + default: "HTTP" + enum: + - value: HTTP + description: "HTTP" + - value: "HTTPS" + description: "HTTPS" + - value: TCP + description: "TCP" + - value: "UDP" + description: "UDP" + - variable: port + label: "Container Port" + schema: + type: int + default: 9117 + editable: false + hidden: true + - variable: targetport + label: "Target Port" + description: "This port exposes the container port on the service" + schema: + type: int + default: 9117 + editable: true + required: true + - variable: nodePort + label: "Node Port (Optional)" + description: "This port gets exposed to the node. Only considered when service type is NodePort" + schema: + type: int + min: 9000 + max: 65535 + default: 36009 + required: true + ## TrueCharts Specific + - variable: persistence + label: "Integrated Persistent Storage" + group: "Storage" + schema: + type: dict + attrs: + - variable: config + label: "App Config Storage" + description: "Stores the Application Configuration." + schema: + type: dict + attrs: + - variable: enabled + label: "Enable the storage" + schema: + type: boolean + default: true + - variable: storageClass + label: "(Advanced) Type of Storage" + description: " Warning: Anything other than SCALE-ZFS will break rollback!" + schema: + type: string + default: "SCALE-ZFS" + - variable: mountPath + label: "mountPath" + description: "Path inside the container the storage is mounted" + schema: + type: string + default: "/config" + hidden: true + - variable: emptyDir + label: "EmptyDir Volume" + schema: + type: dict + attrs: + - variable: enabled + label: "(Advanced) Use emptyDir volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: medium + label: "EmptyDir Medium" + schema: + type: string + default: "" + enum: + - value: "" + description: "Default" + - value: "Memory" + description: "Memory" + - variable: accessMode + label: "Access Mode (Advanced)" + description: "Allow or disallow multiple PVC's writhing to the same PVC" + schema: + type: string + default: "ReadWriteOnce" + enum: + - value: "ReadWriteOnce" + description: "ReadWriteOnce" + - value: "ReadOnlyMany" + description: "ReadOnlyMany" + - value: "ReadWriteMany" + description: "ReadWriteMany" + - variable: size + label: "Size quotum of storage" + schema: + type: string + default: "100Gi" + - variable: hostPathMounts + label: "Custom app storage" + group: "Storage" + schema: + type: list + default: [] + items: + - variable: volumeMount + label: "Custom Storage" + schema: + type: dict + attrs: + - variable: enabled + label: "Enabled" + schema: + type: boolean + default: true + hidden: true + - variable: setPermissions + label: "Automatic Permissions" + description: "Automatically set permissions on install" + schema: + type: boolean + default: true + - variable: readOnly + label: "Mount as ReadOnly" + description: "prevent any write from being done to the mounted volume" + schema: + type: boolean + default: false + - variable: emptyDir + label: "EmptyDir Volume" + schema: + type: dict + attrs: + - variable: enabled + label: "(Advanced) Use emptyDir volume" + schema: + type: boolean + default: false + - variable: medium + label: "EmptyDir Medium" + schema: + type: string + default: "" + enum: + - value: "" + description: "Default" + - value: "Memory" + description: "Memory" + - variable: mountPath + label: "Mount Path" + description: "Path to mount inside the pod" + schema: + type: path + required: true + default: "" + editable: true + - variable: hostPath + label: "Host Path" + description: "Path on the host to mount inside the container, ignored when emptyDir is enabled" + schema: + type: hostpath + required: true + + - variable: ingress + label: "" + group: "Ingress" + schema: + type: dict + attrs: + - variable: main + label: "Main Ingress" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable Ingress" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hosts + label: "Hosts" + schema: + type: list + default: [] + items: + - variable: host + label: "Host" + schema: + type: dict + attrs: + - variable: host + label: "HostName" + schema: + type: string + default: "" + required: true + - variable: paths + label: "Hosts" + schema: + type: list + default: [] + items: + - variable: path + label: "path" + schema: + type: string + required: true + hidden: false + default: "/" + - variable: pathType + label: "pathType" + schema: + type: string + required: true + hidden: false + default: "Prefix" + - variable: tls + label: "TLS-Settings" + schema: + type: list + default: [] + items: + - variable: hosts + label: "Certificate Hosts" + schema: + type: list + default: [] + items: + - variable: host + label: "Host" + schema: + type: string + default: "" + required: true + - variable: scaleCERT + label: "Select TrueNAS SCALE Certificate" + schema: + type: int + $ref: + - "definitions/certificate" + + # Enable privileged + - variable: securityContext + group: "Security" + label: "Security Context" + schema: + type: dict + attrs: + - variable: privileged + label: "(Advanced) Enable privileged mode for Common-Chart based charts" + schema: + type: boolean + default: false + # Set Pod Security Policy + - variable: podSecurityContext + group: "Security" + label: "Pod Security Context" + schema: + type: dict + attrs: + - variable: runAsNonRoot + label: "runAsNonRoot" + schema: + type: boolean + default: true + - variable: runAsUser + label: "runAsUser" + description: "The UserID of the user running the application" + schema: + type: int + default: 568 + - variable: runAsGroup + label: "runAsGroup" + description: The groupID this App of the user running the application" + schema: + type: int + default: 568 + - variable: fsGroup + label: "fsGroup" + description: "The group that should own ALL storage." + schema: + type: int + default: 568 + - variable: fsGroupChangePolicy + label: "(Advanced) When should we take ownership?" + schema: + type: string + default: "OnRootMismatch" + enum: + - value: "OnRootMismatch" + description: "OnRootMismatch" + - value: "Always" + description: "Always" + + + - variable: resources + group: "Resources and Devices" + label: "" + schema: + type: dict + attrs: + - variable: limits + label: "(Advanced) Limit Resource Consumption" + schema: + type: dict + attrs: + - variable: cpu + label: "CPU" + schema: + type: string + default: "100m" + - variable: memory + label: "Memory (RAM)" + schema: + type: string + default: "128Mi" + - variable: requests + label: "(Advanced) Request minimum resources required" + schema: + type: dict + attrs: + - variable: cpu + label: "CPU" + schema: + type: string + default: "10m" + - variable: memory + label: "Memory (RAM)" + schema: + type: string + default: "50Mi" diff --git a/charts/develop/prototype-gui/app-readme.md b/charts/develop/prototype-gui/app-readme.md new file mode 100644 index 00000000000..7d3c709fdff --- /dev/null +++ b/charts/develop/prototype-gui/app-readme.md @@ -0,0 +1,2 @@ +API Support for your favorite torrent trackers. +This App is supplied by TrueCharts, for more information please visit https://truecharts.org diff --git a/charts/develop/prototype-gui/templates/common.yaml b/charts/develop/prototype-gui/templates/common.yaml new file mode 100644 index 00000000000..a6613c2ce21 --- /dev/null +++ b/charts/develop/prototype-gui/templates/common.yaml @@ -0,0 +1 @@ +{{ include "common.all" . }} diff --git a/charts/develop/prototype-gui/values.yaml b/charts/develop/prototype-gui/values.yaml new file mode 100644 index 00000000000..994164ee135 --- /dev/null +++ b/charts/develop/prototype-gui/values.yaml @@ -0,0 +1,33 @@ +# Default values for Jackett. + +image: + repository: ghcr.io/truecharts/jackett + pullPolicy: IfNotPresent + tag: v0.18.145 + +strategy: + type: Recreate + + +service: + main: + enabled: true + ports: + main: + port: 9117 + +env: {} + # TZ: UTC + # PUID: 1001 + # PGID: 1001 + + +persistence: + config: + enabled: true + mountPath: "/config" + emptyDir: + enabled: true + accessMode: ReadWriteOnce + size: 1Gi + storageClass: "" diff --git a/docs/development/app development/ingress.md b/docs/development/app development/ingress.md index e940961a6e1..777e41a12f0 100644 --- a/docs/development/app development/ingress.md +++ b/docs/development/app development/ingress.md @@ -38,47 +38,23 @@ We try to maintain as much of a standardised questions.yaml format as possible, ``` - variable: ingress - label: "" - group: "Reverse Proxy Configuration" + label: "Ingress Configuration" + group: "Ingress Configuration" schema: type: dict attrs: - - variable: webui - label: "Web Reverse Proxy Configuration" + - variable: main + label: "Main Ingress" schema: type: dict attrs: - variable: enabled - label: "Enable Web Reverse Proxy" + label: "Enable Ingress" schema: type: boolean default: false show_subquestions_if: true subquestions: - - variable: type - label: "Reverse Proxy Type" - schema: - type: string - default: "HTTP" - hidden: true - editable: false - required: true - - variable: serviceName - label: "Service name to proxy to" - schema: - hidden: true - editable: false - type: string - default: "" - - variable: entrypoint - label: "Select Entrypoint" - schema: - type: string - default: "websecure" - required: true - enum: - - value: "websecure" - description: "Websecure: HTTPS/TLS port 443" - variable: hosts label: "Hosts" schema: @@ -91,41 +67,55 @@ We try to maintain as much of a standardised questions.yaml format as possible, type: dict attrs: - variable: host - label: "Domain Name" - required: true - schema: - type: string - - variable: path - label: "path" + label: "HostName" schema: type: string + default: "" required: true - hidden: true - default: "/" - - variable: certType - label: "Select Certificate Type" + - variable: paths + label: "Hosts" + schema: + type: list + default: [] + items: + - variable: path + label: "path" + schema: + type: string + required: true + hidden: false + default: "/" + - variable: pathType + label: "pathType" + schema: + type: string + required: true + hidden: false + default: "Prefix" + - variable: tls + label: "TLS-Settings" schema: - type: string - default: "selfsigned" - enum: - - value: "" - description: "No Encryption/TLS/Certificates" - - value: "selfsigned" - description: "Self-Signed Certificate" - - value: "ixcert" - description: "TrueNAS SCALE Certificate" - - variable: certificate - label: "Select TrueNAS SCALE Certificate" - schema: - type: int - show_if: [["certType", "=", "ixcert"]] - $ref: - - "definitions/certificate" - - variable: authForwardURL - label: "Forward Authentication URL" - schema: - type: string - default: "" + type: list + default: [] + items: + - variable: hosts + label: "Certificate Hosts" + schema: + type: list + default: [] + items: + - variable: host + label: "Host" + schema: + type: string + default: "" + required: true + - variable: scaleCERT + label: "Select TrueNAS SCALE Certificate" + schema: + type: int + $ref: + - "definitions/certificate" ```