Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial listener-operator implementation (#1)
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`.
- Loading branch information