Skip to content

Commit dfdc92a

Browse files
committed
Release v1.2.0
1 parent 1b75921 commit dfdc92a

File tree

2 files changed

+83
-3
lines changed

2 files changed

+83
-3
lines changed

README.md

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,86 @@ For the nginx ingress controller, please refer to the official documentation at
7171
kubectl apply -f nginx-ingress-controller-patch.yml
7272
```
7373

74+
### Service Annotations
75+
76+
The CloudStack Kubernetes Provider supports several annotations on LoadBalancer services to customize load balancer behavior:
77+
78+
#### `service.beta.kubernetes.io/cloudstack-load-balancer-proxy-protocol`
79+
80+
**Type:** Boolean (`"true"` or `"false"`)
81+
82+
**Default:** `false`
83+
84+
**Description:** Enables the [HAProxy Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) on a CloudStack load balancer. This annotation only applies to TCP service ports and requires CloudStack 4.6 or later.
85+
86+
**Use Case:** Use this annotation when you need to preserve the original client IP address through the load balancer. This is commonly required for ingress controllers like Traefik or Nginx that need to know the client's real IP address.
87+
88+
**Example:**
89+
```yaml
90+
apiVersion: v1
91+
kind: Service
92+
metadata:
93+
name: my-service
94+
annotations:
95+
service.beta.kubernetes.io/cloudstack-load-balancer-proxy-protocol: "true"
96+
spec:
97+
type: LoadBalancer
98+
ports:
99+
- port: 80
100+
protocol: TCP
101+
```
102+
103+
#### `service.beta.kubernetes.io/cloudstack-load-balancer-hostname`
104+
105+
**Type:** String
106+
107+
**Default:** Not set (uses IP address)
108+
109+
**Description:** Sets a hostname for the load balancer ingress instead of using the IP address. This is a workaround for [Kubernetes issue #66607](https://github.com/kubernetes/kubernetes/issues/66607).
110+
111+
**Use Case:** Use this annotation when you need the LoadBalancer status to return a hostname instead of an IP address. This is useful for DNS-based routing or when you want to expose a specific hostname.
112+
113+
**Example:**
114+
```yaml
115+
apiVersion: v1
116+
kind: Service
117+
metadata:
118+
name: my-service
119+
annotations:
120+
service.beta.kubernetes.io/cloudstack-load-balancer-hostname: "lb.example.com"
121+
spec:
122+
type: LoadBalancer
123+
```
124+
125+
126+
#### `service.beta.kubernetes.io/cloudstack-load-balancer-source-cidrs`
127+
128+
**Type:** String (comma-separated CIDR list)
129+
130+
**Default:** `"0.0.0.0/0"` (allows all sources)
131+
132+
**Description:** Specifies the source CIDR list for firewall rules on the CloudStack load balancer. This restricts which IP addresses can access the load balancer.
133+
134+
**Use Case:** Use this annotation to restrict access to your load balancer to specific IP ranges for security purposes. This is particularly useful for internal services or when you want to limit access to specific networks.
135+
136+
**Example:**
137+
```yaml
138+
apiVersion: v1
139+
kind: Service
140+
metadata:
141+
name: my-service
142+
annotations:
143+
service.beta.kubernetes.io/cloudstack-load-balancer-source-cidrs: "10.0.0.0/8,192.168.1.0/24"
144+
spec:
145+
type: LoadBalancer
146+
```
147+
148+
**Format:** Comma-separated list of CIDR ranges. Spaces around commas are automatically trimmed.
149+
150+
**CloudStack Version:** Updating CIDR lists on existing load balancer rules requires CloudStack 4.22 or later. Creating new load balancer rules with CIDR lists works on earlier versions.
151+
152+
**Note:** If the annotation is empty or not set, the default behavior is to allow all sources (`0.0.0.0/0`). An empty annotation value (`""`) will result in an empty CIDR list, effectively blocking all traffic.
153+
74154
### Node Labels
75155

76156
:warning: **The node name must match the host name, so the controller can fetch and assign metadata from CloudStack.**
@@ -87,13 +167,13 @@ Supported labels for Kubernetes versions up to 1.16 are:
87167
* kubernetes.io/hostname (= the instance name)
88168
* beta.kubernetes.io/instance-type (= the compute offering)
89169
* failure-domain.beta.kubernetes.io/zone (= the zone)
90-
* failure-domain.beta.kubernetes.io/region (also = the zone)
170+
* failure-domain.beta.kubernetes.io/region (= region from config if defined, otherwise the zone)
91171

92172
Supported labels for Kubernetes versions 1.17 and later are:
93173
* kubernetes.io/hostname (= the instance name)
94174
* node.kubernetes.io/instance-type (= the compute offering)
95175
* topology.kubernetes.io/zone (= the zone)
96-
* topology.kubernetes.io/region (also = the zone)
176+
* topology.kubernetes.io/region (= region from config if defined, otherwise the zone)
97177

98178
It is also possible to trigger this process manually by issuing the following command:
99179

deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ spec:
151151
spec:
152152
containers:
153153
- name: cloud-controller-manager
154-
image: apache/cloudstack-kubernetes-provider:v1.1.0
154+
image: apache/cloudstack-kubernetes-provider:v1.2.0
155155
imagePullPolicy: IfNotPresent
156156
args:
157157
- --leader-elect=true

0 commit comments

Comments
 (0)