test
This commit is contained in:
18
helm/templates/_helpers.tpl
Normal file
18
helm/templates/_helpers.tpl
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- define "wg-easy.name" -}}
|
||||
wg-easy
|
||||
{{- end }}
|
||||
|
||||
{{- define "wg-easy.fullname" -}}
|
||||
{{ printf "%s-%s" .Release.Name (include "wg-easy.name" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "wg-easy.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "wg-easy.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "wg-easy.selectorLabels" -}}
|
||||
app: {{ include "wg-easy.name" . }}
|
||||
{{- end }}
|
||||
13
helm/templates/persistentvolumeclaim.yaml
Normal file
13
helm/templates/persistentvolumeclaim.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "wg-easy.name" . }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size }}
|
||||
{{- if and .Values.persistence.storageClass (ne .Values.persistence.storageClass "") }}
|
||||
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
||||
{{- end }}
|
||||
20
helm/templates/service.yaml
Normal file
20
helm/templates/service.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "wg-easy.name" . }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if and .Values.service.loadBalancerIP (ne .Values.service.loadBalancerIP "") }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.service.httpPort }}
|
||||
targetPort: 51821
|
||||
protocol: TCP
|
||||
- name: wireguard
|
||||
port: {{ .Values.service.wgPort }}
|
||||
targetPort: {{ .Values.service.wgPort }}
|
||||
protocol: UDP
|
||||
selector:
|
||||
app: {{ include "wg-easy.name" . }}
|
||||
44
helm/templates/statefulset.yaml
Normal file
44
helm/templates/statefulset.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "wg-easy.name" . }}
|
||||
labels:
|
||||
app: {{ include "wg-easy.name" . }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "wg-easy.name" . }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ include "wg-easy.name" . }}
|
||||
spec:
|
||||
securityContext:
|
||||
sysctls:
|
||||
- name: net.ipv4.ip_forward
|
||||
value: "1"
|
||||
containers:
|
||||
- name: wg-easy
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 51821
|
||||
protocol: TCP
|
||||
- name: wireguard
|
||||
containerPort: {{ .Values.service.wgPort }}
|
||||
protocol: UDP
|
||||
env:
|
||||
- name: INSECURE
|
||||
value: {{ .Values.env.INSECURE | quote }}
|
||||
securityContext:
|
||||
capabilities:
|
||||
add: ["NET_ADMIN", "SYS_MODULE"]
|
||||
volumeMounts:
|
||||
- name: wg-easy-data
|
||||
mountPath: /etc/wireguard
|
||||
volumes:
|
||||
- name: wg-easy-data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "wg-easy.name" . }}
|
||||
Reference in New Issue
Block a user