move k8s-gateway to stable

This commit is contained in:
kjeld Schouten-Lebbing
2021-09-02 20:25:11 +02:00
parent a0460399bf
commit 6835f04855
12 changed files with 1 additions and 1 deletions
+24
View File
@@ -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
View File
+23
View File
@@ -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: 1.0.0
View File
@@ -0,0 +1,3 @@
categories:
- networking
icon_url: https://cncf-branding.netlify.app/img/projects/coredns/icon/black/coredns-icon-black.png
@@ -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
##
@@ -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"
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: "Networking and Services"
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
@@ -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 -}}
@@ -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" . }}
+115
View File
@@ -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