Skip to content
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

feat: First draft of a scheduler #19

Merged
merged 4 commits into from
Sep 16, 2022
Merged

feat: First draft of a scheduler #19

merged 4 commits into from
Sep 16, 2022

Conversation

RealAnna
Copy link
Contributor

@RealAnna RealAnna commented Sep 13, 2022

Resolves: #5

edit make file and scheduler image with your own registry

make push-release-images
cd to manifest/install/charts
kubectl create -n keptn-scheduler

to run in parallel to the default scheduler
helm upgrade --install keptn-scheduler keptn-scheduler/

wait for it to be up
deploy something on the scheduler

eg.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: keptnlc
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
     schedulerName: keptn-scheduler
     containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80


image

image

test deployment available on keptn-dev cluster

@RealAnna RealAnna marked this pull request as draft September 13, 2022 19:54
Signed-off-by: RealAnna <[email protected]>
Signed-off-by: RealAnna <[email protected]>

scheduler fix

Signed-off-by: RealAnna <[email protected]>

changed make file

Signed-off-by: RealAnna <[email protected]>

changed make file

Signed-off-by: RealAnna <[email protected]>

changed make file

Signed-off-by: RealAnna <[email protected]>

changed make file

Signed-off-by: RealAnna <[email protected]>

mit

Signed-off-by: RealAnna <[email protected]>

mit

Signed-off-by: RealAnna <[email protected]>

mit

Signed-off-by: RealAnna <[email protected]>

mit

Signed-off-by: RealAnna <[email protected]>

sched fin

Signed-off-by: RealAnna <[email protected]>

sched fin

Signed-off-by: RealAnna <[email protected]>

sched fin

Signed-off-by: RealAnna <[email protected]>
@RealAnna RealAnna marked this pull request as ready for review September 14, 2022 12:57
Copy link
Contributor

@thschue thschue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the as-a-second-scheduler part and make this the standard as currently the keptn scheduler won't replace another one ... Furthermore I'm not sure how many things of the boilerplate are really needed (/hack). The rest looks good like a good start 🚀

# RELEASE_REGISTRY is the container registry to push
# into. The default is to push to the staging
# registry, not production(k8s.gcr.io).
RELEASE_REGISTRY?=docker.io/annadreal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be keptnsandbox?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have one or should we make it? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented it out for now, we will make one soon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think keptnsandbox already exists ...


rand.Seed(time.Now().UnixNano())
command := app.NewSchedulerCommand(
app.WithPlugin(klcpermit.Name, klcpermit.New),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would make sense to hook in an earlier stage? (https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my mind pre-deployment checks could take a while and it would not make sense to not discover in the meantime that there are other reasons for the pod not to be scheduled e.g. filters make it impossible to find a compatible node. We discussed having prechecks and scheduling steps in parallel up to resource allocation, but maybe also pre-Score could be an option, just I could not think of a reason why we would like to interfere with the node choice. What do you think could be another approach?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, think it makes sense to leave this in the permit-phase at the moment :-)

lfc-scheduler/hack/boilerplate/boilerplate.generatego.txt Outdated Show resolved Hide resolved
lfc-scheduler/manifests/permit/scheduler-config.yaml Outdated Show resolved Hide resolved
@RealAnna RealAnna requested a review from thschue September 16, 2022 05:54
Copy link
Contributor

@thschue thschue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should adapt the Helm-Chart readme, then we are good to go 👍

Signed-off-by: RealAnna <[email protected]>
@RealAnna RealAnna requested a review from thschue September 16, 2022 08:52
Copy link
Contributor

@thschue thschue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bootstrap Keptn Scheduler
2 participants