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

Replicaset . can not use ActiveDeadlineSeconds in pod spec #70790

Closed
cwdsuzhou opened this Issue Nov 8, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@cwdsuzhou

cwdsuzhou commented Nov 8, 2018

What happened: kubectl create apply -f test.yaml.
The ReplicaSet "replicaset-example" is invalid: spec.template.spec.activeDeadlineSeconds: Invalid value: 10: must not be specified

test.yaml is as below:

apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
  name: replicaset-example
spec:
  replicas: 3
  template:
    metadata:
      labels:
        test: aa
    spec:
      containers:
      - image: nginx
        imagePullPolicy: IfNotPresent
        name: mpi-worker-aa
        ports:
        - containerPort: 2022
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 30
          successThreshold: 1
          tcpSocket:
            port: 30000
          timeoutSeconds: 1
      restartPolicy: Always
      activeDeadlineSeconds: 10
      terminationGracePeriodSeconds: 10

What you expected to happen:
Successfully create a rs and 3 pod.

How to reproduce it (as minimally and precisely as possible):
set up a k8s cluster and use my test.yaml to set up a rs

Anything else we need to know?:
Error Info: The ReplicaSet "replicaset-example" is invalid: spec.template.spec.activeDeadlineSeconds: Invalid value: 10: must not be specified
Environment:

  • Kubernetes version (use kubectl version): 1.11.1
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): CentOs 7.1
  • Kernel (e.g. uname -a): 3.10.0-862.6.3.el7.x86_64
  • Install tools:
  • Others:

/kind bug

@cwdsuzhou

This comment has been minimized.

cwdsuzhou commented Nov 8, 2018

@kubernetes/sig-node
@lifecycle/rotten

@zhangmingld

This comment has been minimized.

Contributor

zhangmingld commented Nov 8, 2018

why using "activeDeadlineSeconds: 10" ?
it means the pod can only active for 10s
than the rs will start a new one ,and do it over and over

@krmayankk

This comment has been minimized.

Contributor

krmayankk commented Nov 9, 2018

/sig apps

@k8s-ci-robot k8s-ci-robot added sig/apps and removed needs-sig labels Nov 9, 2018

@krmayankk

This comment has been minimized.

Contributor

krmayankk commented Nov 9, 2018

#38684 See here more information. Basically it activeDeadlineSeconds is not allowed by validation , because restartPolicy: Always is set

@cwdsuzhou

This comment has been minimized.

cwdsuzhou commented Nov 9, 2018

#38684 See here more information. Basically it activeDeadlineSeconds is not allowed by validation , because restartPolicy: Always is set

/sig apps

why using "activeDeadlineSeconds: 10" ?
it means the pod can only active for 10s
than the rs will start a new one ,and do it over and over

I know. That is just an example. Actually, we use rs in CRD and in our environment, we need make the pod status failed when it keeps an abnormal status for log time. Because if use readiness probe, the pod may not ready when its status is Running, which may cause resource be occupied for log time.

@cwdsuzhou

This comment has been minimized.

cwdsuzhou commented Nov 9, 2018

#38684 See here more information. Basically it activeDeadlineSeconds is not allowed by validation , because restartPolicy: Always is set

I think it is better to add an optional flag in rs spec to enable activeDeadlineSeconds.

@liggitt

This comment has been minimized.

Member

liggitt commented Nov 11, 2018

activeDeadlineSeconds is for containers that are intended to complete. a replicaset perpetually keeps its pod's containers running, so activeDeadlineSeconds doesn't make sense for that use case.

/close

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Nov 11, 2018

@liggitt: Closing this issue.

In response to this:

activeDeadlineSeconds is for containers that are intended to complete. a replicaset perpetually keeps its pod's containers running, so activeDeadlineSeconds doesn't make sense for that use case.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment