Skip to content

Commit

Permalink
add eventlistener-tolerations example file, remove commented lines fo…
Browse files Browse the repository at this point in the history
…r test, and modify docs
  • Loading branch information
Gwonsoo Lee committed Jun 12, 2020
1 parent 6dab6ec commit 64771af
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 79 deletions.
20 changes: 20 additions & 0 deletions docs/eventlisteners.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ using [Event Interceptors](#Interceptors).

- [Syntax](#syntax)
- [ServiceAccountName](#serviceAccountName)
- [PodTemplate](#podTemplate)
- [Triggers](#triggers)
- [Interceptors](#interceptors)
- [Logging](#logging)
Expand Down Expand Up @@ -104,6 +105,8 @@ the following fields:
- Optional:
- [`serviceType`](#serviceType) - Specifies what type of service the sink pod
is exposed as
- [`podTemplate`](#podTemplate) - Specifies the PodTemplate
for your EventListener pod

[kubernetes-overview]:
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields
Expand Down Expand Up @@ -207,6 +210,23 @@ documentations for details.
For external services to connect to your cluster (e.g. GitHub sending webhooks),
check out the guide on [exposing EventListeners](./exposing-eventlisteners.md).

## PodTemplate

The `podTemplate` field is optional. A PodTemplate is specifications for
creating EventListener pod. A PodTemplate consists of:
- `tolerations` - list of toleration which allows pods to schedule onto the nodes with matching taints.
This is needed only if you want to schedule EventListener pod to a tainted node.

```yaml
spec:
podTemplate:
tolerations:
- key: key
value: value
operator: Equal
effect: NoSchedule
```

### Logging

EventListener sinks are exposed as Kubernetes services that are backed by a Pod
Expand Down
20 changes: 20 additions & 0 deletions examples/eventlisteners/eventlistener-tolerations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
metadata:
name: listener-tolerations
spec:
serviceAccountName: tekton-triggers-example-sa
podTemplate:
tolerations:
- key: key
value: value
operator: Equal
effect: NoSchedule
triggers:
- name: foo-trig
bindings:
- ref: pipeline-binding
- ref: message-binding
template:
name: pipeline-template
6 changes: 0 additions & 6 deletions examples/eventlisteners/eventlistener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ metadata:
name: listener
spec:
serviceAccountName: tekton-triggers-example-sa
# podTemplate:
# tolerations:
# - key: key
# value: value
# operator: Equal
# effect: NoSchedule
triggers:
- name: foo-trig
bindings:
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require (
github.com/google/go-github/v31 v31.0.0
github.com/gorilla/mux v1.7.3
github.com/grpc-ecosystem/grpc-gateway v1.13.0 // indirect
github.com/onsi/ginkgo v1.10.2 // indirect
github.com/openzipkin/zipkin-go v0.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand Down
50 changes: 0 additions & 50 deletions go.sum

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions test/eventlistener_scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ func TestEventListenerScale(t *testing.T) {
bldr.EventListenerServiceAccount(saName),
bldr.EventListenerPodTemplate(
bldr.EventListenerPodTemplateSpec(
bldr.EventListenerPodTemplateTolerations(nil),
// If you want to test toleration feature, please use this commented part.
//bldr.EventListenerPodTemplateTolerations([]corev1.Toleration{
// {
// Key: "key",
// Operator: "Equal",
// Value: "value",
// Effect: "NoSchedule",
// },
//}),
bldr.EventListenerPodTemplateTolerations([]corev1.Toleration{
{
Key: "key",
Operator: "Equal",
Value: "value",
Effect: "NoSchedule",
},
}),
),
),
))
Expand Down
18 changes: 8 additions & 10 deletions test/eventlistener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,14 @@ func TestEventListenerCreate(t *testing.T) {
bldr.EventListenerServiceAccount(sa.Name),
bldr.EventListenerPodTemplate(
bldr.EventListenerPodTemplateSpec(
bldr.EventListenerPodTemplateTolerations(nil),
// If you want to test toleration feature, please use this commented part.
//bldr.EventListenerPodTemplateTolerations([]corev1.Toleration{
// {
// Key: "key",
// Operator: "Equal",
// Value: "value",
// Effect: "NoSchedule",
// },
//}),
bldr.EventListenerPodTemplateTolerations([]corev1.Toleration{
{
Key: "key",
Operator: "Equal",
Value: "value",
Effect: "NoSchedule",
},
}),
),
),
bldr.EventListenerTrigger(tt.Name, "",
Expand Down
2 changes: 0 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ github.com/matttproud/golang_protobuf_extensions/pbutil
github.com/modern-go/concurrent
# github.com/modern-go/reflect2 v1.0.1
github.com/modern-go/reflect2
# github.com/onsi/ginkgo v1.10.2
## explicit
# github.com/openzipkin/zipkin-go v0.2.2
## explicit
github.com/openzipkin/zipkin-go/model
Expand Down

0 comments on commit 64771af

Please sign in to comment.