Closed rshiva777 closed 7 months ago
I tried to add the annotation on the template section as below, even then no luck
apiVersion: batch/v1
kind: CronJob
metadata:
labels:
app: elasticsearch-curator
chart: elasticsearch-curator-5.8.5-gks.1
heritage: Helm
release: elasticsearch-curator
name: elasticsearch-curator
namespace: efk-system-logging
spec:
jobTemplate:
metadata:
creationTimestamp: null
labels:
app: elasticsearch-curator
release: elasticsearch-curator
annotations:
testanno: test
spec:
template:
metadata:
creationTimestamp: null
labels:
app: elasticsearch-curator
release: elasticsearch-curator
annotations:
testanno: test
spec:
containers:
- args:
- --config
- /etc/es-curator/config.yml
- /etc/es-curator/action_file.yml
command:
- /usr/local/bin/curator
image: curator:5.8.5
imagePullPolicy: IfNotPresent
name: elasticsearch-curator
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/es-curator
name: config-volume
- mountPath: /etc/certs
name: es-certs
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
securityContext:
runAsUser: 16
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
name: elasticsearch-curator-config
name: config-volume
- name: es-certs
secret:
defaultMode: 420
secretName: elasticsearch-master-certs
schedule: '*/5 * * * *'
successfulJobsHistoryLimit: 3
suspend: false
getting the below error
Error from server (InternalError): error when creating "cj4": Internal error occurred: add operation does not apply: doc is missing path: "/spec/jobtemplate/spec/template/metadata/annotations": missing value
Those errors are not from Curator. Those error messages are ostensibly from Kubernetes. I can't help with that.
For usage questions and help
Please create a topic at https://discuss.elastic.co/c/elasticsearch
Perhaps a topic there already has an answer for you!
To submit a bug or report an issue
curator cronjob is not applied to cluster
Expected Behavior
curator cronjob should be deployed into cluster without any issues
Actual Behavior
curator cronjob should be applied to cluster
Steps to Reproduce the Problem
1. 1.
Specifications
Context (Environment)
Indices are not getting deleted as curator job is not deployed to clear the old indices
Detailed Description
Curator yaml:
apiVersion: batch/v1 kind: CronJob metadata: labels: app: elasticsearch-curator chart: elasticsearch-curator-5.8.5-gks.1 heritage: Helm release: elasticsearch-curator name: elasticsearch-curator namespace: efk-system-logging spec: jobTemplate: metadata: creationTimestamp: null labels: app: elasticsearch-curator release: elasticsearch-curator spec: template: metadata: creationTimestamp: null labels: app: elasticsearch-curator release: elasticsearch-curator spec: containers:
When i try to apply the above yaml, getting the below error
Error from server (InternalError): error when creating "cronjob.yaml": Internal error occurred: add operation does not apply: doc is missing path: "/spec/jobtemplate/spec/template/metadata/annotations": missing value