Skip to content

Commit

Permalink
Add Example for GKE Autopilot
Browse files Browse the repository at this point in the history
Autopilot requires resource requests in EL deployments. Otherwise,
there's a contention between controller and GKE autopilot for changing
deployment.
  • Loading branch information
khrm authored and tekton-robot committed May 9, 2022
1 parent 2950c8b commit c629830
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions examples/v1beta1/eventlisteners/eventlistener-gke-autopilot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This example shows how to deploy EventListener to GKE Autopilot.
# It's necessary to specify resource request for EL in GKE Autopilot.
---
apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
name: listener-podtemplate
spec:
serviceAccountName: tekton-triggers-example-sa
resources:
kubernetesResource:
spec:
template:
spec:
containers:
- resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
triggers:
- name: foo-trig
bindings:
- name: message
value: Hello from the Triggers EventListener!
- name: gitrevision
value: $(body.head_commit.id)
- name: gitrepositoryurl
value: $(body.repository.url)
- name: contenttype
value: $(header.Content-Type)
template:
spec:
params:
- name: gitrevision
description: The git revision
default: main
- name: gitrepositoryurl
description: The git repository url
- name: message
description: The message to print
default: This is the default message
- name: contenttype
description: The Content-Type of the event
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: simple-pipeline-run-
spec:
pipelineRef:
name: simple-pipeline
params:
- name: message
value: $(tt.params.message)
- name: contenttype
value: $(tt.params.contenttype)
resources:
- name: git-source
resourceSpec:
type: git
params:
- name: revision
value: $(tt.params.gitrevision)
- name: url
value: $(tt.params.gitrepositoryurl)

0 comments on commit c629830

Please sign in to comment.