From 76e86c9b5476dba39197c0574f0cd79c7a8e1807 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Thu, 2 Sep 2021 17:46:50 +0200 Subject: [PATCH] add k8s-gateway (#883) * Add k8s-gateway * some changes * fix lint issue * actually mount coreDNS config volume * whoops * use UDP for service * no RO on the corefile * revert previous and set ARG * less brackets * remove unneeded space * turn domains into a list and alter questions.yaml * fix questions.yaml --- charts/incubator/k8s-gateway/.helmignore | 24 + charts/incubator/k8s-gateway/CONFIG.md | 0 charts/incubator/k8s-gateway/Chart.yaml | 23 + charts/incubator/k8s-gateway/README.md | 0 charts/incubator/k8s-gateway/SCALE/item.yaml | 3 + .../k8s-gateway/SCALE/ix_values.yaml | 110 +++ .../k8s-gateway/SCALE/questions.yaml | 779 ++++++++++++++++++ charts/incubator/k8s-gateway/app-readme.md | 0 charts/incubator/k8s-gateway/helm-values.md | 0 .../k8s-gateway/templates/_configmap.tpl | 63 ++ .../k8s-gateway/templates/common.yaml | 24 + charts/incubator/k8s-gateway/values.yaml | 115 +++ 12 files changed, 1141 insertions(+) create mode 100644 charts/incubator/k8s-gateway/.helmignore create mode 100644 charts/incubator/k8s-gateway/CONFIG.md create mode 100644 charts/incubator/k8s-gateway/Chart.yaml create mode 100644 charts/incubator/k8s-gateway/README.md create mode 100644 charts/incubator/k8s-gateway/SCALE/item.yaml create mode 100644 charts/incubator/k8s-gateway/SCALE/ix_values.yaml create mode 100644 charts/incubator/k8s-gateway/SCALE/questions.yaml create mode 100644 charts/incubator/k8s-gateway/app-readme.md create mode 100644 charts/incubator/k8s-gateway/helm-values.md create mode 100644 charts/incubator/k8s-gateway/templates/_configmap.tpl create mode 100644 charts/incubator/k8s-gateway/templates/common.yaml create mode 100644 charts/incubator/k8s-gateway/values.yaml diff --git a/charts/incubator/k8s-gateway/.helmignore b/charts/incubator/k8s-gateway/.helmignore new file mode 100644 index 00000000000..e559de0a012 --- /dev/null +++ b/charts/incubator/k8s-gateway/.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/incubator/k8s-gateway/CONFIG.md b/charts/incubator/k8s-gateway/CONFIG.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/charts/incubator/k8s-gateway/Chart.yaml b/charts/incubator/k8s-gateway/Chart.yaml new file mode 100644 index 00000000000..1bfd906dce0 --- /dev/null +++ b/charts/incubator/k8s-gateway/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +appVersion: auto +dependencies: +- name: common + repository: https://truecharts.org/ + version: 6.13.3 +deprecated: false +description: A Helm chart for the k8s_gateway CoreDNS plugin +home: https://github.com/truecharts/apps/tree/master/charts/stable/k8s-gateway +icon: https://cncf-branding.netlify.app/img/projects/coredns/icon/black/coredns-icon-black.png +keywords: +- DNS +- networking +kubeVersion: '>=1.16.0-0' +maintainers: +- email: info@truecharts.org + name: TrueCharts + url: truecharts.org +name: k8s-gateway +sources: +- https://github.com/ori-edge/k8s_gatewa +type: application +version: 0.0.1 diff --git a/charts/incubator/k8s-gateway/README.md b/charts/incubator/k8s-gateway/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/charts/incubator/k8s-gateway/SCALE/item.yaml b/charts/incubator/k8s-gateway/SCALE/item.yaml new file mode 100644 index 00000000000..d199b006d94 --- /dev/null +++ b/charts/incubator/k8s-gateway/SCALE/item.yaml @@ -0,0 +1,3 @@ +categories: + - networking +icon_url: https://cncf-branding.netlify.app/img/projects/coredns/icon/black/coredns-icon-black.png diff --git a/charts/incubator/k8s-gateway/SCALE/ix_values.yaml b/charts/incubator/k8s-gateway/SCALE/ix_values.yaml new file mode 100644 index 00000000000..0d0d952dead --- /dev/null +++ b/charts/incubator/k8s-gateway/SCALE/ix_values.yaml @@ -0,0 +1,110 @@ +## +# 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. +## + +# Default values for Jackett. + +image: + repository: quay.io/oriedge/k8s_gateway + pullPolicy: IfNotPresent + tag: v0.1.8 + +args: ["-conf", "/etc/coredns/Corefile"] + +# -- Delegated domain +domain: "example.com" + +# -- TTL for non-apex responses (in seconds) +ttl: 300 + +# -- Limit what kind of resources to watch, e.g. watchedResources: ["Ingress"] +watchedResources: ["Ingress"] + +# -- Service name of a secondary DNS server (should be `serviceName.namespace`) +secondary: "" + +# -- Override the default `serviceName.namespace` domain apex +apex: "" + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + +# -- Create a ClusterRole and ClusterRoleBinding +# @default -- See below +rbac: + # -- Enables or disables the ClusterRole and ClusterRoleBinding + enabled: true + + # -- Set Rules on the ClusterRole + rules: + - apiGroups: + - "" + resources: + - services + - namespaces + verbs: + - list + - watch + - apiGroups: + - extensions + - networking.k8s.io + resources: + - ingresses + verbs: + - list + - watch + +service: + main: + enabled: true + ports: + main: + protocol: UDP + port: 53 + +probes: + liveness: + custom: true + spec: + httpGet: + path: /health + port: 8080 + scheme: HTTP + initialDelaySeconds: 60 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + + readiness: + custom: true + spec: + httpGet: + path: /ready + port: 8181 + scheme: HTTP + initialDelaySeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + + + startup: + custom: true + spec: + httpGet: + path: /ready + port: 8181 + scheme: HTTP + initialDelaySeconds: 3 + timeoutSeconds: 2 + periodSeconds: 5 + failureThreshold: 60 + + +## +# 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/incubator/k8s-gateway/SCALE/questions.yaml b/charts/incubator/k8s-gateway/SCALE/questions.yaml new file mode 100644 index 00000000000..c18c690c93c --- /dev/null +++ b/charts/incubator/k8s-gateway/SCALE/questions.yaml @@ -0,0 +1,779 @@ +groups: + - name: "Container Image" + description: "Image to be used for container" + - name: "Controller" + description: "Configure workload deployment" + - name: "Container Configuration" + description: "additional container configuration" + - name: "App Configuration" + description: "App specific config options" + - name: "Networking and Services" + description: "Configure Network and Services for container" + - name: "Storage and Persistence" + description: "Persist and share data that is separate from the container" + - name: "Ingress" + description: "Ingress Configuration" + - name: "Security and Permissions" + description: "Configure security context and permissions" + - name: "Resources and Devices" + description: "Specify resources/devices to be allocated to workload" + - name: "Advanced" + description: "Advanced Configuration" +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: false + - 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: "Deployment" + - value: "statefulset" + description: "Statefulset" + - value: "daemonset" + description: "Daemonset" + - 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: "Recreate: Kill existing pods before creating new ones" + - value: "RollingUpdate" + description: "RollingUpdate: Create new pods and then kill old ones" + - value: "OnDelete" + description: "(Legacy) OnDelete: ignore .spec.template changes" + - variable: labelsList + label: "Controller Labels" + schema: + type: list + default: [] + items: + - variable: labelItem + label: "Label" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + - variable: annotationsList + label: " Controller Annotations" + schema: + type: list + default: [] + items: + - variable: annotationItem + label: "Label" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + + - variable: podLabelsList + group: "Container Configuration" + label: "Pod Labels" + schema: + type: list + default: [] + items: + - variable: podLabelItem + label: "Label" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: podAnnotationsList + group: "Container Configuration" + label: "Pod Annotations" + schema: + type: list + default: [] + items: + - variable: podAnnotationItem + label: "Label" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: termination + group: "Container Configuration" + label: "Termination settings" + schema: + type: dict + attrs: + - variable: gracePeriodSeconds + label: "Grace Period Seconds" + schema: + type: int + default: 10 + + - variable: env + group: "Container 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: "Container 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: domains + group: "App Configuration" + label: "Domains" + description: "Please refer to CoreDNS docs for options" + schema: + type: list + default: [] + items: + - variable: domainEntry + label: "" + schema: + type: dict + attrs: + - variable: domain + label: "Domain name" + schema: + type: string + required: true + default: "example.com" + - variable: dnsChallenge + label: "Forward dnsChallenge" + description: "Optional configuration option for DNS01 challenge that will redirect all acme" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable Ingress" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: domain + label: "Forward to Domain" + schema: + type: string + required: true + default: "dns01.clouddns.com" + + - variable: forward + group: "App Configuration" + label: "Forward DNS To" + schema: + type: dict + attrs: + - variable: enabled + label: "Enabled" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: primary + label: "Primary" + schema: + type: string + required: true + default: "1.1.1.1" + - variable: secondary + label: "Secondary" + schema: + type: string + required: true + default: "1.0.0.1" + - variable: options + label: "Forward Options" + description: "Please refer to CoreDNS docs for options" + schema: + type: list + default: [] + items: + - variable: optionEntry + label: "Option" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + required: true + default: "" + - variable: value + label: "Value" + schema: + type: string + required: true + default: "" + + - variable: hostNetwork + group: "Networking and Services" + label: "Enable Host Networking" + schema: + type: boolean + default: false + + - variable: service + group: "Networking and Services" + 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: "LoadBalancer" + enum: + - value: "NodePort" + description: "NodePort" + - value: "ClusterIP" + description: "ClusterIP" + - value: "LoadBalancer" + description: "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: "UDP" + enum: + - value: HTTP + description: "HTTP" + - value: "HTTPS" + description: "HTTPS" + - value: TCP + description: "TCP" + - value: "UDP" + description: "UDP" + - variable: targetPort + label: "Target Port" + description: "This port exposes the container port on the service" + schema: + type: int + default: 53 + editable: false + hidden: true + - variable: port + label: "Container Port" + schema: + type: int + default: 53 + 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 + + - variable: serviceList + label: "Additional Services" + group: "Storage and Persistence" + schema: + type: list + default: [] + items: + - variable: serviceListEntry + label: "Custom Service" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable the service" + schema: + type: boolean + default: true + hidden: true + - variable: name + label: "Name" + schema: + type: string + default: "" + - 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: "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: portsList + label: "Additional Service Ports" + schema: + type: list + default: [] + items: + - variable: portsListEntry + label: "Custom ports" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable the port" + schema: + type: boolean + default: true + hidden: true + - variable: name + label: "Port Name" + schema: + type: string + default: "" + - variable: protocol + label: "Port Type" + schema: + type: string + default: "TCP" + enum: + - value: HTTP + description: "HTTP" + - value: "HTTPS" + description: "HTTPS" + - value: TCP + description: "TCP" + - value: "UDP" + description: "UDP" + - variable: targetPort + label: "Target Port" + description: "This port exposes the container port on the service" + schema: + type: int + required: true + - variable: port + label: "Container Port" + schema: + type: int + 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 + + + - variable: persistenceList + label: "Additional app storage" + group: "Storage and Persistence" + schema: + type: list + default: [] + items: + - variable: persistenceListEntry + label: "Custom Storage" + schema: + type: dict + attrs: + - variable: enabled + label: "Enable the storage" + schema: + type: boolean + default: true + - variable: type + label: "(Advanced) Type of Storage" + description: "Sets the persistence type" + schema: + type: string + default: "hostPath" + enum: + - value: "pvc" + description: "pvc" + - value: "emptyDir" + description: "emptyDir" + - value: "hostPath" + description: "hostPath" + - variable: storageClass + label: "(Advanced) storageClass" + description: " Warning: Anything other than SCALE-ZFS will break rollback!" + schema: + show_if: [["type", "=", "pvc"]] + type: string + default: "SCALE-ZFS" + - variable: labelsList + label: "Labels" + schema: + type: list + default: [] + items: + - variable: labelItem + label: "Label" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + - variable: annotationsList + label: "Annotations" + schema: + type: list + default: [] + items: + - variable: annotationItem + label: "Label" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + - variable: setPermissions + label: "Automatic Permissions" + description: "Automatically set permissions on install" + schema: + show_if: [["type", "=", "hostPath"]] + type: boolean + default: true + - variable: readOnly + label: "readOnly" + schema: + type: boolean + default: false + - variable: hostPath + label: "hostPath" + description: "Path inside the container the storage is mounted" + schema: + show_if: [["type", "=", "hostPath"]] + type: hostpath + - variable: hostPathType + label: "hostPath Type" + schema: + show_if: [["type", "=", "hostPath"]] + type: string + default: "" + enum: + - value: "" + description: "Default" + - value: "DirectoryOrCreate" + description: "DirectoryOrCreate" + - value: "Directory" + description: "Directory" + - value: "FileOrCreate" + description: "FileOrCreate" + - value: "File" + description: "File" + - value: "Socket" + description: "Socket" + - value: "CharDevice" + description: "CharDevice" + - value: "BlockDevice" + description: "BlockDevice" + - variable: mountPath + label: "mountPath" + description: "Path inside the container the storage is mounted" + schema: + type: string + required: true + default: "" + - variable: medium + label: "EmptyDir Medium" + schema: + show_if: [["type", "=", "emptyDir"]] + 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: + show_if: [["type", "=", "pvc"]] + 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: + show_if: [["type", "=", "pvc"]] + type: string + default: "100Gi" + + + + - variable: securityContext + group: "Security and Permissions" + label: "Security Context" + schema: + type: dict + attrs: + - variable: privileged + label: "Privileged mode" + schema: + type: boolean + default: false + - variable: readOnlyRootFilesystem + label: "ReadOnly Root Filesystem" + schema: + type: boolean + default: false + - variable: allowPrivilegeEscalation + label: "Allow Privilege Escalation" + schema: + type: boolean + default: true + + - variable: resources + group: "Resources and Devices" + label: "Resource Limits" + schema: + type: dict + attrs: + - variable: limits + label: "Advanced Limit Resource Consumption" + schema: + type: dict + attrs: + - variable: cpu + label: "CPU" + schema: + type: string + default: "2000m" + - variable: memory + label: "Memory RAM" + schema: + type: string + default: "2Gi" + - 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" + + + - variable: autoscaling + group: "Resources and Devices" + label: "Horizontal Pod Autoscaler" + schema: + type: dict + attrs: + - variable: enabled + label: "enabled" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: target + label: "Target" + description: "deployment name, defaults to main deployment" + schema: + type: string + default: "" + - variable: minReplicas + label: "Minimum Replicas" + schema: + type: int + default: 1 + - variable: maxReplicas + label: "Maximum Replicas" + schema: + type: int + default: 5 + - variable: targetCPUUtilizationPercentage + label: "Target CPU Utilization Percentage" + schema: + type: int + default: 80 + - variable: targetMemoryUtilizationPercentage + label: "Target Memory Utilization Percentage" + schema: + type: int + default: 80 diff --git a/charts/incubator/k8s-gateway/app-readme.md b/charts/incubator/k8s-gateway/app-readme.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/charts/incubator/k8s-gateway/helm-values.md b/charts/incubator/k8s-gateway/helm-values.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/charts/incubator/k8s-gateway/templates/_configmap.tpl b/charts/incubator/k8s-gateway/templates/_configmap.tpl new file mode 100644 index 00000000000..6ac015073ff --- /dev/null +++ b/charts/incubator/k8s-gateway/templates/_configmap.tpl @@ -0,0 +1,63 @@ +{{/* +Create the matchable regex from domain +*/}} +{{- define "k8s-gateway.configmap.regex" -}} +{{- if .Values.domain }} +{{- .Values.domain | replace "." "[.]" -}} +{{- else -}} + {{ "unset" }} +{{- end }} +{{- end -}} + +{{/* Define the configmap */}} +{{- define "k8s-gateway.configmap" -}} +{{- $values := .Values }} +{{- $fqdn := ( include "common.names.fqdn" . ) }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.names.fullname" . }}-corefile + labels: + {{- include "common.labels" . | nindent 4 }} +data: + Corefile: |- + .:53 { + errors + log + health { + lameduck 5s + } + ready + {{- range .Values.domains }} + {{- if .dnsChallenge.enabled }} + template IN ANY {{ required "Delegated domain ('domain') is mandatory " .domain }} { + match "_acme-challenge[.](.*)[.]{{ include "k8s-gateway.configmap.regex" . }}" + answer "{{ "{{" }} .Name {{ "}}" }} 5 IN CNAME {{ "{{" }} index .Match 1 {{ "}}" }}.{{ required "DNS01 challenge domain is mandatory " $values.dnsChallenge.domain }}" + fallthrough + } + {{- end }} + k8s_gateway "{{ required "Delegated domain ('domain') is mandatory " .domain }}" { + apex {{ $values.apex | default $fqdn }} + ttl {{ $values.ttl }} + {{- if $values.secondary }} + secondary {{ $values.secondary }} + {{- end }} + {{- if $values.watchedResources }} + resources {{ join " " $values.watchedResources }} + {{- end }} + } + {{- end }} + prometheus 0.0.0.0:9153 + {{- if .Values.forward.enabled }} + forward . {{ .Values.forward.primary }} {{ .Values.forward.secondary }} { + {{- range .Values.forward.options }} + {{ .name }} {{ .value }} + {{- end }} + } + {{- end }} + loop + reload + loadbalance + } +{{- end -}} diff --git a/charts/incubator/k8s-gateway/templates/common.yaml b/charts/incubator/k8s-gateway/templates/common.yaml new file mode 100644 index 00000000000..9c42c9fb446 --- /dev/null +++ b/charts/incubator/k8s-gateway/templates/common.yaml @@ -0,0 +1,24 @@ +{{/* Make sure all variables are set properly */}} +{{- include "common.values.setup" . }} + + +{{/* Render configmap for nextcloud */}} +{{- include "k8s-gateway.configmap" . }} + +{{/* Append the general configMap volume to the volumes */}} +{{- define "k8s-gateway.configvolume" -}} +enabled: "true" +mountPath: "/etc/coredns" +readOnly: true +type: "custom" +volumeSpec: + configMap: + name: {{ include "common.names.fullname" . }}-corefile + items: + - key: Corefile + path: Corefile +{{- end -}} + +{{- $_ := set .Values.persistence "config-volume" (include "k8s-gateway.configvolume" . | fromYaml) -}} +{{/* Render the templates */}} +{{ include "common.all" . }} diff --git a/charts/incubator/k8s-gateway/values.yaml b/charts/incubator/k8s-gateway/values.yaml new file mode 100644 index 00000000000..dbd7290ca9f --- /dev/null +++ b/charts/incubator/k8s-gateway/values.yaml @@ -0,0 +1,115 @@ +# Default values for Jackett. + +image: + repository: quay.io/oriedge/k8s_gateway + pullPolicy: IfNotPresent + tag: v0.1.8 + +args: ["-conf", "/etc/coredns/Corefile"] + +# -- TTL for non-apex responses (in seconds) +ttl: 300 + + +# -- Limit what kind of resources to watch, e.g. watchedResources: ["Ingress"] +watchedResources: [] + +# -- Service name of a secondary DNS server (should be `serviceName.namespace`) +secondary: "" + +# -- Override the default `serviceName.namespace` domain apex +apex: "" + +# -- list of processed domains +domains: + # -- Delegated domain + - domain: "example.com" + # -- Optional configuration option for DNS01 challenge that will redirect all acme + # challenge requests to external cloud domain (e.g. managed by cert-manager) + # See: https://cert-manager.io/docs/configuration/acme/dns01/ + dnsChallenge: + enabled: false + domain: dns01.clouddns.com + +forward: + enabled: true + primary: tls://1.1.1.1 + secondary: tls://1.0.0.1 + options: + - name: tls_servername + value: cloudflare-dns.com + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + +# -- Create a ClusterRole and ClusterRoleBinding +# @default -- See below +rbac: + # -- Enables or disables the ClusterRole and ClusterRoleBinding + enabled: true + + # -- Set Rules on the ClusterRole + rules: + - apiGroups: + - "" + resources: + - services + - namespaces + verbs: + - list + - watch + - apiGroups: + - extensions + - networking.k8s.io + resources: + - ingresses + verbs: + - list + - watch + +service: + main: + enabled: true + ports: + main: + protocol: UDP + port: 53 + +probes: + liveness: + custom: true + spec: + httpGet: + path: /health + port: 8080 + scheme: HTTP + initialDelaySeconds: 60 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + + readiness: + custom: true + spec: + httpGet: + path: /ready + port: 8181 + scheme: HTTP + initialDelaySeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + + + startup: + custom: true + spec: + httpGet: + path: /ready + port: 8181 + scheme: HTTP + initialDelaySeconds: 3 + timeoutSeconds: 2 + periodSeconds: 5 + failureThreshold: 60