stackabletech / operator-rs

A simple wrapper/framework around kube-rs to make implementing Operators/Controllers easier
Apache License 2.0
116 stars 12 forks source link

Support specifying externalTrafficPolicy in Services created by listener-operator #773

Closed sbernauer closed 3 months ago

sbernauer commented 4 months ago

Description

Replaces https://github.com/stackabletech/operator-rs/pull/562 Needed by https://github.com/stackabletech/listener-operator/pull/57 First raised a year ago here

If i use the ListenerClass external-stable on IONOS k8s the LoadBalancer svc is not reachable. I did find out it's because we set externalTrafficPolicy: Local on the svc here. This PR simply allows users to configure that field, which is than passed to the created Service. We leave the default as-is at Local, so we don't have any breaking change.

This change is needed for external-stable to work on IONOS!

Some background info on that feature

CRD change

---
apiVersion: listeners.stackable.tech/v1alpha1
kind: ListenerClass
metadata:
  name: public
spec:
  serviceType: LoadBalancer
  # NEW:
  serviceExternalTrafficPolicy: Local # or Cluster, defaults to Local
# Tasks
- [ ] operator-rs change
- [ ] Read and use new field in listener-op

Definition of Done Checklist

# Author
- [ ] Changes are OpenShift compatible
- [ ] CRD changes approved
- [ ] Integration tests passed (for non trivial changes)
# Reviewer
- [x] Code contains useful comments
- [ ] (Integration-)Test cases added
- [ ] Documentation added or updated
- [x] Changelog updated
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
# Acceptance
- [ ] Feature Tracker has been updated
- [ ] Proper release label has been added
sbernauer commented 3 months ago

There were no further comments during the voting phase, merging this