[Feature] Add BanyanDB CRD & Controllers#70
Conversation
|
I can't see an e2e to verify this. |
|
@wu-sheng @lujiajing1126 This is a draft pr for the osapp project. The student @SzyWilliam should still be coding, but I'm not familiar with some features of Banyandb, so could you please confirm whether the Spec field can meet all the current banyandb requirements? |
|
Then this PR should be labeled aa draft or use issue or discussion panel to talk. |
|
BTW, I think you ping a wrong people. |
|
|
||
| // BanyanDB Storage | ||
| // +kubebuilder:validation:Optional | ||
| Storage corev1.PersistentVolumeClaim `json:"storage,omitempty"` |
There was a problem hiding this comment.
It should be an array. BanyanDB support placing files into separate storage.
| State BanyanDBState `json:"state,omitempty"` | ||
| // Represents the latest available observations of the underlying statefulset's current state. | ||
| // +kubebuilder:validation:Optional | ||
| Conditions []appsv1.StatefulSetCondition `json:"conditions,omitempty"` |
There was a problem hiding this comment.
Deployment is good to me.
|
|
||
| const ( | ||
| Ready BanyanDBState = iota | ||
| Reconciling |
There was a problem hiding this comment.
Could you elaborate on Reconciling? Add more comments to all states.
There was a problem hiding this comment.
I've deleted this field.
| Storage corev1.PersistentVolumeClaim `json:"storage,omitempty"` | ||
| } | ||
|
|
||
| type BanyanDBState int8 |
There was a problem hiding this comment.
string is much better for readability and inspection
There was a problem hiding this comment.
I've deleted this BanyanDBState
|
|
||
| // BanyanDB Storage | ||
| // +kubebuilder:validation:Optional | ||
| Storage corev1.PersistentVolumeClaim `json:"storage,omitempty"` |
There was a problem hiding this comment.
We only need *corev1.PersistentVolumeClaimSpec here?
There was a problem hiding this comment.
Have to support multi-storages, the type could be []corev1.PersistentVolumeClaim
As I understand, since the current version of BanyanDB only has a single node, Deployment can meet our requirement. The operator for |
|
Actually, I'm neutral about the choice. I would just say |
|
|
ee6444c to
28852fa
Compare
808b080 to
9c83573
Compare
329d794 to
4b324c1
Compare
|
@dashanji @hanahmily @lujiajing1126 Hi, I've completed a minimal working BanyanDB CRD&Controller for SWCK. It passes e2e tests. Please take a look at this, thanks! |
|
@dashanji Thanks for your reviews! I've completed the full banyandb crd & controller implementation with corresponding e2e tests. @wu-sheng @hanahmily @lujiajing1126 Please take a look at it~🫰 |
hanahmily
left a comment
There was a problem hiding this comment.
You have to expose the HTTP port and add a new HTTP-based service.
The HTTP service should support the ingress to route traffic to it.
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| kind: ClusterRole |
There was a problem hiding this comment.
Why do we need this role since the server doesn't touch the API server?
There was a problem hiding this comment.
Done. I have removed ClusterRole & ClusterRoleBinding
|
@hanahmily Thanks for the reviews! I've exposed HTTP port and added an ingress resource to route HTTP requests, PTAL. I have a question: according to banyandb github page, we do not support http server for now. Does banyandb support HTTP server now? If so, how I can query data using HTTP? |
We supported the HTTP server in the main branch. It will be released in v0.2.0.
bydbctl will take it. The primitive commands will be released in v0.2.0 with the HTTP server. And you could access the HTTP endpoint directly. The API specifications are at https://github.com/apache/skywalking-banyandb/blob/main/api/proto/openapi |
hanahmily
left a comment
There was a problem hiding this comment.
Please add a new service to serve HTTP/17913
operator/pkg/operator/manifests/banyandb/templates/service.yaml
Outdated
Show resolved
Hide resolved
operator/pkg/operator/manifests/banyandb/templates/ingress.yaml
Outdated
Show resolved
Hide resolved
|
@hanahmily Thanks for the reply and providing framework on Service. I'll use separate gRPC Service and HTTP service. I plan to use bydbctl to verify banyandb data storage in E2E Tests after 0.2.0 release, so I'll just add a todo for now. |
|
I've made changes on code:
|
hanahmily
left a comment
There was a problem hiding this comment.
LGTM @SzyWilliam @dashanji Great job!
|
It is great to see this PR is getting ready after months of work. Congrats. |
|
@lujiajing1126 We need your confirmation here. Please recheck. |
| overlay.AvailableReplicas = deployment.Status.AvailableReplicas | ||
| } | ||
| if apiequal.Semantic.DeepDerivative(overlay, banyanDB.Status) { | ||
| log.Info("Status keeps the same as before") |
There was a problem hiding this comment.
I think we have to return here to avoid unexpected reconciliation? @dashanji
There was a problem hiding this comment.
Make sense. We could return here to avoid update the same resources. Thanks for the catching, and the other controllers have the same questions. Could you please update them together ? @SzyWilliam
|
@lujiajing1126 Thanks for the careful review! I've made changes on code, please take a look again. |
lujiajing1126
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your contribution!
Original Issue
apache/skywalking#9396
What changes brought in this PR
In this PR, I add CRD for BanyanDB.