Skip to content

Commit 583c4cc

Browse files
fra98cheina97
authored andcommitted
Customize image version on new networking containers
1 parent 6bf99cd commit 583c4cc

6 files changed

+76
-36
lines changed

deployments/liqo/README.md

+17-10
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
| discovery.pod.extraArgs | list | `[]` | Extra arguments for the discovery pod. |
7272
| discovery.pod.labels | object | `{}` | Labels for the discovery pod. |
7373
| discovery.pod.resources | object | `{"limits":{},"requests":{}}` | Resource requests and limits (https://kubernetes.io/docs/user-guide/compute-resources/) for the discovery pod. |
74-
| fabric.imageName | string | `"ghcr.io/liqotech/fabric"` | Image repository for the fabric pod. |
74+
| fabric.image.name | string | `"ghcr.io/liqotech/fabric"` | Image repository for the fabric pod. |
75+
| fabric.image.version | string | `""` | Custom version for the fabric image. If not specified, the global tag is used. |
7576
| fabric.pod.annotations | object | `{}` | Annotations for the fabric pod. |
7677
| fabric.pod.extraArgs | list | `[]` | Extra arguments for the fabric pod. |
7778
| fabric.pod.labels | object | `{}` | Labels for the fabric pod. |
@@ -137,15 +138,21 @@
137138
| networkManager.pod.labels | object | `{}` | Labels for the networkManager pod. |
138139
| networkManager.pod.resources | object | `{"limits":{},"requests":{}}` | Resource requests and limits (https://kubernetes.io/docs/user-guide/compute-resources/) for the networkManager pod. |
139140
| networking.clientResources | list | `[{"apiVersion":"networking.liqo.io/v1alpha1","resource":"wggatewayclients"}]` | Set the list of resources that implement the GatewayClient |
140-
| networking.gateway | object | `{"ping":{"interval":"2s","lossThreshold":5,"updateStatusInterval":"10s"},"replicas":1,"server":{"service":{"allocateLoadBalancerNodePorts":""}}}` | Set the options for gateway templates |
141-
| networking.gateway.ping | object | `{"interval":"2s","lossThreshold":5,"updateStatusInterval":"10s"}` | Set the options to configure the gateway ping used to check connection |
142-
| networking.gateway.ping.interval | string | `"2s"` | Set the interval between two consecutive pings |
143-
| networking.gateway.ping.lossThreshold | int | `5` | Set the number of consecutive pings that must fail to consider the connection as lost |
144-
| networking.gateway.ping.updateStatusInterval | string | `"10s"` | Set the interval at which the connection resource status is updated |
145-
| networking.gateway.replicas | int | `1` | Set the number of replicas for the gateway deployments |
146-
| networking.gateway.server | object | `{"service":{"allocateLoadBalancerNodePorts":""}}` | Set the options to configure the gateway server |
147-
| networking.gateway.server.service | object | `{"allocateLoadBalancerNodePorts":""}` | Set the options to configure the server service |
148-
| networking.gateway.server.service.allocateLoadBalancerNodePorts | string | `""` | Set to "false" if you expose the gateway service as LoadBalancer and you do not want to create also a NodePort associated to it (Note: this setting is useful only on cloud providers that support this feature). |
141+
| networking.gatewayTemplates | object | `{"container":{"gateway":{"image":{"name":"ghcr.io/liqotech/gateway","version":""}},"geneve":{"image":{"name":"ghcr.io/liqotech/gateway/geneve","version":""}},"wireguard":{"image":{"name":"ghcr.io/liqotech/gateway/wireguard","version":""}}},"ping":{"interval":"2s","lossThreshold":5,"updateStatusInterval":"10s"},"replicas":1,"server":{"service":{"allocateLoadBalancerNodePorts":""}}}` | Set the options for the default gateway (server/client) templates. The default templates use a WireGuard implementation to connect the gateway of the clusters. These options are used to configure only the default templates and should not be considered if a custom template is used. |
142+
| networking.gatewayTemplates.container.gateway.image.name | string | `"ghcr.io/liqotech/gateway"` | Image repository for the gateway container. |
143+
| networking.gatewayTemplates.container.gateway.image.version | string | `""` | Custom version for the gateway image. If not specified, the global tag is used. |
144+
| networking.gatewayTemplates.container.geneve.image.name | string | `"ghcr.io/liqotech/gateway/geneve"` | Image repository for the geneve container. |
145+
| networking.gatewayTemplates.container.geneve.image.version | string | `""` | Custom version for the geneve image. If not specified, the global tag is used. |
146+
| networking.gatewayTemplates.container.wireguard.image.name | string | `"ghcr.io/liqotech/gateway/wireguard"` | Image repository for the wireguard container. |
147+
| networking.gatewayTemplates.container.wireguard.image.version | string | `""` | Custom version for the wireguard image. If not specified, the global tag is used. |
148+
| networking.gatewayTemplates.ping | object | `{"interval":"2s","lossThreshold":5,"updateStatusInterval":"10s"}` | Set the options to configure the gateway ping used to check connection |
149+
| networking.gatewayTemplates.ping.interval | string | `"2s"` | Set the interval between two consecutive pings |
150+
| networking.gatewayTemplates.ping.lossThreshold | int | `5` | Set the number of consecutive pings that must fail to consider the connection as lost |
151+
| networking.gatewayTemplates.ping.updateStatusInterval | string | `"10s"` | Set the interval at which the connection resource status is updated |
152+
| networking.gatewayTemplates.replicas | int | `1` | Set the number of replicas for the gateway deployments |
153+
| networking.gatewayTemplates.server | object | `{"service":{"allocateLoadBalancerNodePorts":""}}` | Set the options to configure the gateway server |
154+
| networking.gatewayTemplates.server.service | object | `{"allocateLoadBalancerNodePorts":""}` | Set the options to configure the server service |
155+
| networking.gatewayTemplates.server.service.allocateLoadBalancerNodePorts | string | `""` | Set to "false" if you expose the gateway service as LoadBalancer and you do not want to create also a NodePort associated to it (Note: this setting is useful only on cloud providers that support this feature). |
149156
| networking.internal | bool | `true` | Use the default Liqo network manager. |
150157
| networking.iptables | object | `{"mode":"nf_tables"}` | Iptables configuration tuning. |
151158
| networking.iptables.mode | string | `"nf_tables"` | Select the iptables mode to use. Possible values are "legacy" and "nf_tables". |

deployments/liqo/templates/liqo-fabric-daemonset.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
{{- $fabricConfig := (merge (dict "name" "fabric" "module" "networking") .) -}}
2+
{{- $fabricConfig := (merge (dict "name" "fabric" "module" "networking" "version" .Values.fabric.image.version ) .) -}}
33

44
{{- if .Values.networking.internal }}
55

@@ -37,7 +37,7 @@ spec:
3737
{{- end }}
3838
serviceAccountName: {{ include "liqo.prefixedName" $fabricConfig }}
3939
containers:
40-
- image: {{ .Values.fabric.imageName }}{{ include "liqo.suffix" $fabricConfig }}:{{ include "liqo.version" $fabricConfig }}
40+
- image: {{ .Values.fabric.image.name }}{{ include "liqo.suffix" $fabricConfig }}:{{ include "liqo.version" $fabricConfig }}
4141
imagePullPolicy: {{ .Values.pullPolicy }}
4242
name: {{ $fabricConfig.name }}
4343
command: ["/usr/bin/liqo-fabric"]

deployments/liqo/templates/liqo-wireguard-gateway-client-template.yaml

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{{- $templateConfig := (merge (dict "name" "wireguard-client" "module" "networking") .) -}}
2+
{{- $gatewayConfig := (merge (dict "name" "gateway" "module" "networking" "version" .Values.networking.gatewayTemplates.container.gateway.image.version) .) -}}
3+
{{- $wireguardConfig := (merge (dict "name" "gateway-wireguard" "module" "networking" "version" .Values.networking.gatewayTemplates.container.wireguard.image.version) .) -}}
4+
{{- $geneveConfig := (merge (dict "name" "gateway-geneve" "module" "networking" "version" .Values.networking.gatewayTemplates.container.geneve.image.version) .) -}}
25

36
{{- if .Values.networking.internal }}
47

@@ -20,7 +23,7 @@ spec:
2023
metadata:
2124
{{- include "liqo.metadataTemplate" $templateConfig | nindent 10 }}
2225
spec:
23-
replicas: {{ .Values.networking.gateway.replicas }}
26+
replicas: {{ .Values.networking.gatewayTemplates.replicas }}
2427
selector:
2528
matchLabels:
2629
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }}
@@ -32,7 +35,7 @@ spec:
3235
serviceAccountName: "{{"{{ .Name }}"}}"
3336
containers:
3437
- name: gateway
35-
image: ghcr.io/liqotech/gateway{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }}
38+
image: {{ .Values.networking.gatewayTemplates.container.gateway.image.name }}{{ include "liqo.suffix" $gatewayConfig }}:{{ include "liqo.version" $gatewayConfig }}
3639
imagePullPolicy: {{ .Values.pullPolicy }}
3740
args:
3841
- --name={{"{{ .Name }}"}}
@@ -43,10 +46,10 @@ spec:
4346
- --metrics-address=:8080
4447
- --health-probe-bind-address=:8081
4548
- --ping-enabled=true
46-
- --ping-loss-threshold={{ .Values.networking.gateway.ping.lossThreshold }}
47-
- --ping-interval={{ .Values.networking.gateway.ping.interval }}
48-
- --ping-update-status-interval={{ .Values.networking.gateway.ping.updateStatusInterval }}
49-
{{- if gt .Values.networking.gateway.replicas 1.0 }}
49+
- --ping-loss-threshold={{ .Values.networking.gatewayTemplates.ping.lossThreshold }}
50+
- --ping-interval={{ .Values.networking.gatewayTemplates.ping.interval }}
51+
- --ping-update-status-interval={{ .Values.networking.gatewayTemplates.ping.updateStatusInterval }}
52+
{{- if gt .Values.networking.gatewayTemplates.replicas 1.0 }}
5053
- --leader-election=true
5154
{{- end }}
5255
securityContext:
@@ -55,7 +58,7 @@ spec:
5558
- NET_ADMIN
5659
- NET_RAW
5760
- name: wireguard
58-
image: ghcr.io/liqotech/gateway/wireguard{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }}
61+
image: {{ .Values.networking.gatewayTemplates.container.wireguard.image.name }}{{ include "liqo.suffix" $wireguardConfig }}:{{ include "liqo.version" $wireguardConfig }}
5962
imagePullPolicy: {{ .Values.pullPolicy }}
6063
args:
6164
- --name={{"{{ .Name }}"}}
@@ -74,12 +77,13 @@ spec:
7477
- NET_ADMIN
7578
- NET_RAW
7679
- name: geneve
77-
image: ghcr.io/liqotech/gateway/geneve{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }}
80+
image: {{ .Values.networking.gatewayTemplates.container.geneve.image.name }}{{ include "liqo.suffix" $geneveConfig }}:{{ include "liqo.version" $geneveConfig }}
7881
imagePullPolicy: {{ .Values.pullPolicy }}
7982
args:
8083
- --name={{"{{ .Name }}"}}
8184
- --namespace={{"{{ .Namespace }}"}}
8285
- --remote-cluster-id={{"{{ .ClusterID }}"}}
86+
- --gateway-uid={{"{{ .GatewayUID }}"}}
8387
- --mode=server
8488
- --metrics-address=:8084
8589
- --health-probe-bind-address=:8085

deployments/liqo/templates/liqo-wireguard-gateway-server-template.yaml

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{{- $templateConfig := (merge (dict "name" "wireguard-server" "module" "networking") .) -}}
2+
{{- $gatewayConfig := (merge (dict "name" "gateway" "module" "networking" "version" .Values.networking.gatewayTemplates.container.gateway.image.version) .) -}}
3+
{{- $wireguardConfig := (merge (dict "name" "gateway-wireguard" "module" "networking" "version" .Values.networking.gatewayTemplates.container.wireguard.image.version) .) -}}
4+
{{- $geneveConfig := (merge (dict "name" "gateway-geneve" "module" "networking" "version" .Values.networking.gatewayTemplates.container.geneve.image.version) .) -}}
25

36
{{- if .Values.networking.internal }}
47

@@ -27,14 +30,14 @@ spec:
2730
- port: "{{"{{ .Spec.Endpoint.Port }}"}}"
2831
protocol: UDP
2932
targetPort: "{{"{{ .Spec.Endpoint.Port }}"}}"
30-
{{- if .Values.networking.gateway.server.service.allocateLoadBalancerNodePorts }}
31-
allocateLoadBalancerNodePorts: {{ .Values.networking.gateway.server.service.allocateLoadBalancerNodePorts }}
33+
{{- if .Values.networking.gatewayTemplates.server.service.allocateLoadBalancerNodePorts }}
34+
allocateLoadBalancerNodePorts: {{ .Values.networking.gatewayTemplates.server.service.allocateLoadBalancerNodePorts }}
3235
{{- end }}
3336
deployment:
3437
metadata:
3538
{{- include "liqo.metadataTemplate" $templateConfig | nindent 10 }}
3639
spec:
37-
replicas: {{ .Values.networking.gateway.replicas }}
40+
replicas: {{ .Values.networking.gatewayTemplates.replicas }}
3841
selector:
3942
matchLabels:
4043
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }}
@@ -46,7 +49,7 @@ spec:
4649
serviceAccountName: "{{"{{ .Name }}"}}"
4750
containers:
4851
- name: gateway
49-
image: ghcr.io/liqotech/gateway{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }}
52+
image: {{ .Values.networking.gatewayTemplates.container.gateway.image.name }}{{ include "liqo.suffix" $gatewayConfig }}:{{ include "liqo.version" $gatewayConfig }}
5053
imagePullPolicy: {{ .Values.pullPolicy }}
5154
args:
5255
- --name={{"{{ .Name }}"}}
@@ -57,10 +60,10 @@ spec:
5760
- --metrics-address=:8080
5861
- --health-probe-bind-address=:8081
5962
- --ping-enabled=true
60-
- --ping-loss-threshold={{ .Values.networking.gateway.ping.lossThreshold }}
61-
- --ping-interval={{ .Values.networking.gateway.ping.interval }}
62-
- --ping-update-status-interval={{ .Values.networking.gateway.ping.updateStatusInterval }}
63-
{{- if gt .Values.networking.gateway.replicas 1.0 }}
63+
- --ping-loss-threshold={{ .Values.networking.gatewayTemplates.ping.lossThreshold }}
64+
- --ping-interval={{ .Values.networking.gatewayTemplates.ping.interval }}
65+
- --ping-update-status-interval={{ .Values.networking.gatewayTemplates.ping.updateStatusInterval }}
66+
{{- if gt .Values.networking.gatewayTemplates.replicas 1.0 }}
6467
- --leader-election=true
6568
{{- end }}
6669
securityContext:
@@ -69,7 +72,7 @@ spec:
6972
- NET_ADMIN
7073
- NET_RAW
7174
- name: wireguard
72-
image: ghcr.io/liqotech/gateway/wireguard{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }}
75+
image: {{ .Values.networking.gatewayTemplates.container.wireguard.image.name }}{{ include "liqo.suffix" $wireguardConfig }}:{{ include "liqo.version" $wireguardConfig }}
7376
imagePullPolicy: {{ .Values.pullPolicy }}
7477
args:
7578
- --name={{"{{ .Name }}"}}
@@ -87,12 +90,13 @@ spec:
8790
- NET_ADMIN
8891
- NET_RAW
8992
- name: geneve
90-
image: ghcr.io/liqotech/gateway/geneve{{ include "liqo.suffix" $templateConfig }}:{{ include "liqo.version" $templateConfig }}
93+
image: {{ .Values.networking.gatewayTemplates.container.geneve.image.name }}{{ include "liqo.suffix" $geneveConfig }}:{{ include "liqo.version" $geneveConfig }}
9194
imagePullPolicy: {{ .Values.pullPolicy }}
9295
args:
9396
- --name={{"{{ .Name }}"}}
9497
- --namespace={{"{{ .Namespace }}"}}
9598
- --remote-cluster-id={{"{{ .ClusterID }}"}}
99+
- --gateway-uid={{"{{ .GatewayUID }}"}}
96100
- --mode=server
97101
- --metrics-address=:8084
98102
- --health-probe-bind-address=:8085

deployments/liqo/values.yaml

+29-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ networking:
4949
clientResources:
5050
- apiVersion: networking.liqo.io/v1alpha1
5151
resource: wggatewayclients
52-
# -- Set the options for gateway templates
53-
gateway:
52+
# -- Set the options for the default gateway (server/client) templates.
53+
# The default templates use a WireGuard implementation to connect the gateway of the clusters.
54+
# These options are used to configure only the default templates and should not be considered
55+
# if a custom template is used.
56+
gatewayTemplates:
5457
# -- Set the number of replicas for the gateway deployments
5558
replicas: 1
5659
# -- Set the options to configure the gateway ping used to check connection
@@ -67,6 +70,25 @@ networking:
6770
service:
6871
# -- Set to "false" if you expose the gateway service as LoadBalancer and you do not want to create also a NodePort associated to it (Note: this setting is useful only on cloud providers that support this feature).
6972
allocateLoadBalancerNodePorts: ""
73+
container:
74+
gateway:
75+
image:
76+
# -- Image repository for the gateway container.
77+
name: "ghcr.io/liqotech/gateway"
78+
# -- Custom version for the gateway image. If not specified, the global tag is used.
79+
version: ""
80+
wireguard:
81+
image:
82+
# -- Image repository for the wireguard container.
83+
name: "ghcr.io/liqotech/gateway/wireguard"
84+
# -- Custom version for the wireguard image. If not specified, the global tag is used.
85+
version: ""
86+
geneve:
87+
image:
88+
# -- Image repository for the geneve container.
89+
name: "ghcr.io/liqotech/gateway/geneve"
90+
# -- Custom version for the geneve image. If not specified, the global tag is used.
91+
version: ""
7092

7193
peering:
7294
# -- Set the default configuration for the networking resources created during the peering process
@@ -261,8 +283,11 @@ fabric:
261283
resources:
262284
limits: {}
263285
requests: {}
264-
# -- Image repository for the fabric pod.
265-
imageName: "ghcr.io/liqotech/fabric"
286+
image:
287+
# -- Image repository for the fabric pod.
288+
name: "ghcr.io/liqotech/fabric"
289+
# -- Custom version for the fabric image. If not specified, the global tag is used.
290+
version: ""
266291
# -- Extra tolerations for the fabric daemonset.
267292
tolerations: []
268293

pkg/utils/geneve/k8s.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ func GetGeneveTunnelID(ctx context.Context, cl client.Client,
4343
return 0, fmt.Errorf("no geneve tunnel found for internalfabric %s and internalnode %s",
4444
internalFabricName, internalNodeName)
4545
case 1:
46+
return list.Items[0].Spec.ID, nil
47+
default:
4648
return 0, fmt.Errorf("multiple geneve tunnels found for internalfabric %s and internalnode %s",
4749
internalFabricName, internalNodeName)
48-
default:
49-
return list.Items[0].Spec.ID, nil
5050
}
5151
}

0 commit comments

Comments
 (0)