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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nodeSelector and replicas to eventlistener #625

Merged
merged 1 commit into from Jul 10, 2020

Conversation

GwonsooLee
Copy link

@GwonsooLee GwonsooLee commented Jun 19, 2020

Changes

Add nodeSelector and replicas feature to eventListener. With this, user could schedule eventListener pod to the node with specific label. Also, if needed, user could specify the number of replicas in yaml file. Previously I scaled pod by editing after deployment ( If other possible way to scale which I might not know..., please let me know!! 馃槃 )

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

- add replicas field for event listener to be able to run more than one pod.
- add nodeSelector field for event listener to schedule event listener pod to the specific node.

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 19, 2020
@tekton-robot
Copy link

Hi @GwonsooLee. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dibyom
Copy link
Member

dibyom commented Jun 22, 2020

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 22, 2020
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 70.5% 70.8% 0.3
test/builder/eventlistener.go 83.1% 79.0% -4.1

@GwonsooLee
Copy link
Author

@dibyom Is the reason of failure related to the nodeSelector..? I added nodeSelector to test file with beta.kubernetes.io/arch": "amd64. If not then, I will figure out what's wrong more. Thanks in advance

@dibyom
Copy link
Member

dibyom commented Jun 23, 2020

@dibyom Is the reason of failure related to the nodeSelector..? I added nodeSelector to test file with beta.kubernetes.io/arch": "amd64. If not then, I will figure out what's wrong more. Thanks in advance

Doesn't look like...looks like some test has a data race

@dibyom dibyom mentioned this pull request Jun 23, 2020
@@ -57,11 +57,20 @@ type EventListenerSpec struct {
ServiceAccountName string `json:"serviceAccountName"`
Triggers []EventListenerTrigger `json:"triggers"`
ServiceType corev1.ServiceType `json:"serviceType,omitempty"`
Replicas int32 `json:"replicas"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should Replica be part of PodTemplate? Maybe in future have a ducktype like PodSpecable mentioned here:
#505 (comment)
Of course, we want to give only limited set of capability even if we do ducktype.
@dibyom

Copy link
Member

Choose a reason for hiding this comment

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

So, my understanding is that for PodTemplate or PodSpecable, the object can contain fields from a PodSpec: https://godoc.org/k8s.io/api/core/v1#PodSpec

replicas are part of the DeploymentSpec -> looking through the fields it doesn't seems like we'd want to support customizing any fields besides replicas. So, maybe we just leave replicas as part of the EL spec (maybe we can call it deploymentReplicas ?) What do you think @khrm ?

Copy link
Member

Choose a reason for hiding this comment

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

I'll add this to tomorrow's WG agenda. Unless there are objections, I feel inclined to keep the current field naming!

Copy link
Author

Choose a reason for hiding this comment

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

Thanks :) @dibyom

@GwonsooLee
Copy link
Author

/test pull-tekton-triggers-integration-tests

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 70.5% 70.8% 0.3
test/builder/eventlistener.go 83.1% 79.0% -4.1

Copy link
Contributor

@khrm khrm 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 syncing with Master would resolve that test failure. We solve that Data Race here: #631

@GwonsooLee
Copy link
Author

I think syncing with Master would resolve that test failure. We solve that Data Race here: #631

I rebase the master branch so that the error message was changed. I think there is another problem... I will try to figure it out.. Thank you so much @khrm :)

@GwonsooLee
Copy link
Author

/test pull-tekton-triggers-integration-tests

1 similar comment
@dibyom
Copy link
Member

dibyom commented Jun 26, 2020

/test pull-tekton-triggers-integration-tests

@dibyom
Copy link
Member

dibyom commented Jun 26, 2020

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 26, 2020
// Resizes cache, returning number evicted
Resize(int) int
// Resizes cache, returning number evicted
Resize(int) int
Copy link
Member

Choose a reason for hiding this comment

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

馃憖

Copy link
Author

Choose a reason for hiding this comment

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

I think this is because I ran one of the scripts in ./hack directory...

@dibyom
Copy link
Member

dibyom commented Jun 26, 2020

Thanks for adding this @GwonsooLee
Looks like the integration test failure is:

The EventListener "listener-podTemplate" is invalid: metadata.name: Invalid value: "listener-podTemplate": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

Could you add a Release Notes section to this PR description ? Very helpful when we are doing a release!
for an example, see: #591

metadata:
name: listener-podTemplate
spec:
serviceAccountName: tekton-triggers-example-sa
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding examples, can you also update the docs to mention the new fields?

Copy link
Author

Choose a reason for hiding this comment

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

I added replicas and podTemplate.nodeSelector to docs. :)

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 70.5% 70.8% 0.3
test/builder/eventlistener.go 83.1% 79.0% -4.1

@GwonsooLee
Copy link
Author

Thanks for adding this @GwonsooLee
Looks like the integration test failure is:

The EventListener "listener-podTemplate" is invalid: metadata.name: Invalid value: "listener-podTemplate": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Thanks for finding the error! I fixed it :)
Is there any other way to run integration test locally??

@GwonsooLee
Copy link
Author

Could you add a Release Notes section to this PR description ? Very helpful when we are doing a release!
for an example, see: #591

Oh.. I am sorry that I missed this one till now.. I will update this section from now on whenever I open PR. Thanks @dibyom

@dibyom
Copy link
Member

dibyom commented Jun 26, 2020

Is there any other way to run integration test locally??

In general, for go e2e tests, you can run something like go test -count=1 -v -tags=e2e ./...

In addition, we have some tests, that apply our YAML examples to make sure they are valid: https://github.com/tektoncd/triggers/blob/master/test/e2e-tests-yaml.sh

I think you should be able to run the e2e-tests-yaml.sh script locally as well too!

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2020
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

@dibyom
Copy link
Member

dibyom commented Jul 10, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2020
@tekton-robot tekton-robot merged commit 0bd7671 into tektoncd:master Jul 10, 2020
@GwonsooLee GwonsooLee deleted the nodeSelector_and_replicas branch July 10, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants