-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add production ready CRD spec #15
base: master
Are you sure you want to change the base?
Conversation
Yes, CRD can be reviewed, but, before that I'm thinking to include a detailed documentation as well so that it's easy to review. It's a 3000 line thing, might be difficult. I'll ping once done. Next step is to create a custom resource for the same and update Python handlers to setup and teardown of workers and flower deployment. I'm thinking of writing a Pod generator (something like this - https://github.com/davlum/incubator-airflow/blob/master/airflow/kubernetes/pod_generator.py#L111) |
@thedrow I had added documentation for the CRD in a structured format. You could start by reviewing it and suggest any changes if needed. I'm working on modeling spec received via handlers and generating a Kubernetes deployment programmatically. I'll push that commit in the same PR in a day or two completing this first patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the CRD.yaml file is too big. did you use it for OpenStack deployment? did you tried anything from helm 3.x?
deploy/cr.yaml
Outdated
imagePullPolicy: Never | ||
appName: celery-example | ||
celeryApp: 'app:celery_app' | ||
celeryVersion: "4.X" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use celery '5.x' now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm most familiar with Celery 4.X in production for now so went ahead with that. I'll be creating just three K8s resources - worker deployment, flower deployment, and flower svc which were a bit simple to start with.
Yes, Celery 5 needs to be supported and I need to understand all the moving parts of that. Can you direct me to some resource/project I can look into to see how people are writing Celery 5 applications and deploying them on K8s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Yes. It includes support for lots of standard Kubernetes resources/objects specification like volumes, volumeMounts, envs, init containers etc. that are commonly used while deploying any application. I wrote brief documentation to outline the major parts and I think that should be a good starting point for review. For reference, I reviewed the CRDs of other popular operators to write ours -
The deployment stage will come later, I've access to a production EKS cluster from my work where I'll test this operator once ready. Could use OpenStack too. Helm we'll use later to package CRDs and other resources to deploy the operator. We'd still need this CRD spec. I'm yet to work on the packaging and releasing part, Helm will be useful there if I'm correct. I'm currently writing the handlers to deal with the resource created using this CRD. I'm using Kind for simulating local K8s cluster. I should have that commit ready by tomorrow. |
be78c13
to
c03b699
Compare
This pull request introduces 3 alerts and fixes 2 when merging c03b699 into 3163d6c - view on LGTM.com new alerts:
fixed alerts:
|
c03b699
to
dd8f6e5
Compare
Thanks, Sorry for the slow progress from my side as well. I try to commit every Friday to this project. Might have to pause for a bit because of the extreme covid surge in my country(India) to take care of other commitments. I'll try to cover things up next month. |
This PR adds a production-ready custom resource definition for the celery cluster. On a high-level, it adds support for the following parameters -
image
- Container image name to run in the worker and flower deploymentsimagePullPolicy
- Image pull policy. One of Always, Never, IfNotPresentimagePullSecrets
- ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images usedappName
- Application name for worker and flower deployments, will be suffixed accordinglyceleryApp
- Celery app instance to use (e.g. module.celery_app_attr_name)celeryVersion
workerReplicas
- Number of worker pods to be runflowerReplicas
- Number of flower pods to be runworkerSpec
- Worker deployment-specific parameters (worker args, envs, nodeSelector and resources spec)flowerSpec
- Flower deployment specific parameters (flower args, envs, nodeSelector, resources and flower service spec)initContainers
- List of initialization containers belonging to the worker and flower podsvolumeMounts
- Define some extra Kubernetes Volume mounts for Celery cluster podsvolumes
- Define some extra Kubernetes Volumes for Celery cluster podslivenessProbe
- Periodic probe of container livenessreadinessProbe
- Periodic probe of container readinessIn the future, we plan to include broker config, update strategy, and autoscaling config support to this CRD as well.