You are missing several required keys in your YAML file.
apiVersion
key - api version for Pod is currently v1
metadata
key - Data that helps uniquely identify the object, including a name
string, UID
, and optional namespace
You can read more on creating static pods in Kubernetes docs, and if you want some examples for kaniko pod, they are available here.
So, minimal correct pod YAML should looke like this:
kind: Pod
apiVersion: v1
metadata:
# specify your pod name
name: <pod-name>
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
imagePullPolicy: Always
command:
- /busybox/cat
tty: true
Addressing the problem:
You can assign which pod should run on which node with use of the nodeSelector
key. You need to specify it under spec
. For example:
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
imagePullPolicy: Always
command:
- /busybox/cat
tty: true
#here it is
nodeSelector:
# and here is node label
<label-name>: <label-value>
You can find your node labels with
kubectl describe node <node-name>
or add a label to it with
kubectl label node <node-name> <label-name>=<label-value>
You can find more on this in the docs.