Skip to content

Commit

Permalink
[stable/fairwinds-insights] Added job for Action Items Statistics (#1314
Browse files Browse the repository at this point in the history
)

* Added job for Action Items Statistics

* Fixed lint

* Removing Ivan

* Fixing issue

* Testing

* Fixing historical proces

* Trying to fix

* Trying to fix

* Trying to fix

* Trying to fix

* Trying to fix

* Trying to fix

* Trying to fix

* Trying to fix

* Fixing issue

* Fixed params

* Bumped version
  • Loading branch information
jdesouza authored Sep 6, 2023
1 parent 29f8844 commit a220de1
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
/stable/gemini/ @rbren
/stable/gke-node-termination-handler/ @sudermanjr
/stable/goldilocks/ @sudermanjr
/stable/fairwinds-insights/ @rbren @ivanfetch-fw @mhoss019 @jdesouza @vitorvezani
/stable/insights-admission/ @rbren @ivanfetch-fw @jdesouza @vitorvezani
/stable/insights-agent/ @rbren @ivanfetch-fw @jdesouza @vitorvezani
/stable/fairwinds-insights/ @rbren @mhoss019 @jdesouza @vitorvezani
/stable/insights-admission/ @rbren @jdesouza @vitorvezani
/stable/insights-agent/ @rbren @jdesouza @vitorvezani
/stable/helm-release-pruner/ @rbren
/stable/vpa/ @sudermanjr

2 changes: 2 additions & 0 deletions stable/fairwinds-insights/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## 0.19.0
* Added job for Action Items Statistics
## 0.18.15
* Update application version to 13.9. [See the release notes for more details](https://insights.docs.fairwinds.com/release-notes)

Expand Down
3 changes: 1 addition & 2 deletions stable/fairwinds-insights/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ apiVersion: v2
appVersion: "13.9"
description: A Helm chart to run the Fairwinds Insights server
name: fairwinds-insights
version: 0.18.15
version: 0.19.0
kubeVersion: ">= 1.22.0-0"
maintainers:
- name: rbren
- name: mhoss019
- name: ivanfetch-fw
dependencies:
- name: postgresql
version: 12.1.6
Expand Down
9 changes: 9 additions & 0 deletions stable/fairwinds-insights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ See [insights.docs.fairwinds.com](https://insights.docs.fairwinds.com/technical-
| databaseCleanupCronjob.resources | object | `{"limits":{"cpu":"500m","memory":"1024Mi"},"requests":{"cpu":"80m","memory":"128Mi"}}` | Resources for the database cleanup job. |
| databaseCleanupCronjob.schedules | list | `[{"cron":"0 0 * * *","interval":"24h","name":"database-cleanup"}]` | CRON schedules for the database cleanup job. |
| databaseCleanupCronjob.securityContext.runAsUser | int | `10324` | The user ID to run the database cleanup job under. |
| actionItemsStatisticsCronjob.enabled | bool | `true` | |
| actionItemsStatisticsCronjob.resources.limits.cpu | string | `"500m"` | |
| actionItemsStatisticsCronjob.resources.limits.memory | string | `"1024Mi"` | |
| actionItemsStatisticsCronjob.resources.requests.cpu | string | `"80m"` | |
| actionItemsStatisticsCronjob.resources.requests.memory | string | `"128Mi"` | |
| actionItemsStatisticsCronjob.schedules[0].name | string | `"action-items-statistics"` | |
| actionItemsStatisticsCronjob.schedules[0].interval | string | `"24h"` | |
| actionItemsStatisticsCronjob.schedules[0].cron | string | `"0 0 * * *"` | |
| actionItemsStatisticsCronjob.securityContext.runAsUser | int | `10324` | |
| resourcesRecommendationsCronjob.enabled | bool | `true` | Enable resources recommendations true by default |
| resourcesRecommendationsCronjob.resources | object | `{"limits":{"cpu":1,"memory":"3Gi"},"requests":{"cpu":1,"memory":"3Gi"}}` | Resources for the resources recommendations job. |
| resourcesRecommendationsCronjob.schedules | list | `[{"cron":"0 2 * * *","interval":"24h","name":"resources-recommendations"}]` | CRON schedules for the resources recommendations job. |
Expand Down
4 changes: 4 additions & 0 deletions stable/fairwinds-insights/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ databaseCleanupCronjob:
enabled: true
schedules: []

actionItemsStatisticsCronjob:
enabled: true
schedules: []

resourcesRecommendationsCronjob:
enabled: true
schedules: []
Expand Down
41 changes: 41 additions & 0 deletions stable/fairwinds-insights/templates/action-items-statistics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if and .Values.actionItemsStatisticsCronjob .Values.actionItemsStatisticsCronjob.enabled }}
{{ range .Values.actionItemsStatisticsCronjob.schedules }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "fairwinds-insights.fullname" $ }}-cronjob-{{ .name }}
labels:
{{- include "fairwinds-insights.labels" $ | nindent 4 }}
app.kubernetes.io/component: action-items-statistics-{{ .name }}
spec:
schedule: "{{ .cron }}"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
{{- with $.Values.image.pullSecret }}
imagePullSecrets:
- name: {{ . }}
{{- end }}
containers:
- name: fairwinds-insights
image: "{{ $.Values.cronjobImage.repository }}:{{ include "fairwinds-insights.cronjobImageTag" $ }}"
command: ["action_items_statistics"]
{{- include "env" $ | indent 14 }}
imagePullPolicy: Always
resources:
{{- toYaml $.Values.actionItemsStatisticsCronjob.resources | nindent 16 }}
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
runAsNonRoot: true
runAsUser: {{ $.Values.actionItemsStatisticsCronjob.securityContext.runAsUser }}
capabilities:
drop:
- ALL
{{ end }}
{{- end }}
16 changes: 16 additions & 0 deletions stable/fairwinds-insights/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,22 @@ databaseCleanupCronjob:
# -- The user ID to run the database cleanup job under.
runAsUser: 10324

actionItemsStatisticsCronjob:
enabled: true
resources:
limits:
cpu: 500m
memory: 1024Mi
requests:
cpu: 80m
memory: 128Mi
schedules:
- name: action-items-statistics
interval: 24h
cron: "0 0 * * *"
securityContext:
runAsUser: 10324

resourcesRecommendationsCronjob:
# -- Enable resources recommendations true by default
enabled: true
Expand Down

0 comments on commit a220de1

Please sign in to comment.