-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Initial listener-operator implementation #1
Conversation
K8s API consumers also need to be able to introspect LB metadata, such as when building product operators build client config files.
I've tried to document basic operation now. Would appreciate if someone could check that it more or less makes sense... Not at all sold on the CRD naming, since we end up with A few other considered but discarded options....
|
bors r+ |
bors ping |
pong |
bors r+ |
👎 Rejected by code reviews |
Comments addressed, torch handed over to Sigi
bors r+ |
This implements the basic concept, but is sitll missing a fair bit of documentation. The CRDs should also be moved into operator-rs since some operators will depend on them. Essentially, this provides two new CRDs and a CSI driver: ```yaml --- apiVersion: lb.stackable.tech/v1alpha1 kind: LoadBalancer metadata: name: example-public-lb namespace: default spec: className: public podSelector: statefulset.kubernetes.io/pod-name: example-public-pod ports: - name: http port: 80 protocol: TCP status: ingressAddresses: - address: 172.18.0.3 ports: http: 80 --- apiVersion: lb.stackable.tech/v1alpha1 kind: LoadBalancerClass metadata: name: public spec: serviceType: LoadBalancer ``` `LoadBalancerClass` defines the policy for how a specific "kind of service" (for example: public with dynamic discovery, vpc-internal with static discovery) should be deployed on a given network. `LoadBalancer` then links deploys a `Service` (or potentially something else in the future, where relevant) according to these rules, and gives back (via the `status`) a list of addresses that can be used to access the service, including whatever port remappings may be required. The CSI driver can also be used to project this address information into the pod itself: ```yaml --- apiVersion: v1 kind: Pod metadata: name: example-public-pod spec: volumes: - name: lb ephemeral: volumeClaimTemplate: metadata: annotations: lb.stackable.tech/lb-name: example-public-lb spec: storageClassName: lb.stackable.tech accessModes: - ReadWriteMany resources: requests: storage: "1" containers: - name: nginx image: nginx volumeMounts: - name: lb mountPath: /lb ``` The CSI driver can also be configured to automatically create a LB based on the `Pod`'s settings: ```yaml --- apiVersion: v1 kind: Pod metadata: name: example-public-pod spec: volumes: - name: lb ephemeral: volumeClaimTemplate: metadata: annotations: lb.stackable.tech/lb-class: public spec: storageClassName: lb.stackable.tech accessModes: - ReadWriteMany resources: requests: storage: "1" containers: - name: nginx image: nginx volumeMounts: - name: lb mountPath: /lb ports: - name: http containerPort: 80 ``` Finally, the CSI driver also configures stickiness when used with persistent PVCs (such as manually provisioned ones, or ones created via `StatefulSet.spec.volumeClaimTemplates`), if it would be useful for the given `LoadBalancerClass`.
Pull request successfully merged into main. Build succeeded: |
I'll need some help on this one. |
Sort of... I'd say something like "enable configurable listeners" (not happy about this name either) is a feature worth tracking per product operator. |
Especially for Kafka where listener has another but similar meaning... |
Myeah. "Stackable listeners are used to expose Kafka listeners", but I agree that they need to be distinguished in the feature tracker... |
Maybe something along the lines of "Centrally managed access patterns/methods/..." Listener is a more technical way of phrasing this I guess, what we actually mean is how stuff can be accessed, no? |
I'll let it simmer for a few days. I'm not really happy yet but I'll pick something. Thanks for the input. |
Hm... apparantly my comment from this morning never made it here.. I was thinking we don't need to add it to the feature tracker right now, as this PR didn't include the functionality in any operator, it only created the necessary scaffolding that we need in place for this. |
Excellent. Let future us deal with that problem then. Happy to move it to done in that case |
This implements the basic concept, but is sitll missing a fair bit of documentation. The CRDs should also be moved into operator-rs since some operators will depend on them.
Essentially, this provides two new CRDs and a CSI driver:
LoadBalancerClass
defines the policy for how a specific "kind of service" (for example: public with dynamic discovery, vpc-internal with static discovery) should be deployed on a given network.LoadBalancer
then links deploys aService
(or potentially something else in the future, where relevant) according to these rules, and gives back (via thestatus
) a list of addresses that can be used to access the service, including whatever port remappings may be required.The CSI driver can also be used to project this address information into the pod itself:
The CSI driver can also be configured to automatically create a LB based on the
Pod
's settings:Finally, the CSI driver also configures stickiness when used with persistent PVCs (such as manually provisioned ones, or ones created via
StatefulSet.spec.volumeClaimTemplates
), if it would be useful for the givenLoadBalancerClass
.