I use a POD yaml file to create a pod in Kubernetes.
My yaml file is simple and looks like this:
kind: Pod
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
imagePullPolicy: Always
command:
- /busybox/cat
tty: true
but I got this Error message:
nodes are available: 33 node(s) didn't match node selector.
I run this pod file in Jenkins pipeline, so that a Kaniko can be installed to build a docker image.
any solutions?
You are missing several required keys in your YAML file.
apiVersion
key - api version for Pod is currentlyv1
metadata
key - Data that helps uniquely identify the object, including aname
string,UID
, and optionalnamespace
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:
Addressing the problem: You can assign which pod should run on which node with use of the
nodeSelector
key. You need to specify it underspec
. For example:You can find your node labels with
or add a label to it with
You can find more on this in the docs.