Skip to content

Commit bd72141

Browse files
authored
Merge branch 'liqotech:master' into master
2 parents 9e7b2eb + fd1d6f8 commit bd72141

File tree

55 files changed

+830
-442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+830
-442
lines changed

apis/networking/v1beta1/firewall/chain_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type Chain struct {
8383
Rules RulesSet `json:"rules"`
8484
// Type defines what this chain will be used for.
8585
// +kubebuilder:validation:Enum="filter";"route";"nat"
86-
Type *ChainType `json:"type"`
86+
Type ChainType `json:"type"`
8787
// Policy defines what this chain default policy will be.
8888
// +kubebuilder:validation:Enum="drop";"accept"
8989
Policy *ChainPolicy `json:"policy"`

apis/networking/v1beta1/firewall/zz_generated.deepcopy.go

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/liqo/Dockerfile

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,36 @@ FROM alpine:3.20
44
ARG COMPONENT
55
ARG TARGETARCH
66

7+
RUN if [ "$COMPONENT" = "geneve" ] || [ "$COMPONENT" = "wireguard" ] || [ "$COMPONENT" = "gateway" ]; then \
8+
set -x; \
9+
apk add --no-cache iproute2 nftables bash wireguard-tools tcpdump conntrack-tools curl iputils; \
10+
fi
11+
12+
RUN if [ "$COMPONENT" = "wireguard" ]; then \
13+
set -e; \
14+
apk add --no-cache git curl; \
15+
GO_VERSION=1.22.4; \
16+
# Map Docker TARGETARCH to Go architecture names \
17+
case "$TARGETARCH" in \
18+
amd64) GO_ARCH=amd64 ;; \
19+
arm64) GO_ARCH=arm64 ;; \
20+
arm) GO_ARCH=armv6l ;; \
21+
*) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \
22+
esac; \
23+
curl -L https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz | tar -C /usr/local -xz; \
24+
export PATH="/usr/local/go/bin:$PATH"; \
25+
git clone https://git.zx2c4.com/wireguard-go; cd wireguard-go; git checkout f333402bd9cbe0f3eeb02507bd14e23d7d639280; \
26+
CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH /usr/local/go/bin/go build -ldflags="-s -w" -o /usr/bin/wireguard-go; \
27+
cd .. && rm -rf wireguard-go; \
28+
rm -rf /usr/local/go; \
29+
apk del git curl; \
30+
fi
31+
732
# Copy the correct binary for the architecture
833
COPY ./bin/${TARGETARCH}/${COMPONENT}_linux_${TARGETARCH} /usr/bin/${COMPONENT}
934
RUN chmod +x /usr/bin/${COMPONENT}
1035
RUN ln -s /usr/bin/${COMPONENT} /usr/bin/liqo-component
1136

12-
RUN if [ "$COMPONENT" = "geneve" ] || [ "$COMPONENT" = "wireguard" ] || [ "$COMPONENT" = "gateway" ]; then \
13-
apk add --no-cache iproute2 nftables bash wireguard-tools tcpdump conntrack-tools curl iputils; \
14-
fi
15-
1637
WORKDIR /workspace
1738

1839
ENTRYPOINT ["/usr/bin/liqo-component"]

build/liqo/build.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@ set -e
44
set -o nounset
55
set -o pipefail
66

