You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Restricting reconciliation to a LoadBalancer class
128
+
129
+
By default the operator watches every Kubernetes service of type `LoadBalancer`. If you only want it to manage services that target a specific [`loadBalancerClass`](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class), set the `LOAD_BALANCER_CLASS` environment variable (or the `loadBalancerClass` Helm value) to the class name you want the operator to handle. Only services whose `spec.loadBalancerClass` matches that string will be reconciled; other services will be ignored.
130
+
131
+
When deploying a filtered operator you must also add the same `loadBalancerClass` to each Service you expect it to control:
132
+
133
+
```yaml
134
+
apiVersion: v1
135
+
kind: Service
136
+
metadata:
137
+
name: whoami
138
+
spec:
139
+
type: LoadBalancer
140
+
loadBalancerClass: my.chisel.class
141
+
```
142
+
127
143
### Operator-managed exit nodes
128
144
129
145
This operator can automatically provision exit nodes on cloud providers.
Copy file name to clipboardExpand all lines: site/src/content/docs/guides/exposing-a-service.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,30 @@ spec:
26
26
As you can see, the type of this service is `LoadBalancer`, which is required for chisel-operator to pick up on the service.
27
27
Note that Chisel Operator acts on all LoadBalancer services in the cluster by default.
28
28
29
+
## Limiting reconciliation to a LoadBalancer class
30
+
31
+
If you only want the operator to manage services that opt in to a specific load balancer class, you can set the `LOAD_BALANCER_CLASS` environment variable (or the `loadBalancerClass` Helm value) when deploying it.
32
+
Once the operator is running with that filter, only services whose `spec.loadBalancerClass` matches the configured class name will be reconciled; other services are ignored.
33
+
34
+
To opt a service in, add the same `loadBalancerClass` to the Service spec:
35
+
36
+
```yaml
37
+
apiVersion: v1
38
+
kind: Service
39
+
metadata:
40
+
name: whoami
41
+
spec:
42
+
type: LoadBalancer
43
+
loadBalancerClass: my.chisel.class
44
+
selector:
45
+
app: whoami
46
+
ports:
47
+
- port: 80
48
+
targetPort: 80
49
+
```
50
+
51
+
Leaving the value empty (or omitting the field) continues to expose the service through any unfiltered operator instance.
52
+
29
53
Additionally, there's also a commented out annotation, `chisel-operator.io/exit-node-name`.
30
54
By default, Chisel Operator will automatically select a random, unused `ExitNode` on the cluster if a cloud provisioner or exit node annotation is not set.
31
55
If you'd like to force the service to a particular exit node, you can uncomment out the annotation, setting it to the name of the `ExitNode` to target.
For example, to limit reconciliation to services that declare a custom load balancer class, set the `loadBalancerClass` value to the class name you want the operator to handle:
36
+
37
+
```yaml
38
+
loadBalancerClass: my.chisel.class
39
+
```
40
+
41
+
Make sure every Service you expect the operator to manage sets the same value in `spec.loadBalancerClass`.
42
+
35
43
See [the Helm chart directory](https://github.com/FyraLabs/chisel-operator/tree/main/charts/chisel-operator) for more information on the Helm chart.
0 commit comments