kubernetes cronjob error: Saw a job that the controller did not create or forgot

Task:-> Restarting pod automatically at specific time.

cronjob not working fine after manually triger, getting error- like Saw a job that the controller did not create or forgot: vijay-deployment-restart-manual-a7s16 enter image description here enter image description hereenter image description here

once manually triger cronjob , job will start for restarting pod but getting this errors — Job has reached the specified backoff limitenter image description here enter image description here

current version :-
based on this version Client Version: v1.29.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.4-eks-036c24b

how to fix this.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>
kind: ServiceAccount
apiVersion: v1
metadata:
name: vijay-deployment-restart
namespace: odex
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: Vijay-deployment-restart
namespace: odex`your text`
rules:
- apiGroups: ["apps", "extensions"]
resources: ["deployments"]
resourceNames: ["odex-webapp-c88ae204"]
verbs: ["get", "patch", "list", "watch"] # "list" and "watch" are only needed
# if you want to use `rollout status`
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: Vijay-deployment-restart
namespace: odex
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: vijay-deployment-restart
subjects:
- kind: ServiceAccount
name: vijay-deployment-restart
namespace: odex
</code>
<code> kind: ServiceAccount apiVersion: v1 metadata: name: vijay-deployment-restart namespace: odex apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: Vijay-deployment-restart namespace: odex`your text` rules: - apiGroups: ["apps", "extensions"] resources: ["deployments"] resourceNames: ["odex-webapp-c88ae204"] verbs: ["get", "patch", "list", "watch"] # "list" and "watch" are only needed # if you want to use `rollout status` apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: Vijay-deployment-restart namespace: odex roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: vijay-deployment-restart subjects: - kind: ServiceAccount name: vijay-deployment-restart namespace: odex </code>

kind: ServiceAccount
apiVersion: v1
metadata:
  name: vijay-deployment-restart
  namespace: odex



apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: Vijay-deployment-restart
  namespace: odex`your text`
rules:
  - apiGroups: ["apps", "extensions"]
    resources: ["deployments"]
    resourceNames: ["odex-webapp-c88ae204"]
    verbs: ["get", "patch", "list", "watch"] # "list" and "watch" are only needed
                                             # if you want to use `rollout status`


apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: Vijay-deployment-restart
  namespace: odex
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: vijay-deployment-restart
subjects:
  - kind: ServiceAccount
    name: vijay-deployment-restart
    namespace: odex

cronjob

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>apiVersion: batch/v1
kind: CronJob
metadata:
name: vijay-deployment-restart
namespace: od
spec:
concurrencyPolicy: Forbid
schedule: '48 10 * * *' # This will run daily at
jobTemplate:
spec:
backoffLimit: 3
activeDeadlineSeconds: 800
template:
spec:
serviceAccountName: vijay-deployment-restart
restartPolicy: Never
containers:
- name: kubectl
image: bitnami/kubectl:latest # Specify the version if needed
command:
- 'kubectl'
- 'rollout'
- 'restart'
- 'deployment/mango-deployment'
</code>
<code>apiVersion: batch/v1 kind: CronJob metadata: name: vijay-deployment-restart namespace: od spec: concurrencyPolicy: Forbid schedule: '48 10 * * *' # This will run daily at jobTemplate: spec: backoffLimit: 3 activeDeadlineSeconds: 800 template: spec: serviceAccountName: vijay-deployment-restart restartPolicy: Never containers: - name: kubectl image: bitnami/kubectl:latest # Specify the version if needed command: - 'kubectl' - 'rollout' - 'restart' - 'deployment/mango-deployment' </code>
apiVersion: batch/v1
kind: CronJob
metadata:
name: vijay-deployment-restart
namespace: od
spec:
concurrencyPolicy: Forbid
schedule: '48 10 * * *' # This will run daily at
jobTemplate:
spec:
backoffLimit: 3
activeDeadlineSeconds: 800
template:
spec:
serviceAccountName: vijay-deployment-restart
restartPolicy: Never
containers:
- name: kubectl
image: bitnami/kubectl:latest # Specify the version if needed
command:
- 'kubectl'
- 'rollout'
- 'restart'
- 'deployment/mango-deployment'

