Skip to content

Commit

Permalink
disable internal networking
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli authored and adamjensenbot committed Mar 21, 2023
1 parent 94fa5f5 commit 2544b85
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 2 deletions.
4 changes: 4 additions & 0 deletions deployments/liqo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@
| networkManager.config.podCIDR | string | `""` | The subnet used by the cluster for the pods, in CIDR notation |
| networkManager.config.reservedSubnets | list | `[]` | Usually the IPs used for the pods in k8s clusters belong to private subnets. In order to prevent IP conflicting between locally used private subnets in your infrastructure and private subnets belonging to remote clusters you need tell liqo the subnets used in your cluster. E.g if your cluster nodes belong to the 192.168.2.0/24 subnet then you should add that subnet to the reservedSubnets. PodCIDR and serviceCIDR used in the local cluster are automatically added to the reserved list. |
| networkManager.config.serviceCIDR | string | `""` | The subnet used by the cluster for the services, in CIDR notation |
| networkManager.externalIPAM.enabled | bool | `false` | Use an external IPAM to allocate the IP addresses for the pods |
| networkManager.externalIPAM.url | string | `""` | The url of the external IPAM |
| networkManager.imageName | string | `"ghcr.io/liqotech/liqonet"` | networkManager image repository |
| networkManager.pod.annotations | object | `{}` | networkManager pod annotations |
| networkManager.pod.extraArgs | list | `[]` | networkManager pod extra arguments |
| networkManager.pod.labels | object | `{}` | networkManager pod labels |
| networkManager.pod.resources | object | `{"limits":{},"requests":{}}` | networkManager pod containers' resource requests and limits (https://kubernetes.io/docs/user-guide/compute-resources/) |
| networking.internal | bool | `true` | Use the default Liqo network manager |
| networking.reflectIPs | bool | `true` | Reflect pod IPs and EnpointSlices to the remote clusters |
| openshiftConfig.enable | bool | `false` | enable the OpenShift support |
| openshiftConfig.virtualKubeletSCCs | list | `["anyuid"]` | the security context configurations granted to the virtual kubelet in the local cluster. The configuration of one or more SCCs for the virtual kubelet is not strictly required, and privileges can be reduced in production environments. Still, the default configuration (i.e., anyuid) is suggested to prevent problems (i.e., the virtual kubelet fails to add the appropriate labels) when attempting to offload pods not managed by higher-level abstractions (e.g., Deployments), and not associated with a properly privileged service account. Indeed, "anyuid" is the SCC automatically associated with pods created by cluster administrators. Any pod granted a more privileged SCC and not linked to an adequately privileged service account will fail to be offloaded. |
| proxy.config.listeningPort | int | `8118` | port used by envoy proxy |
Expand Down
18 changes: 18 additions & 0 deletions deployments/liqo/templates/liqo-controller-manager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
{{- if not (or (has "--enable-apiserver-support" $vkargs ) (has "--enable-apiserver-support=true" $vkargs ) (has "--enable-apiserver-support=false" $vkargs )) }}
{{- $vkargs = append $vkargs "--enable-apiserver-support=true" }}
{{- end }}
{{- /* Configure the appropriate flags if the internal networking is disabled, if not overridden by the user */ -}}
{{- if not .Values.networking.internal }}
{{- if not (or (has "--node-check-network" $vkargs ) (has "--node-check-network=true" $vkargs ) (has "--node-check-network=false" $vkargs )) }}
{{- $vkargs = append $vkargs "--node-check-network=false" }}
{{- end }}
{{- end }}
{{- /* Configure the appropriate flags if the IP reflection is disabled, if not overridden by the user */ -}}
{{- if not .Values.networking.reflectIPs }}
{{- if not (or (has "--disable-ip-reflection" $vkargs ) (has "--disable-ip-reflection=true" $vkargs ) (has "--disable-ip-reflection=false" $vkargs )) }}
{{- $vkargs = append $vkargs "--disable-ip-reflection" }}
{{- end }}
{{- end }}
{{- /* Configure the appropriate certificate generation approach on EKS clusters, if not overridden by the user */ -}}
{{- if .Values.awsConfig.accessKeyId }}
{{- if not (or (has "--certificate-type=kubelet" $vkargs ) (has "--certificate-type=aws" $vkargs ) (has "--certificate-type=self-signed" $vkargs )) }}
Expand Down Expand Up @@ -66,7 +78,13 @@ spec:
- --enable-incoming-peering={{ .Values.discovery.config.incomingPeeringEnabled }}
- --resource-sharing-percentage={{ .Values.controllerManager.config.resourceSharingPercentage }}
- --kubelet-image={{ .Values.virtualKubelet.imageName }}{{ include "liqo.suffix" $ctrlManagerConfig }}:{{ include "liqo.version" $ctrlManagerConfig }}
{{- if .Values.networkManager.externalIPAM.enabled }}
- --kubelet-ipam-server={{ .Values.networkManager.externalIPAM.url }}
{{- else if not .Values.networking.internal }}
- --kubelet-ipam-server=
{{- else }}
- --kubelet-ipam-server={{ include "liqo.prefixedName" $netManagerConfig }}.{{ .Release.Namespace }}:6000
{{- end }}
- --auto-join-discovered-clusters={{ .Values.discovery.config.autojoin }}
- --enable-storage={{ .Values.storage.enable }}
- --webhook-port={{ .Values.webhook.port }}
Expand Down
4 changes: 4 additions & 0 deletions deployments/liqo/templates/liqo-gateway-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $gatewayConfig := (merge (dict "name" "gateway" "module" "networking") .) -}}

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

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -71,3 +73,5 @@ spec:
- name: WIREGUARD_IMPLEMENTATION
value: {{ .Values.gateway.config.wireguardImplementation }}
hostNetwork: true

{{- end }}
4 changes: 4 additions & 0 deletions deployments/liqo/templates/liqo-gateway-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $gatewayConfig := (merge (dict "name" "gateway" "module" "networking") .) -}}

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

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -64,3 +66,5 @@ metadata:
verbs:
- use
{{- end }}

{{- end }}
4 changes: 4 additions & 0 deletions deployments/liqo/templates/liqo-gateway-service.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $gatewayConfig := (merge (dict "name" "gateway" "module" "networking") .) -}}

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

apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -46,3 +48,5 @@ spec:
port: {{ .Values.gateway.metrics.port }}
targetPort: metrics
{{- end}}

{{- end }}
3 changes: 3 additions & 0 deletions deployments/liqo/templates/liqo-gateway-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.networking.internal }}

---
{{- $gatewayMetricsConfig := (merge (dict "name" "gateway-metrics" "module" "networking") .) -}}
{{- if .Values.gateway.metrics.serviceMonitor.enabled }}
Expand All @@ -17,3 +19,4 @@ spec:
scrapeTimeout: {{ .Values.gateway.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $netManagerConfig := (merge (dict "name" "network-manager" "module" "networking") .) -}}

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

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -57,3 +59,5 @@ spec:
fieldRef:
fieldPath: metadata.namespace
resources: {{- toYaml .Values.networkManager.pod.resources | nindent 12 }}

{{- end }}
6 changes: 5 additions & 1 deletion deployments/liqo/templates/liqo-network-manager-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $netManagerConfig := (merge (dict "name" "network-manager" "module" "networking") .) -}}

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

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -52,4 +54,6 @@ metadata:
name: {{ include "liqo.prefixedName" $netManagerConfig }}
labels:
{{- include "liqo.labels" $netManagerConfig | nindent 4 }}
{{ .Files.Get (include "liqo.role-filename" (dict "prefix" ( include "liqo.prefixedName" $netManagerConfig))) }}
{{ .Files.Get (include "liqo.role-filename" (dict "prefix" ( include "liqo.prefixedName" $netManagerConfig))) }}

{{- end }}
6 changes: 5 additions & 1 deletion deployments/liqo/templates/liqo-network-manager-service.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $netManagerConfig := (merge (dict "name" "network-manager" "module" "networking") .) -}}

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

apiVersion: v1
kind: Service
metadata:
Expand All @@ -15,4 +17,6 @@ spec:
port: 6000
protocol: TCP
selector:
{{- include "liqo.selectorLabels" $netManagerConfig | nindent 4 }}
{{- include "liqo.selectorLabels" $netManagerConfig | nindent 4 }}

{{- end }}
4 changes: 4 additions & 0 deletions deployments/liqo/templates/liqo-route-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $routeConfig := (merge (dict "name" "route" "module" "networking") .) -}}

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

apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down Expand Up @@ -71,3 +73,5 @@ spec:
path: /run/xtables.lock
type: FileOrCreate
name: xtables-lock

{{- end }}
4 changes: 4 additions & 0 deletions deployments/liqo/templates/liqo-route-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
{{- $routeConfig := (merge (dict "name" "route" "module" "networking") .) -}}

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

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -63,3 +65,5 @@ metadata:
verbs:
- use
{{- end }}

{{- end }}
11 changes: 11 additions & 0 deletions deployments/liqo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ apiServer:
# -- Indicates that the API Server is exposing a certificate issued by a trusted Certification Authority
trustedCA: false

networking:
# -- Use the default Liqo network manager
internal: true
# -- Reflect pod IPs and EnpointSlices to the remote clusters
reflectIPs: true

controllerManager:
# -- The number of controller-manager instances to run, which can be increased for active/passive high availability.
replicas: 1
Expand Down Expand Up @@ -108,6 +114,11 @@ gateway:
scrapeTimeout: ""

networkManager:
externalIPAM:
# -- Use an external IPAM to allocate the IP addresses for the pods
enabled: false
# -- The url of the external IPAM
url: ""
pod:
# -- networkManager pod annotations
annotations: {}
Expand Down

0 comments on commit 2544b85

Please sign in to comment.