v6d
v6d copied to clipboard
Add a general field to the Vineyardd CRD for supporting the most APIs of Kubernetes Deployment
Describe your problem
At present, we have the Vineyardd CRD to deploy a Kubernetes Deployment, but it only contains the parts of Kubernetes Deployment APIs refer to vineyardd template file, it's better to add a field to the Vineyardd CRD which allows users to input their custom APIs rather than the fields of CRD.
Some examples:
apiVersion: k8s.v6d.io/v1alpha1
kind: Vineyardd
metadata:
name: vineyardd-sample
spec:
replicas: 3
vineyard:
image: vineyardcloudnative/vineyardd:latest
imagePullPolicy: IfNotPresent
# the patchFields are only patched into the vineyard deployment
patchFields:
spec:
template:
spec:
tolerations:
- effect: NoSchedule
key: disktype
value: ssd
Additional context
- Users want to add taints and tolerations to the Vineyard Deployment. #1355
- You could get some inspiration from the kubectl patch
I don't quite understand, do you want to say add a field, if the field is filled then execute the filled API, otherwise follow the original logic?
I'm sorry the extraFields maybe confuse you, it actually acts like patchFields. If the field is filled and then it will be patched into the original logic. As the general patch strategy:
- if some fields defined in the
patchFieldsexist in the original Deployment API, thenUpdate. - if some fields do not exist, then
Merge.
On the current CRD definition, an additional field called patchFields is added to listen to the registered payload, and then the patchFields field is typed on the created yaml, which is then handed over to Apiserver for execution. It sounds like a webhook.
Yeah, using webhook can also work, but we don't want to add a new one. Actually, we want to do the Patch during Rendering the Vineyardd CRD as the deployment. As you said, we just put some logic like a webhook in the Vineyardd controller.
I think I can try to fix it, but still need to look at the project and get a clear understanding of the requirements and changes.
No problem, assigned to you. If you have any question, feel free to contact us.
Thanks,Is there a community or other place for communication?
@jingchu000, we have a slack channel refer to doc. Also, we have a DingDing group for communication. You could choose the like one.
ok,I want to join Dingding
Can you invite me?
Ok, would you mind telling me your Dingding number here or via email [email protected].
/cc @jingchu000, this issus/pr has had no activity for for a long time, could you folks help to review the status ? If the issue/pr is waiting for further response from the reporter/author, please help to add the label requires-further-info to suppress further notification.