Skip to content

Commit 5a26f47

Browse files
author
Antoine TANZILLI
committed
chore(init): initial commit
1 parent a392232 commit 5a26f47

File tree

11 files changed

+276
-2
lines changed

11 files changed

+276
-2
lines changed

.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

Chart.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v2
2+
appVersion: 2.0.44
3+
description: dnscrypt-proxy for Kubernetes
4+
icon: https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/logo.png
5+
keywords:
6+
- dnscrypt
7+
maintainers:
8+
- email: antoine@tanzil.li
9+
name: Antoine TANZILLI
10+
name: dnscrypt-proxy
11+
sources:
12+
- https://github.com/Tailzip/dnscrypt-proxy-helm-chart
13+
type: application
14+
version: 0.1.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Antoine
3+
Copyright (c) 2020 Antoine TANZILLI
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
# dnscrypt-proxy-helm-chart
2-
Simple Helm chart for dnscrypt-proxy
2+
3+
## Usage
4+
5+
TODO
6+
7+
## Credits
8+
9+
TODO
10+
11+
## License
12+
13+
- Tailzip/dnscrypt-proxy-helm-chart: [MIT License](./LICENSE)
14+
- klutchell/dnscrypt-proxy: [MIT License](https://github.com/klutchell/dnscrypt-proxy/blob/master/LICENSE)
15+
- DNSCrypt/dnscrypt-proxy: [ISC License](https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/LICENSE)

templates/_helpers.tpl

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "dnscrypt-proxy.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "dnscrypt-proxy.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "dnscrypt-proxy.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "dnscrypt-proxy.labels" -}}
37+
helm.sh/chart: {{ include "dnscrypt-proxy.chart" . }}
38+
{{ include "dnscrypt-proxy.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "dnscrypt-proxy.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "dnscrypt-proxy.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}

templates/configmap.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if .Values.config }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "dnscrypt-proxy.fullname" . }}-config
6+
labels: {{- include "dnscrypt-proxy.labels" . | nindent 4 }}
7+
data:
8+
dnscrypt-proxy.toml: |
9+
{{ .Values.config | indent 4 }}
10+
{{- end }}

templates/deployment.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "dnscrypt-proxy.fullname" . }}
5+
labels:
6+
{{- include "dnscrypt-proxy.labels" . | nindent 4 }}
7+
spec:
8+
selector:
9+
matchLabels:
10+
{{- include "dnscrypt-proxy.selectorLabels" . | nindent 6 }}
11+
template:
12+
metadata:
13+
labels:
14+
{{- include "dnscrypt-proxy.selectorLabels" . | nindent 8 }}
15+
spec:
16+
containers:
17+
- name: {{ .Chart.Name }}
18+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
19+
imagePullPolicy: {{ .Values.image.pullPolicy }}
20+
ports:
21+
- name: dns-udp
22+
containerPort: 5053
23+
protocol: UDP
24+
- name: dns-tcp
25+
containerPort: 5053
26+
protocol: TCP
27+
{{- if .Values.config }}
28+
volumeMounts:
29+
- mountPath: /config/dnscrypt-proxy.toml
30+
name: config
31+
subPath: dnscrypt-proxy.toml
32+
readOnly: true
33+
{{- end }}
34+
livenessProbe:
35+
tcpSocket:
36+
port: 5053
37+
initialDelaySeconds: 15
38+
periodSeconds: 20
39+
readinessProbe:
40+
tcpSocket:
41+
port: 5053
42+
initialDelaySeconds: 5
43+
periodSeconds: 10
44+
{{- if .Values.config }}
45+
volumes:
46+
- configMap:
47+
name: {{ include "dnscrypt-proxy.fullname" . }}-config
48+
name: config
49+
{{- end }}
50+
{{- with .Values.nodeSelector }}
51+
nodeSelector:
52+
{{- toYaml . | nindent 8 }}
53+
{{- end }}
54+
{{- with .Values.affinity }}
55+
affinity:
56+
{{- toYaml . | nindent 8 }}
57+
{{- end }}
58+
{{- with .Values.tolerations }}
59+
tolerations:
60+
{{- toYaml . | nindent 8 }}
61+
{{- end }}

templates/service-tcp.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "dnscrypt-proxy.fullname" . }}-tcp
5+
labels:
6+
{{- include "dnscrypt-proxy.labels" . | nindent 4 }}
7+
{{- if .Values.serviceTCP.annotations }}
8+
annotations:
9+
{{ toYaml .Values.serviceTCP.annotations | indent 4 }}
10+
{{- end }}
11+
spec:
12+
type: {{ .Values.serviceTCP.type }}
13+
{{- if .Values.serviceTCP.loadBalancerIP }}
14+
loadBalancerIP: {{ .Values.serviceTCP.loadBalancerIP }}
15+
{{- end }}
16+
{{- if or (eq .Values.serviceTCP.type "NodePort") (eq .Values.serviceTCP.type "LoadBalancer") }}
17+
externalTrafficPolicy: {{ .Values.serviceTCP.externalTrafficPolicy }}
18+
{{- end }}
19+
ports:
20+
- port: 53
21+
targetPort: 5053
22+
protocol: TCP
23+
name: dns-tcp
24+
selector:
25+
{{- include "dnscrypt-proxy.selectorLabels" . | nindent 4 }}

templates/service-udp.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "dnscrypt-proxy.fullname" . }}-udp
5+
labels:
6+
{{- include "dnscrypt-proxy.labels" . | nindent 4 }}
7+
{{- if .Values.serviceUDP.annotations }}
8+
annotations:
9+
{{ toYaml .Values.serviceUDP.annotations | indent 4 }}
10+
{{- end }}
11+
spec:
12+
type: {{ .Values.serviceUDP.type }}
13+
{{- if .Values.serviceUDP.loadBalancerIP }}
14+
loadBalancerIP: {{ .Values.serviceUDP.loadBalancerIP }}
15+
{{- end }}
16+
{{- if or (eq .Values.serviceUDP.type "NodePort") (eq .Values.serviceUDP.type "LoadBalancer") }}
17+
externalTrafficPolicy: {{ .Values.serviceUDP.externalTrafficPolicy }}
18+
{{- end }}
19+
ports:
20+
- port: 53
21+
targetPort: 5053
22+
protocol: UDP
23+
name: dns-udp
24+
selector:
25+
{{- include "dnscrypt-proxy.selectorLabels" . | nindent 4 }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "{{ include "dnscrypt-proxy.fullname" . }}-smoke-test"
5+
labels:
6+
{{- include "dnscrypt-proxy.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test
9+
spec:
10+
containers:
11+
- name: hook-bind-tools
12+
image: tailzip/bind-tools:latest
13+
args: ['dig', '@{{ include "dnscrypt-proxy.fullname" . }}-udp:5053', 'google.com']
14+
imagePullPolicy: Always
15+
restartPolicy: Never

0 commit comments

Comments
 (0)