Skip to content

Commit

Permalink
[stable/fairwinds-insights] - add Slack channels local refresher cron…
Browse files Browse the repository at this point in the history
…job (#1334)

* add slackChannelsLocalRefresherCronjob

* add docs

* bump version

* adding new line at EOF

* Update Chart.yaml
  • Loading branch information
vitorvezani authored Oct 10, 2023
1 parent 7e4aac1 commit 4968626
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1 deletion.
3 changes: 3 additions & 0 deletions stable/fairwinds-insights/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.20.0
* Add `slackChannelsLocalRefresherCronjob` to `stable/fairwinds-insights`.

## 0.19.8
* Update application version to 14.1. [See the release notes for more details](https://insights.docs.fairwinds.com/release-notes)

Expand Down
2 changes: 1 addition & 1 deletion stable/fairwinds-insights/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "14.1"
description: A Helm chart to run the Fairwinds Insights server
name: fairwinds-insights
version: 0.19.8
version: 0.20.0
kubeVersion: ">= 1.22.0-0"
maintainers:
- name: rbren
Expand Down
4 changes: 4 additions & 0 deletions stable/fairwinds-insights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,7 @@ See [insights.docs.fairwinds.com](https://insights.docs.fairwinds.com/technical-
| repoScanJob.resources.requests.memory | string | `"128Mi"` | |
| repoScanJob.nodeSelector | object | `{}` | |
| repoScanJob.tolerations | list | `[]` | |
| slackChannelsLocalRefresherCronjob.enabled | bool | `true` | |
| slackChannelsLocalRefresherCronjob.resources | object | `{"limits":{"cpu":"250m","memory":"512Mi"},"requests":{"cpu":"150m","memory":"256Mi"}}` | Resources for the slack channels local refresher cron-job. |
| slackChannelsLocalRefresherCronjob.schedules | list | `[{"cron":"0/15 * * * *","name":"default-schedule"}]` | CRON schedules for the slack channels local refresher cron-job. |
| slackChannelsLocalRefresherCronjob.securityContext.runAsUser | int | `10324` | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if and .Values.slackChannelsLocalRefresherCronjob .Values.slackChannelsLocalRefresherCronjob.enabled }}
{{ range .Values.slackChannelsLocalRefresherCronjob.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: slack-channels-local-refresher-{{ .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: ["slack_channels_local_refresher"]
{{- include "env" $ | indent 14 }}
imagePullPolicy: Always
resources:
{{- toYaml $.Values.slackChannelsLocalRefresherCronjob.resources | nindent 16 }}
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
runAsNonRoot: true
runAsUser: {{ $.Values.slackChannelsLocalRefresherCronjob.securityContext.runAsUser }}
capabilities:
drop:
- ALL
{{ end }}
{{- end }}
17 changes: 17 additions & 0 deletions stable/fairwinds-insights/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -706,3 +706,20 @@ repoScanJob:
memory: 128Mi
nodeSelector: {}
tolerations: []

slackChannelsLocalRefresherCronjob:
enabled: true
# -- Resources for the slack channels local refresher cron-job.
resources:
limits:
cpu: 250m
memory: 512Mi
requests:
cpu: 150m
memory: 256Mi
# -- CRON schedules for the slack channels local refresher cron-job.
schedules:
- name: default-schedule
cron: "0/15 * * * *"
securityContext:
runAsUser: 10324

0 comments on commit 4968626

Please sign in to comment.