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

Add successfulJobsHistoryLimit, failedJobsHistoryLimit to CronJobs #591

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/keys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/keys) to learn about
| `dispatcher.cleaner.auditEvents.retentionDuration` | Retention period for successfully sent audit messages. | `4320h` |
| `dispatcher.cleaner.cron.schedule` | Cron job schedule. | `0 1 * * *` |
| `dispatcher.cleaner.cron.successfulJobsHistoryLimit` | Specifies the number of successful finished jobs to keep. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `dispatcher.cleaner.cron.failedJobsHistoryLimit` | Specifies the number of failed finished jobs to keep. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `dispatcher.cleaner.cron.suspend` | You can suspend execution of Jobs for a CronJob, by setting the field to true. See [schedule suspension](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#schedule-suspension). | `false` |
| `dispatcher.cleaner.nodeSelector` | Kubernetes [node selectors](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector). | `{}` |

Expand Down
1 change: 1 addition & 0 deletions charts/keys/templates/cleaner/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
concurrencyPolicy: Forbid
schedule: "{{ .Values.dispatcher.cleaner.cron.schedule }}"
successfulJobsHistoryLimit: {{ .Values.dispatcher.cleaner.cron.successfulJobsHistoryLimit }}
failedJobsHistoryLimit: {{ .Values.dispatcher.cleaner.cron.failedJobsHistoryLimit }}
suspend: {{ .Values.dispatcher.cleaner.cron.suspend }}
jobTemplate:
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/keys/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,13 @@ dispatcher:

# @param dispatcher.cleaner.cron.schedule Cron job schedule.
# @param dispatcher.cleaner.cron.successfulJobsHistoryLimit Specifies the number of successful finished jobs to keep. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param dispatcher.cleaner.cron.failedJobsHistoryLimit Specifies the number of failed finished jobs to keep. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param dispatcher.cleaner.cron.suspend You can suspend execution of Jobs for a CronJob, by setting the field to true. See [schedule suspension](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#schedule-suspension).

cron:
schedule: 0 1 * * *
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
suspend: false

# @param dispatcher.cleaner.nodeSelector Kubernetes [node selectors](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector).
Expand Down
23 changes: 12 additions & 11 deletions charts/navi-castle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,18 @@ See the [documentation](https://docs.2gis.com/en/on-premise/navigation) to learn

### Cron settings

| Name | Description | Value |
| --------------------------------- | ------------------------------------------------------------------- | ------------- |
| `cron.enabled.import` | If the `import` cron job is enabled. | `false` |
| `cron.enabled.restriction` | If restrictions API enabled, incompatible with `restrictionImport`. | `false` |
| `cron.enabled.restrictionImport` | If restrictions import enabled, incompatible with `restriction`. | `false` |
| `cron.schedule.import` | Cron job schedule for `import`. | `11 * * * *` |
| `cron.schedule.restriction` | Cron job schedule for `restriction`. | `*/5 * * * *` |
| `cron.schedule.restrictionImport` | Cron job schedule for `restrictionImport`. | `*/5 * * * *` |
| `cron.concurrencyPolicy` | Cron job concurrency policy: `Allow` or `Forbid`. | `Forbid` |
| `cron.successfulJobsHistoryLimit` | How many completed and failed jobs should be kept. | `3` |
| `cron.prometheusPort` | Container port for supercronic prometheus | `9476` |
| Name | Description | Value |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
| `cron.enabled.import` | If the `import` cron job is enabled. | `false` |
| `cron.enabled.restriction` | If restrictions API enabled, incompatible with `restrictionImport`. | `false` |
| `cron.enabled.restrictionImport` | If restrictions import enabled, incompatible with `restriction`. | `false` |
| `cron.schedule.import` | Cron job schedule for `import`. | `11 * * * *` |
| `cron.schedule.restriction` | Cron job schedule for `restriction`. | `*/5 * * * *` |
| `cron.schedule.restrictionImport` | Cron job schedule for `restrictionImport`. | `*/5 * * * *` |
| `cron.concurrencyPolicy` | Cron job concurrency policy: `Allow` or `Forbid`. | `Forbid` |
| `cron.successfulJobsHistoryLimit` | How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `cron.failedJobsHistoryLimit` | How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `cron.prometheusPort` | Container port for supercronic prometheus | `9476` |

### Init settings

Expand Down
1 change: 1 addition & 0 deletions charts/navi-castle/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
schedule: {{ index $.Values.cron.schedule $flavor | quote }}
concurrencyPolicy: {{ $.Values.cron.concurrencyPolicy }}
successfulJobsHistoryLimit: {{ $.Values.cron.successfulJobsHistoryLimit }}
failedJobsHistoryLimit: {{ $.Values.cron.failedJobsHistoryLimit }}
jobTemplate:
spec:
template:
Expand Down
4 changes: 3 additions & 1 deletion charts/navi-castle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ nginx:
# @param cron.schedule.restriction Cron job schedule for `restriction`.
# @param cron.schedule.restrictionImport Cron job schedule for `restrictionImport`.
# @param cron.concurrencyPolicy Cron job concurrency policy: `Allow` or `Forbid`.
# @param cron.successfulJobsHistoryLimit How many completed and failed jobs should be kept.
# @param cron.successfulJobsHistoryLimit How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param cron.failedJobsHistoryLimit How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param cron.prometheusPort Container port for supercronic prometheus

cron:
Expand All @@ -194,6 +195,7 @@ cron:
restrictionImport: '*/5 * * * *'
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
prometheusPort: 9476


Expand Down
23 changes: 12 additions & 11 deletions charts/navi-restrictions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,18 @@ See the [documentation](https://docs.2gis.com/en/on-premise/restrictions) to lea

### Cron job settings

| Name | Description | Value |
| --------------------------------- | --------------------------------------------------------------------- | -------------------------------------------------------------- |
| `cron.enabled` | If Cron job is enabled | `false` |
| `cron.schedule` | Cron job schedule | `1 * * * *` |
| `cron.concurrencyPolicy` | Cron job concurrency policy: `Allow` or `Forbid` | `Forbid` |
| `cron.successfulJobsHistoryLimit` | How many completed and failed jobs should be kept | `3` |
| `cron.containerPort` | Cron container port | `8000` |
| `cron.edgesUriTemplate` | URL template for getting edges | `restrictions_json/{project}/{date_str}_{hour}.json` |
| `cron.edgeAttributesUriTemplate` | URL template for getting an edge's details | `develop/edge?edge_id={edge_id}&offset=200&routing=carrouting` |
| `cron.projects` | List of projects to get data for | `["moscow"]` |
| `cron.maxAttributesFetcherRps` | Maximum amount oif requests to `edgeAttributesUrlTemplate` per second | `25` |
| Name | Description | Value |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| `cron.enabled` | If Cron job is enabled | `false` |
| `cron.schedule` | Cron job schedule | `1 * * * *` |
| `cron.concurrencyPolicy` | Cron job concurrency policy: `Allow` or `Forbid` | `Forbid` |
| `cron.successfulJobsHistoryLimit` | How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `cron.failedJobsHistoryLimit` | How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `cron.containerPort` | Cron container port | `8000` |
| `cron.edgesUriTemplate` | URL template for getting edges | `restrictions_json/{project}/{date_str}_{hour}.json` |
| `cron.edgeAttributesUriTemplate` | URL template for getting an edge's details | `develop/edge?edge_id={edge_id}&offset=200&routing=carrouting` |
| `cron.projects` | List of projects to get data for | `["moscow"]` |
| `cron.maxAttributesFetcherRps` | Maximum amount oif requests to `edgeAttributesUrlTemplate` per second | `25` |

### Limits

Expand Down
1 change: 1 addition & 0 deletions charts/navi-restrictions/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
schedule: {{ .Values.cron.schedule | quote }}
concurrencyPolicy: {{ .Values.cron.concurrencyPolicy }}
successfulJobsHistoryLimit: {{ .Values.cron.successfulJobsHistoryLimit }}
failedJobsHistoryLimit: {{ .Values.cron.failedJobsHistoryLimit }}
jobTemplate:
spec:
template:
Expand Down
4 changes: 3 additions & 1 deletion charts/navi-restrictions/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ postgres:
# @param cron.enabled If Cron job is enabled
# @param cron.schedule Cron job schedule
# @param cron.concurrencyPolicy Cron job concurrency policy: `Allow` or `Forbid`
# @param cron.successfulJobsHistoryLimit How many completed and failed jobs should be kept
# @param cron.successfulJobsHistoryLimit How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param cron.failedJobsHistoryLimit How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param cron.containerPort Cron container port
# @param cron.edgesUriTemplate URL template for getting edges
# @param cron.edgeAttributesUriTemplate URL template for getting an edge's details
Expand All @@ -233,6 +234,7 @@ cron:
schedule: 1 * * * *
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
containerPort: 8000
edgesUriTemplate: restrictions_json/{project}/{date_str}_{hour}.json
edgeAttributesUriTemplate: develop/edge?edge_id={edge_id}&offset=200&routing=carrouting
Expand Down
Loading
Loading