7-
usage() {
8-
echo "Usage: $0 [-m] [-p] <component-folder>"
9-
echo " -p Push the built image to the registry"
10-
echo " -h Show this help message"
11-
}
12-
137
if [ $# -ne 1 ]; then
14-
usage
8+
echo "Usage: $0 <component-folder>"
159
exit 1
1610
fi
1711

cmd/liqo-controller-manager/modules/authentication.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type AuthOption struct {
4747
APIServerAddressOverride string
4848
CAOverrideB64 string
4949
TrustedCA bool
50+
TLSCompatibilityMode bool
5051
SliceStatusOptions *remoteresourceslicecontroller.SliceStatusOptions
5152
}
5253

@@ -61,6 +62,7 @@ func NewAuthOption(identityProvider identitymanager.IdentityProvider, namespaceM
6162
APIServerAddressOverride: opts.APIServerAddressOverride,
6263
CAOverrideB64: opts.CAOverride,
6364
TrustedCA: opts.TrustedCA,
65+
TLSCompatibilityMode: opts.TLSCompatibilityMode,
6466
SliceStatusOptions: &remoteresourceslicecontroller.SliceStatusOptions{
6567
EnableStorage: opts.EnableStorage,
6668
LocalRealStorageClassName: opts.RealStorageClassName,
@@ -85,7 +87,7 @@ func SetupAuthenticationModule(ctx context.Context, mgr manager.Manager, uncache
8587
}
8688
}
8789

88-
if err := enforceAuthenticationKeys(ctx, uncachedClient, opts.LiqoNamespace); err != nil {
90+
if err := enforceAuthenticationKeys(ctx, uncachedClient, opts.LiqoNamespace, opts.TLSCompatibilityMode); err != nil {
8991
klog.Errorf("Unable to enforce authentication keys: %v", err)
9092
return err
9193
}
@@ -178,8 +180,8 @@ func SetupAuthenticationModule(ctx context.Context, mgr manager.Manager, uncache
178180
return nil
179181
}
180182

181-
func enforceAuthenticationKeys(ctx context.Context, cl client.Client, liqoNamespace string) error {
182-
if err := authentication.InitClusterKeys(ctx, cl, liqoNamespace); err != nil {
183+
func enforceAuthenticationKeys(ctx context.Context, cl client.Client, liqoNamespace string, tlsCompatibilityMode bool) error {
184+
if err := authentication.InitClusterKeys(ctx, cl, liqoNamespace, tlsCompatibilityMode); err != nil {
183185
return err
184186
}
185187

cmd/liqoctl/cmd/peer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Examples:
5252
$ {{ .Executable }} peer --remote-kubeconfig <provider>
5353
$ {{ .Executable }} peer --remote-kubeconfig <provider> --gw-server-service-type NodePort
5454
$ {{ .Executable }} peer --remote-kubeconfig <provider> --cpu 2 --memory 4Gi --pods 10
55+
$ {{ .Executable }} peer --remote-kubeconfig <provider> --cpu 2 --memory 4Gi --pods 10 --resource nvidia.com/gpu=2
5556
$ {{ .Executable }} peer --remote-kubeconfig <provider> --create-resource-slice false
5657
$ {{ .Executable }} peer --remote-kubeconfig <provider> --create-virtual-node false
5758
`
@@ -129,6 +130,8 @@ func newPeerCommand(ctx context.Context, f *factory.Factory) *cobra.Command {
129130
cmd.Flags().StringVar(&options.CPU, "cpu", "", "The amount of CPU requested for the VirtualNode")
130131
cmd.Flags().StringVar(&options.Memory, "memory", "", "The amount of memory requested for the VirtualNode")
131132
cmd.Flags().StringVar(&options.Pods, "pods", "", "The amount of pods requested for the VirtualNode")
133+
cmd.Flags().StringToStringVar(
134+
&options.OtherResources, "resource", nil, "Other resources requested for the VirtualNode (e.g., '--resource=nvidia.com/gpu=2')")
132135

133136
return cmd
134137
}

cmd/virtual-kubelet/root/http.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ func newCertificateRetriever(kubeClient kubernetes.Interface, signer, nodeName s
189189
certificates.UsageServerAuth,
190190
},
191191
CertificateStore: certificateStore,
192-
Logf: klog.V(2).Infof,
193192
})
194193
if err != nil {
195194
return nil, fmt.Errorf("failed to initialize server certificate manager: %w", err)

deployments/liqo/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
| authentication.awsConfig.secretAccessKey | string | `""` | SecretAccessKey for the Liqo user. |
1212
| authentication.awsConfig.useExistingSecret | bool | `false` | Use an existing secret to configure the AWS credentials. |
1313
| authentication.enabled | bool | `true` | Enable/Disable the authentication module. |
14-
| common.affinity | object | `{}` | Affinity for all liqo pods, excluding virtual kubelet. |
14+
| authentication.tlsCompatibilityMode | bool | `false` | Enable TLS compatibility mode for client certificates and keys. If set to true, Liqo will use widely supported algorithm (RSA) instead of Ed25519 (default) for generating private keys and CSRs. Enable this option to ensure compatibility with systems that do not yet support Ed25519 as signature algorithm. |
15+
| common.affinity | object | `{}` | Affinity for all liqo pods, excluding virtual kubelet pod and fabric daemonset. |
1516
| common.extraArgs | list | `[]` | Extra arguments for all liqo pods, excluding virtual kubelet. |
1617
| common.globalAnnotations | object | `{}` | Global annotations to be added to all resources created by Liqo controllers |
1718
| common.globalLabels | object | `{"liqo.io/managed":"true"}` | Global labels to be added to all resources created by Liqo controllers |
18-
| common.nodeSelector | object | `{}` | NodeSelector for all liqo pods, excluding virtual kubelet. |
19-
| common.tolerations | list | `[]` | Tolerations for all liqo pods, excluding virtual kubelet. |
19+
| common.nodeSelector | object | `{}` | NodeSelector for all liqo pods, excluding virtual kubelet pod and fabric daemonset. |
20+
| common.tolerations | list | `[]` | Tolerations for all liqo pods, excluding virtual kubelet pod and fabric daemonset. |
2021
| controllerManager.config.defaultLimitsEnforcement | string | `"None"` | Defines how strict is the enforcement of the quota offered by the remote cluster. enableResourceEnforcement must be enabled to use this feature. Possible values are: None, Soft, Hard. None: the offloaded pods might not have the resource `requests` or `limits`. Soft: it forces the offloaded pods to have `requests` set. If the pods go over the requests, the total used resources might go over the quota. Hard: it forces the offloaded pods to have `limits` and `requests` set, with `requests` == `limits`. This is the safest mode as the consumer cluster cannot go over the quota. |
2122
| controllerManager.config.enableNodeFailureController | bool | `false` | Ensure offloaded pods running on a failed node are evicted and rescheduled on a healthy node, preventing them to remain in a terminating state indefinitely. This feature can be useful in case of remote node failure to guarantee better service continuity and to have the expected pods workload on the remote cluster. However, enabling this feature could produce zombies in the worker node, in case the node returns Ready again without a restart. |
2223
| controllerManager.config.enableResourceEnforcement | bool | `true` | It enforces offerer-side that offloaded pods do not exceed offered resources (based on container limits). This feature is suggested to be enabled when consumer-side enforcement is not sufficient. It makes sure that the sum of the requests of the offloaded pods never exceeds the quota offered by the remote cluster. The quota can be still exceeded if no limits and requests are defined in the offloaded pods or if the limits are larger than the requests. For a stricter enforcement, the defaultLimitsEnforcement can be set to Hard. |
@@ -85,19 +86,21 @@
8586
| nameOverride | string | `""` | Override the standard name used by Helm and associated to Kubernetes/Liqo resources. |
8687
| networking.clientResources | list | `[{"apiVersion":"networking.liqo.io/v1beta1","resource":"wggatewayclients"}]` | Set the list of resources that implement the GatewayClient |
8788
| networking.enabled | bool | `true` | Use the default Liqo networking module. |
89+
| networking.fabric.affinity | object | `{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"liqo.io/type","operator":"NotIn","values":["virtual-node"]}]}]}}}` | Affinity for the fabric pod. |
8890
| networking.fabric.config.fullMasquerade | bool | `false` | Enabe/Disable the full masquerade mode for the fabric pod. It means that all traffic will be masquerade using the first external cidr IP, instead of using the pod IP. Full masquerade is useful when the cluster nodeports uses a PodCIDR IP to masqerade the incoming traffic. IMPORTANT: Please consider that enabling this feature will masquerade the source IP of traffic towards a remote cluster, making impossible for a pod that receives the traffic to know the original source IP. |
8991
| networking.fabric.config.gatewayMasqueradeBypass | bool | `false` | Enable/Disable the masquerade bypass for the gateway pods. It means that the packets from gateway pods will not be masqueraded from the host where the pod is scheduled. This is useful in scenarios where CNIs masquerade the traffic from pod to nodes. For example this is required when using the Azure CNI or Kindnet. |
9092
| networking.fabric.config.healthProbeBindAddressPort | string | `"8081"` | Set the port where the fabric pod will expose the health probe. To disable the health probe, set the port to 0. |
9193
| networking.fabric.config.metricsAddressPort | string | `"8082"` | Set the port where the fabric pod will expose the metrics. To disable the metrics, set the port to 0. |
9294
| networking.fabric.config.nftablesMonitor | bool | `false` | Enable/Disable the nftables monitor for the fabric pod. It means that the fabric pod will monitor the nftables rules and will restore them in case of changes. In some cases (like K3S), this monitor can cause a huge amount of CPU usage. If you are experiencing high CPU usage, you can disable this feature. |
9395
| networking.fabric.image.name | string | `"ghcr.io/liqotech/fabric"` | Image repository for the fabric pod. |
9496
| networking.fabric.image.version | string | `""` | Custom version for the fabric image. If not specified, the global tag is used. |
97+
| networking.fabric.nodeSelector | object | `{}` | NodeSelector for the fabric pod. |
9598
| networking.fabric.pod.annotations | object | `{}` | Annotations for the fabric pod. |
9699
| networking.fabric.pod.extraArgs | list | `[]` | Extra arguments for the fabric pod. |
97100
| networking.fabric.pod.labels | object | `{}` | Labels for the fabric pod. |
98101
| networking.fabric.pod.priorityClassName | string | `""` | PriorityClassName (https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority) for the fabric pod. |
99102
| networking.fabric.pod.resources | object | `{"limits":{},"requests":{}}` | Resource requests and limits (https://kubernetes.io/docs/user-guide/compute-resources/) for the fabric pod. |
100-
| networking.fabric.tolerations | list | `[]` | Extra tolerations for the fabric daemonset. |
103+
| networking.fabric.tolerations | list | `[]` | Extra tolerations for the fabric pod. |
101104
| 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":"","annotations":{}}},"wireguard":{"implementation":"kernel"}}` | 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. |
102105
| networking.gatewayTemplates.container.gateway.image.name | string | `"ghcr.io/liqotech/gateway"` | Image repository for the gateway container. |
103106
| networking.gatewayTemplates.container.gateway.image.version | string | `""` | Custom version for the gateway image. If not specified, the global tag is used. |

deployments/liqo/charts/liqo-crds/crds/ipam.liqo.io_ips.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,12 @@ spec:
451451
type: object
452452
trafficDistribution:
453453
description: |-
454-
TrafficDistribution offers a way to express preferences for how traffic is
455-
distributed to Service endpoints. Implementations can use this field as a
456-
hint, but are not required to guarantee strict adherence. If the field is
457-
not set, the implementation will apply its default routing strategy. If set
458-
to "PreferClose", implementations should prioritize endpoints that are
459-
topologically close (e.g., same zone).
460-
This is a beta field and requires enabling ServiceTrafficDistribution feature.
454+
TrafficDistribution offers a way to express preferences for how traffic
455+
is distributed to Service endpoints. Implementations can use this field
456+
as a hint, but are not required to guarantee strict adherence. If the
457+
field is not set, the implementation will apply its default routing
458+
strategy. If set to "PreferClose", implementations should prioritize
459+
endpoints that are in the same zone.
461460
type: string
462461
type:
463462
description: |-

0 commit comments

Comments
 (0)