-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
External Network: Wireguard Templates
- Loading branch information
Showing
5 changed files
with
204 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
deployments/liqo/templates/liqo-wireguard-gateway-client-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{{- $templateConfig := (merge (dict "name" "wg-client-template" "module" "networking") .) -}} | ||
|
||
{{- if .Values.networking.internal }} | ||
|
||
apiVersion: networking.liqo.io/v1alpha1 | ||
kind: WgGatewayClientTemplate | ||
metadata: | ||
name: {{ $templateConfig.name }} | ||
labels: | ||
{{- include "liqo.labels" $templateConfig | nindent 4 }} | ||
spec: | ||
objectKind: | ||
apiVersion: networking.liqo.io/v1alpha1 | ||
kind: WgGatewayClient | ||
template: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 6 }} | ||
spec: | ||
deployment: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 10 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }} | ||
template: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 14 }} | ||
spec: | ||
containers: | ||
- name: wireguard | ||
image: ghcr.io/liqotech/gateway/wireguard{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }} | ||
imagePullPolicy: Always | ||
args: | ||
- --name="{{"{{ .Name }}"}}" | ||
- --namespace="{{"{{ .Namespace }}"}}" | ||
- --remote-cluster-id="{{"{{ .ClusterID }}"}}" | ||
- --wireguard-gateway-uid="{{"{{ .GatewayUID }}"}}" | ||
- --mode=client | ||
- --mtu="{{"{{ .Spec.MTU }}"}}" | ||
- --endpoint-address="{{"{{ index .Spec.Endpoint.Addresses 0 }}"}}" | ||
- --endpoint-port="{{"{{ .Spec.Endpoint.Port }}"}}" | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: | ||
- ALL | ||
- name: gateway | ||
image: ghcr.io/liqotech/gateway{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }} | ||
imagePullPolicy: Always | ||
args: | ||
- --name="{{"{{ .Name }}"}}" | ||
- --namespace="{{"{{ .Namespace }}"}}" | ||
- --mode=client | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: | ||
- ALL | ||
{{- end }} |
71 changes: 71 additions & 0 deletions
71
deployments/liqo/templates/liqo-wireguard-gateway-server-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{- $templateConfig := (merge (dict "name" "wg-server-template" "module" "networking") .) -}} | ||
|
||
{{- if .Values.networking.internal }} | ||
|
||
apiVersion: networking.liqo.io/v1alpha1 | ||
kind: WgGatewayServerTemplate | ||
metadata: | ||
name: {{ $templateConfig.name }} | ||
labels: | ||
{{- include "liqo.labels" $templateConfig | nindent 4 }} | ||
spec: | ||
objectKind: | ||
apiVersion: networking.liqo.io/v1alpha1 | ||
kind: WgGatewayServer | ||
template: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 6 }} | ||
spec: | ||
service: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 12 }} | ||
spec: | ||
selector: | ||
{{- include "liqo.labelsTemplate" $templateConfig | nindent 12 }} | ||
type: "{{"{{ .Spec.Endpoint.ServiceType }}"}}" | ||
ports: | ||
- port: "{{"{{ .Spec.Endpoint.Port }}"}}" | ||
protocol: UDP | ||
deployment: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 10 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }} | ||
template: | ||
metadata: | ||
{{- include "liqo.metadataTemplate" $templateConfig | nindent 14 }} | ||
spec: | ||
containers: | ||
- name: wireguard | ||
image: ghcr.io/liqotech/gateway/wireguard{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }} | ||
imagePullPolicy: Always | ||
args: | ||
- --name="{{"{{ .Name }}"}}" | ||
- --namespace="{{"{{ .Namespace }}"}}" | ||
- --remote-cluster-id="{{"{{ .ClusterID }}"}}" | ||
- --wireguard-gateway-uid="{{"{{ .GatewayUID }}"}}" | ||
- --mode=server | ||
- --mtu="{{"{{ .Spec.MTU }}"}}" | ||
- --listen-port="{{"{{ .Spec.Endpoint.Port }}"}}" | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: | ||
- ALL | ||
- name: gateway | ||
image: ghcr.io/liqotech/gateway{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }} | ||
imagePullPolicy: Always | ||
args: | ||
- --name="{{"{{ .Name }}"}}" | ||
- --namespace="{{"{{ .Namespace }}"}}" | ||
- --mode=server | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: | ||
- ALL | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters