Skip to content

Commit 2cb7eb3

Browse files
authored
fix service port references (#96)
* fix service name references * bump proxy version * switch to TCP * fix wireguard service config * bump gateway chart version * fix env var name * add gateway healthcheck
1 parent af3c075 commit 2cb7eb3

12 files changed

Lines changed: 63 additions & 105 deletions

File tree

charts/defguard-gateway/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: defguard-gateway
33
description: Defguard gateway is a public-facing VPN endpoint.
44

55
type: application
6-
version: 0.3.0
6+
version: 0.4.0
77
appVersion: 1.5.1

charts/defguard-gateway/templates/NOTES.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
1. Get the application URL by running these commands:
2-
{{- if .Values.ingress.enabled }}
3-
{{- range $host := .Values.ingress.hosts }}
4-
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}/
5-
{{- end }}
6-
{{- else if contains "NodePort" .Values.service.grpc.type }}
2+
{{- if contains "NodePort" .Values.service.wireguard.type }}
73
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "defguard-gateway.fullname" . }})
84
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
95
echo http://$NODE_IP:$NODE_PORT
10-
{{- else if contains "LoadBalancer" .Values.service.grpc.type }}
6+
{{- else if contains "LoadBalancer" .Values.service.wireguard.type }}
117
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
128
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "defguard-gateway.fullname" . }}'
139
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "defguard-gateway.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
14-
echo http://$SERVICE_IP:{{ .Values.service.grpc.port }}
15-
{{- else if contains "ClusterIP" .Values.service.grpc.type }}
10+
echo http://$SERVICE_IP:{{ .Values.service.wireguard.port }}
11+
{{- else if contains "ClusterIP" .Values.service.wireguard.type }}
1612
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "defguard-gateway.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
1713
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
1814
echo "Visit http://127.0.0.1:8080 to use your application"

charts/defguard-gateway/templates/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ data:
88
DEFGUARD_USERSPACE: {{ .Values.userspace | quote }}
99
DEFGUARD_GRPC_URL: {{ .Values.grpcUrl | quote }}
1010
DEFGUARD_STATS_PERIOD: {{ .Values.statsPeriod | quote }}
11-
RUST_LOG: {{ .Values.logLevel | quote }}
11+
DEFGUARD_LOG_LEVEL: {{ .Values.logLevel | quote }}

charts/defguard-gateway/templates/deployment.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,29 @@ spec:
3939
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4040
imagePullPolicy: {{ .Values.image.pullPolicy }}
4141
ports:
42-
- name: grpc
43-
containerPort: {{ .Values.service.grpc.port }}
42+
- name: wireguard
43+
containerPort: {{ .Values.service.wireguard.port }}
4444
protocol: UDP
4545
resources:
4646
{{- toYaml .Values.resources | nindent 12 }}
47+
{{- if .Values.healthCheck.enabled }}
48+
livenessProbe:
49+
httpGet:
50+
path: /
51+
port: {{ .Values.healthCheck.port }}
52+
initialDelaySeconds: {{ .Values.healthCheck.livenessProbe.initialDelaySeconds }}
53+
periodSeconds: {{ .Values.healthCheck.livenessProbe.periodSeconds }}
54+
timeoutSeconds: {{ .Values.healthCheck.livenessProbe.timeoutSeconds }}
55+
failureThreshold: {{ .Values.healthCheck.livenessProbe.failureThreshold }}
56+
readinessProbe:
57+
httpGet:
58+
path: /
59+
port: {{ .Values.healthCheck.port }}
60+
initialDelaySeconds: {{ .Values.healthCheck.readinessProbe.initialDelaySeconds }}
61+
periodSeconds: {{ .Values.healthCheck.readinessProbe.periodSeconds }}
62+
timeoutSeconds: {{ .Values.healthCheck.readinessProbe.timeoutSeconds }}
63+
failureThreshold: {{ .Values.healthCheck.readinessProbe.failureThreshold }}
64+
{{- end }}
4765
{{- if .Values.token }}
4866
env:
4967
- name: DEFGUARD_TOKEN
@@ -56,6 +74,11 @@ spec:
5674
name: {{ .Values.existingTokenSecret }}
5775
key: {{ .Values.existingTokenSecretKey }}
5876
{{- end }}
77+
{{- if .Values.healthCheck.enabled }}
78+
env:
79+
- name: HEALTH_PORT
80+
value: {{ .Values.healthCheck.port }}
81+
{{- end }}
5982
{{- with .Values.nodeSelector }}
6083
nodeSelector:
6184
{{- toYaml . | nindent 8 }}

