Skip to content

Commit

Permalink
Add examples for scheduling runs to a Windows node
Browse files Browse the repository at this point in the history
Some examples have been added to demonstrate how to schedule TaskRuns
and PipelineRuns on a Windows node using node selectors and node
affinity constraints.
  • Loading branch information
aiden-deloryn authored and tekton-robot committed Aug 16, 2021
1 parent f9d1f16 commit 5062ac4
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 0 deletions.
43 changes: 43 additions & 0 deletions examples/v1beta1/pipelineruns/no-ci/windows-node-affinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: windows-task-na
spec:
steps:
- name: ping-localhost
image: mcr.microsoft.com/windows/nanoserver:1809
command: ["cmd.exe"]
args:
- "/S"
- "/C"
- "echo Hello from Windows"
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: windows-pipeline-na
spec:
tasks:
- name: windows-task-na
taskRef:
name: windows-task-na
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: windows-pipeline-na-run
spec:
pipelineRef:
name: windows-pipeline-na
taskRunSpecs:
- pipelineTaskName: windows-task-na
taskPodTemplate:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
36 changes: 36 additions & 0 deletions examples/v1beta1/pipelineruns/no-ci/windows-node-selectors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: windows-task-ns
spec:
steps:
- name: ping-localhost
image: mcr.microsoft.com/windows/nanoserver:1809
command: ["cmd.exe"]
args:
- "/S"
- "/C"
- "echo Hello from Windows"
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: windows-pipeline-ns
spec:
tasks:
- name: windows-task-ns
taskRef:
name: windows-task-ns
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: windows-pipeline-ns-run
spec:
pipelineRef:
name: windows-pipeline-ns
taskRunSpecs:
- pipelineTaskName: windows-task-ns
taskPodTemplate:
nodeSelector:
kubernetes.io/os: windows
31 changes: 31 additions & 0 deletions examples/v1beta1/taskruns/no-ci/windows-node-affinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: windows-task-na
spec:
steps:
- name: ping-localhost
image: mcr.microsoft.com/windows/nanoserver:1809
command: ["cmd.exe"]
args:
- "/S"
- "/C"
- "echo Hello from Windows"
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: windows-task-na-run
spec:
taskRef:
name: windows-task-na
podTemplate:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
24 changes: 24 additions & 0 deletions examples/v1beta1/taskruns/no-ci/windows-node-selectors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: windows-task-ns
spec:
steps:
- name: ping-localhost
image: mcr.microsoft.com/windows/nanoserver:1809
command: ["cmd.exe"]
args:
- "/S"
- "/C"
- "echo Hello from Windows"
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: windows-task-ns-run
spec:
taskRef:
name: windows-task-ns
podTemplate:
nodeSelector:
kubernetes.io/os: windows

0 comments on commit 5062ac4

Please sign in to comment.