22m Normal Scheduled pod/vijay-deployment-restart-manual-a7s16-6kfm4 Successfully assigned odex/vijay-deployment-restart-manual-a7s16-6kfm4 to ip-
10-1-255-31.ap-south-1.compute.internal
22m Normal Pulling pod/vijay-deployment-restart-manual-a7s16-6kfm4 Pulling image “bitnami/kubectl:latest”
22m Normal Pulled pod/vijay-deployment-restart-manual-a7s16-6kfm4 Successfully pulled image “bitnami/kubectl:latest” in 1.481434024s (1.4814430
65s including waiting)
22m Normal Created pod/vijay-deployment-restart-manual-a7s16-6kfm4 Created container kubectl
22m Normal Started pod/vijay-deployment-restart-manual-a7s16-6kfm4 Started container kubectl
25m Normal Scheduled pod/vijay-deployment-restart-manual-a7s16-7b78g Successfully assigned odex/vijay-deployment-restart-manual-a7s16-7b78g to ip-
10-1-255-31.ap-south-1.compute.internal
25m Normal Pulling pod/vijay-deployment-restart-manual-a7s16-7b78g Pulling image “bitnami/kubectl:latest”
25m Normal Pulled pod/vijay-deployment-restart-manual-a7s16-7b78g Successfully pulled image “bitnami/kubectl:latest” in 1.506635384s (1.5066520
44s including waiting)
25m Normal Created pod/vijay-deployment-restart-manual-a7s16-7b78g Created container kubectl
25m Normal Started pod/vijay-deployment-restart-manual-a7s16-7b78g Started container kubectl
26m Normal Scheduled pod/vijay-deployment-restart-manual-a7s16-cnctx Successfully assigned odex/vijay-deployment-restart-manual-a7s16-cnctx to ip-
10-1-255-31.ap-south-1.compute.internal
26m Normal Pulling pod/vijay-deployment-restart-manual-a7s16-cnctx Pulling image “bitnami/kubectl:latest”
26m Normal Pulled pod/vijay-deployment-restart-manual-a7s16-cnctx Successfully pulled image “bitnami/kubectl:latest” in 1.436445321s (1.4364548
92s including waiting)
26m Normal Created pod/vijay-deployment-restart-manual-a7s16-cnctx Created container kubectl
26m Normal Started pod/vijay-deployment-restart-manual-a7s16-cnctx Started container kubectl
27m Normal Scheduled pod/vijay-deployment-restart-manual-a7s16-m98hb Successfully assigned odex/vijay-deployment-restart-manual-a7s16-m98hb to ip-
10-1-255-31.ap-south-1.compute.internal
27m Normal Pulling pod/vijay-deployment-restart-manual-a7s16-m98hb Pulling image “bitnami/kubectl:latest”
27m Normal Pulled pod/vijay-deployment-restart-manual-a7s16-m98hb Successfully pulled image “bitnami/kubectl:latest” in 1.49095318s (1.49096263
s including waiting)
27m Normal Created pod/vijay-deployment-restart-manual-a7s16-m98hb Created container kubectl
27m Normal Started pod/vijay-deployment-restart-manual-a7s16-m98hb Started container kubectl
27m Normal Scheduled pod/vijay-deployment-restart-manual-a7s16-twx82 Successfully assigned odex/vijay-deployment-restart-manual-a7s16-twx82 to ip-
10-1-255-31.ap-south-1.compute.internal
27m Normal Pulling pod/vijay-deployment-restart-manual-a7s16-twx82 Pulling image “bitnami/kubectl:latest”
27m Normal Pulled pod/vijay-deployment-restart-manual-a7s16-twx82 Successfully pulled image “bitnami/kubectl:latest” in 1.446334384s (1.4463481
54s including waiting)
27m Normal Created pod/vijay-deployment-restart-manual-a7s16-twx82 Created container kubectl
27m Normal Started pod/vijay-deployment-restart-manual-a7s16-twx82 Started container kubectl
27m Normal Scheduled pod/vijay-deployment-restart-manual-a7s16-zr894 Successfully assigned odex/vijay-deployment-restart-manual-a7s16-zr894 to ip-
10-1-255-31.ap-south-1.compute.internal
27m Normal Pulling pod/vijay-deployment-restart-manual-a7s16-zr894 Pulling image “bitnami/kubectl:latest”
27m Normal Pulled pod/vijay-deployment-restart-manual-a7s16-zr894 Successfully pulled image “bitnami/kubectl:latest” in 1.547233824s (1.5472634
65s including waiting)
27m Normal Created pod/vijay-deployment-restart-manual-a7s16-zr894 Created container kubectl
27m Normal Started pod/vijay-deployment-restart-manual-a7s16-zr894 Started container kubectl
27m Normal SuccessfulCreate job/vijay-deployment-restart-manual-a7s16 Created pod: vijay-deployment-restart-manual-a7s16-zr894
27m Normal SuccessfulCreate job/vijay-deployment-restart-manual-a7s16 Created pod: vijay-deployment-restart-manual-a7s16-twx82
27m Normal SuccessfulCreate job/vijay-deployment-restart-manual-a7s16 Created pod: vijay-deployment-restart-manual-a7s16-m98hb
26m Normal SuccessfulCreate job/vijay-deployment-restart-manual-a7s16 Created pod: vijay-deployment-restart-manual-a7s16-cnctx
25m Normal SuccessfulCreate job/vijay-deployment-restart-manual-a7s16 Created pod: vijay-deployment-restart-manual-a7s16-7b78g
22m Normal SuccessfulCreate job/vijay-deployment-restart-manual-a7s16 Created pod: vijay-deployment-restart-manual-a7s16-6kfm4
22m Warning BackoffLimitExceeded job/vijay-deployment-restart-manual-a7s16 Job has reached the specified backoff limit
22m Warning UnexpectedJob cronjob/vijay-deployment-restart Saw a job that the controller did not create or forgot: vijay-deployment-rest
art-manual-a7s16
PS C:UsersVijay.kumark8 yaml file>

how to fix this issue.

New contributor

Vijaykumar Jawale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật