Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initContainers[1].lifecycle: Forbidden: may not be set for init containers without restartPolicy=Always", Reason:"Invalid", Details:(*v1.StatusDetails)(0xc000cb2d80), Code:422} #3794

Open
geek1250 opened this issue Oct 25, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@geek1250
Copy link

Description

Using Volcano V1.10.0 on Kubenetes V1.30.5, after adding sidecar in a container in InitContainers, I met the following error:
E1015 16:14:16.078922 1 job_controller_actions.go:407] Failed to create pod ip-model-1000000046-spec0-0 for Job ip-model-1000000046, err &errors.StatusError{ErrStatus:v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Status:"Failure", Message:"Pod "ip-model-1000000046-spec0-0" is invalid: spec.initContainers[1].lifecycle: Forbidden: may not be set for init containers without restartPolicy=Always", Reason:"Invalid", Details:(*v1.StatusDetails)(0xc000cb2d80), Code:422}}

Let's call the the second container( initContainers[1) in task[0].Template.Spec.InitContainers as C2.
I do set restartPolicy=Always in C2.

I call job's create functio in volcano.sh/[email protected]/pkg/client/clientset/versioned/typed/batch/v1alpha1/job.go in order to create a job.
Before err = c.client.Post().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
Do(ctx).
Into(result),
I print the C2's RestartPolicy and it shows Always.

Backgroud:

  1. I installed Volcano V1.7 previously, and changed images of volcano-controllers and volcano-scheduler with Volcano V1.10.0's official images.
  2. The sidecar feature of k8s works fine as I can create a job with sidecar feature when writing a yaml file without using Volcano.

Steps to reproduce the issue

Describe the results you received and expected

I met the following error:
E1015 16:14:16.078922 1 job_controller_actions.go:407] Failed to create pod ip-model-1000000046-spec0-0 for Job ip-model-1000000046, err &errors.StatusError{ErrStatus:v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Status:"Failure", Message:"Pod "ip-model-1000000046-spec0-0" is invalid: spec.initContainers[1].lifecycle: Forbidden: may not be set for init containers without restartPolicy=Always", Reason:"Invalid", Details:(*v1.StatusDetails)(0xc000cb2d80), Code:422}}

What I expected:
I can create job successfully with the the sidecar feature when setting lifecycle and restartPolicy=Always in C2.

What version of Volcano are you using?

1.10.0

Any other relevant information

kubectl version

Client Version: v1.30.5
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.5

cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

uname -a

Linux m12345 5.15.0-97-generic #107-Ubuntu SMP Wed Feb 7 13:26:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

@geek1250 geek1250 added the kind/bug Categorizes issue or PR as related to a bug. label Oct 25, 2024
@Monokaix
Copy link
Member

Monokaix commented Oct 25, 2024

Hi, please use helm upgrade to upgrade volcano version, deatils https://github.com/volcano-sh/helm-charts: )

@Monokaix
Copy link
Member

has your problem beed solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants