Skip to content

Commit 4749b73

Browse files
committed
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`.
1 parent 6c72318 commit 4749b73

File tree

99 files changed

+7352
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+7352
-0
lines changed

.dockerignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
debug/
2+
target/
3+
**/*.rs.bk
4+
5+
.idea/
6+
*.iws
7+
8+
image.tar
9+
10+
# We do NOT want to ignore .git because we use the `built` crate to gather the current git commit hash at built time
11+
# This means we need the .git directory in our Docker image, it will be thrown away and won't be included in the final image

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
ignore = E111,E501,E114

.github/ISSUE_TEMPLATE/bug_report.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: "🐛 Bug Report"
3+
description: "If something isn't working as expected 🤔."
4+
labels: ["type/bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
9+
10+
- type: input
11+
attributes:
12+
label: Affected version
13+
description: Which version do you see this bug in?
14+
15+
- type: textarea
16+
attributes:
17+
label: Current and expected behavior
18+
description: A clear and concise description of what the operator is doing and what you would expect.
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
attributes:
24+
label: Possible solution
25+
description: "If you have suggestions on a fix for the bug."
26+
27+
- type: textarea
28+
attributes:
29+
label: Additional context
30+
description: "Add any other context about the problem here. Or a screenshot if applicable."
31+
32+
- type: textarea
33+
attributes:
34+
label: Environment
35+
description: |
36+
What type of kubernetes cluster you are running aginst (k3s/eks/aks/gke/other) and any other information about your environment?
37+
placeholder: |
38+
Examples:
39+
Output of `kubectl version --short`
40+
41+
- type: dropdown
42+
attributes:
43+
label: Would you like to work on fixing this bug?
44+
description: |
45+
**NOTE**: Let us know if you would like to submit a PR for this. We are more than happy to help you through the process.
46+
options:
47+
- "yes"
48+
- "no"
49+
- "maybe"

.github/ISSUE_TEMPLATE/config.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
blank_issues_enabled: true
3+
contact_links:
4+
- name: Feature request
5+
about: 🚀 Suggest an idea for this project
6+
url: https://github.com/stackabletech/listener-operator/discussions/new?category=ideas
7+
- name: 🙋🏾 Question
8+
about: Use this to ask a question about this project
9+
url: https://github.com/stackabletech/listener-operator/discussions/new?category=q-a
10+
- name: Other issue
11+
about: Open an issue that doesn't fit any other category
12+
url: https://github.com/stackabletech/listener-operator/issues/new

.github/ISSUE_TEMPLATE/new_version.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: New Version
3+
about: Request support for a new product version
4+
title: "[NEW VERSION]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Which new version of Stackable Listener Operator should we support?**
11+
12+
Please specify the version, version range or version numbers to support, please also add these to the issue title
13+
14+
**Additional information**
15+
16+
If possible, provide a link to release notes/changelog
17+
18+
**Changes required**
19+
20+
Are there any upstream changes that we need to support?
21+
e.g. new features, changed features, deprecated features etc.
22+
23+
24+
25+
**Implementation checklist**
26+
27+
Please don't change anything in this list.
28+
Not all of these steps are necessary for all versions.
29+
30+
- [ ] Update the Docker image
31+
- [ ] Update documentation to include supported version(s)
32+
- [ ] Update operator to support the new version (if needed)
33+
- [ ] Update integration tests to test use the new versions (in addition or replacing old versions
34+
- [ ] Update examples to use new versions

.github/pull_request_template.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
# Description
3+
4+
*Please add a description here. This will become the commit message of the merge request later.*
5+
6+
<!-- Commit message above. Everything below is not added to the message. Do not change this line! -->
7+
8+
## Review Checklist
9+
10+
- [ ] Code contains useful comments
11+
- [ ] CRD change approved (or not applicable)
12+
- [ ] (Integration-)Test cases added (or not applicable)
13+
- [ ] Documentation added (or not applicable)
14+
- [ ] Changelog updated (or not applicable)
15+
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
16+
- [ ] Helm chart can be installed and deployed operator works (or not applicable)
17+
18+
Once the review is done, comment `bors r+` (or `bors merge`) to merge. [Further information](https://bors.tech/documentation/getting-started/#reviewing-pull-requests)

0 commit comments

Comments
 (0)