Sfoglia il codice sorgente

Publish new changes in catalog

sonicaj 1 anno fa
parent
commit
07118eb06a

+ 6 - 0
community/cloudflared/1.0.0/Chart.lock

@@ -0,0 +1,6 @@
+dependencies:
+- name: common
+  repository: file://../../../common
+  version: 1.1.1
+digest: sha256:a7dbe3e4d42dbcd4325776e5e01a1d630c7f185f79e7ebf22b1b9cc80f56eed7
+generated: "2023-09-14T16:02:43.614243798+03:00"

+ 27 - 0
community/cloudflared/1.0.0/Chart.yaml

@@ -0,0 +1,27 @@
+name: cloudflared
+description: Cloudflared is a client for Cloudflare Tunnel, a daemon that exposes private services through the Cloudflare edge.
+annotations:
+  title: Cloudflared
+type: application
+version: 1.0.0
+apiVersion: v2
+appVersion: 2023.8.2
+kubeVersion: '>=1.16.0-0'
+maintainers:
+  - name: truenas
+    url: https://www.truenas.com/
+    email: dev@ixsystems.com
+dependencies:
+  - name: common
+    repository: file://../../../common
+    version: 1.1.1
+home: https://github.com/cloudflare/cloudflared
+icon: https://avatars.githubusercontent.com/u/314135
+sources:
+  - https://github.com/cloudflare/cloudflared
+  - https://github.com/truenas/charts/tree/master/library/ix-dev/community/cloudflared
+  - https://hub.docker.com/r/cloudflare/cloudflared
+keywords:
+  - network
+  - cloudflare
+  - tunnel

+ 3 - 0
community/cloudflared/1.0.0/README.md

