I tried create simple JOB in kubernetes by this YAML
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "helper.fullname" . }}-notification-about-relese-{{ .Release.Revision }}
labels:
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
"helm.sh/hook-weight": "5"
spec:
backoffLimit: 1
ttlSecondsAfterFinished: 600
template:
metadata:
labels:
{{- if .Values.includeTimestampToPods }}
timestamp: {{ now.UnixNano | quote }}
{{- end }}
spec:
containers:
- name: make-request
image: "bash:5.2.15-alpine3.18"
command: ["echo"]
args: ["test"]
restartPolicy: OnFailure
And looks like this job complete
But if I try to look POD logs or try get access to POD exec I have this error
What it means? How I can fix it? For me this looks like Kubernetes dashboard don`t have connection to POD
In my case problem was not related to YAML file or network. It was because in our infrastructure we have new node that not fully ready to work, because my YAML not contains spec.template.spec.affinity.nodeAffinity Kubernetes run JOB POD int this (not fully ready) POD.
Force changed of node for running helped me to fix this issue