FreeThreads
Published in

FreeThreads

Fix Kubernetes Cron Job invalid: spec.template field is immutable

The Kubernetes job on apply fails.

kubectl apply -f /home/my.job.yaml

Error

The Job "xyz" is invalid: spec.template: Invalid value: core.PodTemplateSpec{ObjectMeta:v1.ObjectMeta{:} field is immutable

Solution

The job once applied, can’t be re-applied.

We should delete the job as follows and apply again.

kubectl delete -f /home/my.job.yaml

--

--

--

Discuss design, distributed systems, developer tools, programming languages

Recommended from Medium

Golang Logging Deep Data Structure with go-spew

FRONT-END Development VS BACK-END Development

Front-end vs Back-end

Join iAmAffiliate — The #1 Source for Affiliate Marketing Advice That Works In 2020 ➡️ http://bit.ly

PostgreSQL: Most useful commands for Full Stack developers (5–6)

SQL Fundamentals: Why Common Table Expressions Are So Powerful

Language Evaluation Criteria — Readability

Running Airflow on Heroku

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simplify Complexity

Simplify Complexity

Golang, Distributed Systems, File Systems, Python, C/C++, Linux

More from Medium

Newsletter of Carlos Santana — Issue #28

3.14 Tips for using the Kubernetes Cluster Autoscaler on Oracle Cloud

Deploy and use ArgoCD with Portainer (part 2)

Version Control of Configuration Files Using Kubernetes