I have two applications running in K8s, 1 application run as deployment, the other application run as cronjob. Suppose that this application will trigger the cronjob run in some situation. However, it works before but now it fails. I suspect may because the K8s admin has some permission / role restriction apply.
try {
v2alpha1CronJob = batchV2alpha1Api.readNamespacedCronJob('A-CRONJOB-NAME', 'A-NAMESPACE', null, null, null);
} catch (Exception e) {
// Here I get error, it promot me error as following
}
Error is:
Error trying to manipulate k8s CronJob {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}
Would I know what I should do now? My k8s server version is 1.21.5