-
Notifications
You must be signed in to change notification settings - Fork 15
Make it easy to deploy on aws #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,9 @@ spec: | |
- name: grpc | ||
containerPort: {{ .Values.service.ports.grpc }} | ||
protocol: UDP | ||
- name: wireguard # make it explicit | ||
containerPort: {{ .Values.service.ports.wireguard }} | ||
protocol: UDP | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- if .Values.token }} | ||
|
@@ -56,6 +59,19 @@ spec: | |
name: {{ .Values.existingTokenSecret }} | ||
key: {{ .Values.existingTokenSecretKey }} | ||
{{- end }} | ||
# used to keep nlb happy to do health checks at port 80. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to be AWS-related only. Should be wrapped in a condition. |
||
# Alternatively, we could add this command to the Dockerfile | ||
- name: tcp-healthcheck | ||
image: alpine/socat:latest | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- socat | ||
- "TCP-LISTEN:80,reuseaddr,fork" | ||
- "SYSTEM:true" | ||
ports: | ||
- name: health | ||
containerPort: 80 | ||
protocol: TCP | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{ if eq .Values.cloudProvider "aws" }} | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
# service creates an aws NLB which exposes | ||
annotations: | ||
# Force the NLB’s health check to use TCP:443 (or 80, or any open TCP port) | ||
service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol: "TCP" | ||
service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "80" | ||
service.beta.kubernetes.io/aws-load-balancer-healthcheck-interval: "10" | ||
service.beta.kubernetes.io/aws-load-balancer-healthcheck-timeout: "5" | ||
service.beta.kubernetes.io/aws-load-balancer-healthcheck-healthy-threshold: "2" | ||
service.beta.kubernetes.io/aws-load-balancer-healthcheck-unhealthy-threshold: "2" | ||
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip" | ||
service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing" | ||
service.beta.kubernetes.io/aws-load-balancer-type: "nlb" | ||
name: {{ include "defguard-gateway.fullname" . }}-wireguard | ||
labels: | ||
{{- include "defguard-gateway.labels" . | nindent 4 }} | ||
spec: | ||
type: LoadBalancer | ||
externalTrafficPolicy: Local | ||
ports: | ||
- port: {{ .Values.service.ports.wireguard }} | ||
targetPort: wireguard | ||
protocol: UDP | ||
name: wireguard | ||
selector: | ||
{{- include "defguard-gateway.selectorLabels" . | nindent 4 }} | ||
|
||
{{ end }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing LineFeed (LF) characted at the end of the file |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,18 +46,32 @@ podLabels: {} | |
# defguard-gateway pod replica count | ||
replicaCount: 1 | ||
# defguard-gateway pod resources | ||
resources: {} | ||
resources: | ||
requests: | ||
cpu: 50m | ||
memory: 50Mi | ||
limits: | ||
cpu: 500m | ||
memory: 500Mi | ||
# defguard-gateway pod security context | ||
podSecurityContext: {} | ||
# defguard-gateway container security context | ||
securityContext: {} | ||
securityContext: | ||
privileged: false | ||
readOnlyRootFilesystem: true | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: [ "ALL" ] | ||
add: [ "NET_ADMIN" ] # wireguard fails to start without this as it's not able to create interfaces | ||
# defguard-gateway pod additional ENV from configmap | ||
additionalEnvFromConfigMap: "" | ||
# defguard-gateway service configuration | ||
service: | ||
ports: | ||
grpc: 50051 | ||
wireguard: 51820 # wireguard listening port | ||
type: ClusterIP | ||
cloudProvider: aws | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should not be the default value. |
||
# defguard-gateway serviceaccount configuration | ||
serviceAccount: | ||
annotations: {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that necessary? Can we guarantee the network interface will always be eth0 for all users of this chart? Maybe it should be wrapped in AWS-only condition?