charts/defguard-gateway/templates/ingress-grpc.yaml

Lines changed: 0 additions & 55 deletions
This file was deleted.

charts/defguard-gateway/templates/grpc-service.yaml renamed to charts/defguard-gateway/templates/wireguard-service.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
annotations:
5-
{{- with .Values.service.grpc.annotations }}
5+
{{- with .Values.service.wireguard.annotations }}
66
{{- toYaml . | nindent 4 }}
77
{{- end }}
8-
name: {{ include "defguard-gateway.fullname" . }}-grpc
8+
name: {{ include "defguard-gateway.fullname" . }}-wireguard
99
labels:
1010
{{- include "defguard-gateway.labels" . | nindent 4 }}
11-
{{- with .Values.service.grpc.labels }}
11+
{{- with .Values.service.wireguard.labels }}
1212
{{- toYaml . | nindent 4 }}
1313
{{- end }}
1414
spec:
15-
type: {{ .Values.service.grpc.type }}
15+
type: {{ .Values.service.wireguard.type }}
1616
ports:
17-
- port: {{ .Values.service.grpc.port }}
18-
targetPort: grpc
17+
- port: {{ .Values.service.wireguard.port }}
18+
targetPort: wireguard
1919
protocol: UDP
20-
name: grpc
20+
name: wireguard
2121
selector:
2222
{{- include "defguard-gateway.selectorLabels" . | nindent 4 }}

charts/defguard-gateway/values.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ image:
2525
tag: "" # overrides .Chart.AppVersion
2626
# defguard-gateway container image pull secrets
2727
imagePullSecrets: []
28-
# defguard-gateway container ingress configuration
29-
ingress:
30-
grpc:
31-
annotations: {}
32-
className: ""
33-
enabled: true
34-
host: defguard-gateway-grpc.local
35-
labels: {}
36-
tls: false
3728
# defguard-gateway pod affinity configuration
3829
affinity: {}
3930
# defguard-gateway node selector configuration
@@ -54,13 +45,26 @@ podSecurityContext: {}
5445
securityContext: {}
5546
# defguard-gateway pod additional ENV from configmap
5647
additionalEnvFromConfigMap: ""
48+
# defguard-gateway health check configuration
49+
healthCheck:
50+
enabled: false
51+
port: 35053
52+
livenessProbe:
53+
initialDelaySeconds: 30
54+
periodSeconds: 10
55+
timeoutSeconds: 5
56+
failureThreshold: 3
57+
readinessProbe:
58+
initialDelaySeconds: 10
59+
periodSeconds: 10
60+
timeoutSeconds: 5
61+
failureThreshold: 3
5762
# defguard-gateway service configuration
5863
service:
59-
grpc:
60-
annotations:
61-
traefik.ingress.kubernetes.io/service.serversscheme: h2c
64+
wireguard:
65+
annotations: {}
6266
labels: {}
63-
port: 50051
67+
port: 32140
6468
type: ClusterIP
6569
# defguard-gateway serviceaccount configuration
6670
serviceAccount:

charts/defguard-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: defguard-proxy
33
description: Defguard proxy is a public-facing proxy for core Defguard service
44

55
type: application
6-
version: 0.7.0
6+
version: 0.7.1
77
appVersion: 1.5.1

charts/defguard-proxy/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
containerPort: {{ .Values.service.web.port }}
4646
protocol: TCP
4747
- name: grpc
48-
containerPort: {{ .Values.service.web.port }}
48+
containerPort: {{ .Values.service.grpc.port }}
4949
protocol: TCP
5050
livenessProbe:
5151
httpGet:

charts/defguard/templates/defguard-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ spec:
7070
imagePullPolicy: {{ .Values.image.pullPolicy }}
7171
ports:
7272
- name: http
73-
containerPort: 8000
73+
containerPort: {{ .Values.service.web.port }}
7474
protocol: TCP
7575
- name: grpc
76-
containerPort: 50055
76+
containerPort: {{ .Values.service.grpc.port }}
7777
protocol: TCP
7878
livenessProbe:
7979
httpGet:

0 commit comments

Comments
 (0)