Skip to content

Commit 85cd7fd

Browse files
authored
Merge pull request #10 from projectsyn/upgrade-1.1.0
Add the LoadBalancer IP Mode capability
2 parents 74dae66 + 7d58e97 commit 85cd7fd

File tree

5 files changed

+63
-3
lines changed

5 files changed

+63
-3
lines changed

class/defaults.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33
=_metadata: {}
44
namespace: syn-cloudscale-cloud-controller-manager
55

6-
manifests_version: 1.0.0
6+
manifests_version: 1.1.0
77

88
args: []
99

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
= Load Balancer IP Mode
2+
3+
This guide describes how to steer the internal traffic flow with cloudscale CCM.
4+
5+
== Internal routing and Proxy Protocol
6+
7+
Kubernetes tries to route traffic within the cluster whenever possible.
8+
This is usually a valid default as it is faster.
9+
10+
However if the proxy protocol or proxy protocol v2 is enabled on both the load balancer and the listening service, the service expects to receive encapsulated traffic using the proxy protocol headers.
11+
12+
If the traffic is routed directly and not passing the load balancer the traffic is not to be encapsulated, which results in the service being unable to parse it correctly and dropping the connection:
13+
[source,bash]
14+
----
15+
curl http://internal-path-to-service/
16+
curl: (56) Recv failure: Connection reset by peer
17+
----
18+
19+
== Kubernetes 1.30 and higher
20+
21+
The cloudscale CCM does set .status.loadBalancer.ingress.ipMode automatically to "Proxy", unless LoadBalancerIPMode is set to "VIP".
22+
This behavior therefore routes the traffic via the load balancer and you have manually configure it to "VIP" to enforce the cluster internal routing.
23+
24+
See the Kubernetes documentation https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-ip-mode[Specifying IPMode of load balancer status] for more information.
25+
26+
== Kubernetes up to 1.29
27+
28+
To force on older Kubernetes routing traffic via the load balancer, you need to replace the service IP with the load balancer hostname.
29+
The cloudscale CCM allows you to set the hostname using the annotation `k8s.cloudscale.ch/loadbalancer-force-hostname`:
30+
[source,yaml]
31+
----
32+
apiVersion: v1
33+
kind: Service
34+
metadata:
35+
annotations:
36+
k8s.cloudscale.ch/loadbalancer-pool-protocol: proxyv2
37+
k8s.cloudscale.ch/loadbalancer-force-hostname: <full qualified load balancer DNS name>
38+
name: example-service
39+
namespace: example
40+
spec:
41+
externalTrafficPolicy: Local
42+
internalTrafficPolicy: Cluster
43+
ipFamilies:
44+
- IPv4
45+
ipFamilyPolicy: SingleStack
46+
ports:
47+
- name: http
48+
port: 80
49+
protocol: TCP
50+
targetPort: http
51+
- name: https
52+
port: 443
53+
protocol: TCP
54+
targetPort: https
55+
selector:
56+
app.kubernetes.io/name: example
57+
sessionAffinity: None
58+
type: LoadBalancer
59+
----
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* xref:index.adoc[Home]
22
* xref:how-tos/deploy-ocp.adoc[]
3+
* xref:how-tos/loadbalance-ipmode.adoc[]
34
* xref:references/parameters.adoc[Parameters]

tests/golden/defaults/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
secretKeyRef:
3535
key: access-token
3636
name: cloudscale
37-
image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.0.0
37+
image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.1.0
3838
imagePullPolicy: IfNotPresent
3939
name: cloudscale-cloud-controller-manager
4040
hostNetwork: true

tests/golden/openshift4/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
secretKeyRef:
3535
key: access-token
3636
name: cloudscale
37-
image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.0.0
37+
image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.1.0
3838
imagePullPolicy: IfNotPresent
3939
name: cloudscale-cloud-controller-manager
4040
hostNetwork: true

0 commit comments

Comments
 (0)