@@ -0,0 +1,3 @@
+# Cloudflared
+
+[Cloudflared](https://github.com/cloudflare/cloudflared) is a client for Cloudflare Tunnel, a daemon that exposes private services through the Cloudflare edge.

+ 3 - 0
community/cloudflared/1.0.0/app-readme.md

@@ -0,0 +1,3 @@
+# Cloudflared
+
+[Cloudflared](https://github.com/cloudflare/cloudflared) is a client for Cloudflare Tunnel, a daemon that exposes private services through the Cloudflare edge.

BIN
community/cloudflared/1.0.0/charts/common-1.1.1.tgz


+ 8 - 0
community/cloudflared/1.0.0/ci/basic-values.yaml

@@ -0,0 +1,8 @@
+cloudflaredRunAs:
+  user: 1000
+  group: 1000
+
+cloudflaredConfig:
+  tunnelToken: supersecrettoken
+
+ci: true

+ 13 - 0
community/cloudflared/1.0.0/ci/hostNet-values.yaml

@@ -0,0 +1,13 @@
+cloudflaredNetwork:
+  hostNetwork: true
+
+cloudflaredStorage:
+  additionalStorages:
+  - type: hostPath
+    hostPath: /mnt/{{ .Release.Namespace }}/data1
+    mountPath: /data1
+
+cloudflaredConfig:
+  tunnelToken: supersecrettoken
+
+ci: true

+ 26 - 0
community/cloudflared/1.0.0/ix_values.yaml

@@ -0,0 +1,26 @@
+image:
+  repository: cloudflare/cloudflared
+  pullPolicy: IfNotPresent
+  tag: 2023.8.2
+
+ci: false
+
+resources:
+  limits:
+    cpu: 4000m
+    memory: 8Gi
+
+cloudflaredConfig:
+  tunnelToken: ''
+  additionalArgs: []
+  additionalEnvs: []
+
+cloudflaredNetwork:
+  hostNetwork: false
+
+cloudflaredRunAs:
+  user: 568
+  group: 568
+
+cloudflaredStorage:
+  additionalStorages: []

+ 8 - 0
community/cloudflared/1.0.0/metadata.yaml

@@ -0,0 +1,8 @@
+runAsContext:
+  - userName: cloudflared
+    groupName: cloudflared
+    gid: 568
+    uid: 568
+    description: Cloudflared can run as any non-root user.
+capabilities: []
+hostMounts: []

+ 201 - 0
community/cloudflared/1.0.0/questions.yaml

@@ -0,0 +1,201 @@
+groups:
+  - name: Cloudflared Configuration
+    description: Configure Cloudflared
+  - name: User and Group Configuration
+    description: Configure User and Group for Cloudflared
+  - name: Network Configuration
+    description: Configure Network for Cloudflared
+  - name: Storage Configuration
+    description: Configure Storage for Cloudflared
+  - name: Resources Configuration
+    description: Configure Resources for Cloudflared
+
+questions:
+  - variable: cloudflaredConfig
+    label: ""
+    group: Cloudflared Configuration
+    schema:
+      type: dict
+      attrs:
+        - variable: tunnelToken
+          label: Tunnel Token
+          description: The tunnel token to use for Cloudflared.
+          schema:
+            type: string
+            default: ""
+            required: true
+            private: true
+        - variable: additionalArgs
+          label: Additional Arguments
+          description: |
+            Configure additional arguments for Cloudflared.</br>
+            Those will be placed after the "tunnel --no-autoupdate" and before "run". </br>
+            Example: </br>
+            tunnel --no-autoupdate <my-arg> run </br>
+            One argument per line.
+          schema:
+            type: list
+            default: []
+            items:
+              - variable: arg
+                label: Argument
+                schema:
+                  type: string
+                  required: true
+        - variable: additionalEnvs
+          label: Additional Environment Variables
+          description: Configure additional environment variables for Cloudflared.
+          schema:
+            type: list
+            default: []
+            items:
+              - variable: env
+                label: Environment Variable
+                schema:
+                  type: dict
+                  attrs:
+                    - variable: name
+                      label: Name
+                      schema:
+                        type: string
+                        required: true
+                    - variable: value
+                      label: Value
+                      schema:
+                        type: string
+                        required: true
+
+  - variable: cloudflaredRunAs
+    label: ""
+    group: User and Group Configuration
+    schema:
+      type: dict
+      attrs:
+        - variable: user
+          label: User ID
+          description: The user id that Cloudflared will run as.
+          schema:
+            type: int
+            min: 2
+            default: 568
+            required: true
+        - variable: group
+          label: Group ID
+          description: The group id that Cloudflared will run as.
+          schema:
+            type: int
+            min: 2
+            default: 568
+            required: true
+
+  - variable: cloudflaredNetwork
+    label: ""
+    group: Network Configuration
+    schema:
+      type: dict
+      attrs:
+        - variable: hostNetwork
+          label: Host Network
+          description: |
+            Bind to the host network. It's recommended to keep this disabled.</br>
+          schema:
+            type: boolean
+            default: false
+
+  - variable: cloudflaredStorage
+    label: ""
+    group: Storage Configuration
+    schema:
+      type: dict
+      attrs:
+        - variable: additionalStorages
+          label: Additional Storage
+          description: Additional storage for Cloudflared.
+          schema:
+            type: list
+            default: []
+            items:
+              - variable: storageEntry
+                label: Storage Entry
+                schema:
+                  type: dict
+                  attrs:
+                    - variable: type
+                      label: Type
+                      description: |
+                        ixVolume: Is dataset created automatically by the system.</br>
+                        Host Path: Is a path that already exists on the system.
+                      schema:
+                        type: string
+                        required: true
+                        default: "ixVolume"
+                        enum:
+                          - value: "hostPath"
+                            description: Host Path (Path that already exists on the system)
+                          - value: "ixVolume"
+                            description: ixVolume (Dataset created automatically by the system)
+                    - variable: mountPath
+                      label: Mount Path
+                      description: The path inside the container to mount the storage.
+                      schema:
+                        type: path
+                        required: true
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["type", "=", "hostPath"]]
+                        required: true
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        show_if: [["type", "=", "ixVolume"]]
+                        required: true
+                        immutable: true
+                        default: "storage_entry"
+                        $ref:
+                          - "normalize/ixVolume"
+
+  - variable: resources
+    group: Resources Configuration
+    label: ""
+    schema:
+      type: dict
+      attrs:
+        - variable: limits
+          label: Limits
+          schema:
+            type: dict
+            attrs:
+              - variable: cpu
+                label: CPU
+                description: CPU limit for Cloudflared.
+                schema:
+                  type: string
+                  max_length: 6
+                  valid_chars: '^(0\.[1-9]|[1-9][0-9]*)(\.[0-9]|m?)$'
+                  valid_chars_error: |
+                    Valid CPU limit formats are</br>
+                    - Plain Integer - eg. 1</br>
+                    - Float - eg. 0.5</br>
+                    - Milicpu - eg. 500m
+                  default: "4000m"
+                  required: true
+              - variable: memory
+                label: Memory
+                description: Memory limit for Cloudflared.
+                schema:
+                  type: string
+                  max_length: 12
+                  valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$'
+                  valid_chars_error: |
+                    Valid Memory limit formats are</br>
+                    - Suffixed with E/P/T/G/M/K - eg. 1G</br>
+                    - Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi</br>
+                    - Plain Integer in bytes - eg. 1024</br>
+                    - Exponent - eg. 134e6
+                  default: "8Gi"
+                  required: true

+ 1 - 0
community/cloudflared/1.0.0/templates/NOTES.txt

@@ -0,0 +1 @@
+{{ include "ix.v1.common.lib.chart.notes" $ }}

+ 55 - 0
community/cloudflared/1.0.0/templates/_cloudflared.tpl

@@ -0,0 +1,55 @@
+{{- define "cloudflared.workload" -}}
+{{- if not .Values.cloudflaredConfig.tunnelToken -}}
+  {{- fail "Cloudflared - Tunnel Token is required" -}}
+{{- end -}}
+{{- $reservedArgs := (list "tunnel" "--no-autoupdate" "run") -}}
+{{- $addArgs := .Values.cloudflaredConfig.additionalArgs -}}
+{{- if not (deepEqual $addArgs (uniq $addArgs)) -}}
+  {{- fail (printf "Cloudflared - Expected Additional arguments to be unique, but got [%s]" (join ", " $addArgs)) -}}
+{{- end }}
+workload:
+  cloudflared:
+    enabled: true
+    primary: true
+    type: Deployment
+    podSpec:
+      hostNetwork: {{ .Values.cloudflaredNetwork.hostNetwork }}
+      containers:
+        cloudflared:
+          enabled: true
+          primary: true
+          imageSelector: image
+          securityContext:
+            runAsUser: {{ .Values.cloudflaredRunAs.user }}
+            runAsGroup: {{ .Values.cloudflaredRunAs.group }}
+          args:
+            - tunnel
+            - --no-autoupdate
+            {{ if not .Values.ci }}
+              {{ range $arg := $addArgs }}
+                {{- if (mustHas $arg $reservedArgs) -}}
+                  {{- fail (printf "Cloudflared - Argument [%s] is already applied" $arg) -}}
+                {{- end }}
+            - {{ $arg }}
+              {{ end }}
+            - run
+            {{ else }}
+            - --hello-world
+            {{ end }}
+          env:
+            TUNNEL_TOKEN: {{ .Values.cloudflaredConfig.tunnelToken }}
+          {{ with .Values.cloudflaredConfig.additionalEnvs }}
+          envList:
+            {{ range $env := . }}
+            - name: {{ $env.name }}
+              value: {{ $env.value }}
+            {{ end }}
+          {{ end }}
+          probes:
+            liveness:
+              enabled: false
+            readiness:
+              enabled: false
+            startup:
+              enabled: false
+{{- end -}}

+ 14 - 0
community/cloudflared/1.0.0/templates/_persistance.tpl

@@ -0,0 +1,14 @@
+{{- define "cloudflared.persistence" -}}
+persistence:
+  {{- range $idx, $storage := .Values.cloudflaredStorage.additionalStorages }}
+  {{ printf "cloudflared-%v" (int $idx) }}:
+    enabled: true
+    type: {{ $storage.type }}
+    datasetName: {{ $storage.datasetName | default "" }}
+    hostPath: {{ $storage.hostPath | default "" }}
+    targetSelector:
+      cloudflared:
+        cloudflared:
+          mountPath: {{ $storage.mountPath }}
+  {{- end }}
+{{- end -}}

+ 7 - 0
community/cloudflared/1.0.0/templates/common.yaml

@@ -0,0 +1,7 @@
+{{- include "ix.v1.common.loader.init" . -}}
+
+{{/* Merge the templates with Values */}}
+{{- $_ := mustMergeOverwrite .Values (include "cloudflared.workload" $ | fromYaml) -}}
+{{- $_ := mustMergeOverwrite .Values (include "cloudflared.persistence" $ | fromYaml) -}}
+
+{{- include "ix.v1.common.loader.apply" . -}}

+ 7 - 0
community/cloudflared/item.yaml

@@ -0,0 +1,7 @@
+icon_url: https://avatars.githubusercontent.com/u/314135
+categories:
+  - network
+screenshots: []
+tags:
+  - tunnel
+  - cloudflare