対応策 for "no matches for kind 'CronJob' in version 'batch/v1beta1'" when Registering a Kubernetes CronJob

kubernetes
2023-09-28 09:31 (1 years ago) ytyng

In Kubernetes 1.25,

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: my-awesome-product-extreme-job
  namespace: ytyng
spec:
  ...

When I applied this CronJob manifest, I encountered the following error:

resource mapping not found for name: "my-awesome-product-extreme-job" namespace: "ytyng" from "sync.cronjob.yml": no matches for kind "CronJob" in version "batch/v1beta1"
ensure CRDs are installed first

In Kubernetes 1.25, batch/v1beta1 is not supported, so you need to update it to batch/v1 to register it successfully.

apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-awesome-product-extreme-job
  namespace: ytyng
spec:
  ...
Current rating: 5

Comments

Archive

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011