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

Helm chart #24

Open
wants to merge 3 commits into
base: main
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
6 changes: 6 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
appVersion: 1.0.0
description: A Helm chart for Kubernetes
name: polaris-slack
type: application
version: 1.0.0
8 changes: 8 additions & 0 deletions helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# polaris-slack helm chart

- build docker image
- push to your docker repo
- use this helm chart to create cronjob in Kubernetes cluster (tested with EKS and ArgoCD)
- change main needed parameters in values.yaml ( better overwrite via ArgoCD UI parameters, ** not recommended to keep sensitive info in github repo ** )


45 changes: 45 additions & 0 deletions helm/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: polaris-slack
namespace: default # Namespace where the CronJob is created
spec:
concurrencyPolicy: Forbid # Forbid, Replace, Allow
failedJobsHistoryLimit: 1 # Number of failed jobs to keep
jobTemplate:
metadata:
name: polaris-slack
spec:
template:
metadata:
spec:
containers:
- image: "{{ .Values.image.registry }}:{{ .Values.image.tag }}" # Image to be used for the job
env:
- name: POLARIS_URL
value: {{ .Values.url }} # URL of the Polaris API endpoint
- name: POLARIS_TOKEN
value: {{ .Values.token}} # Token to authenticate with the Polaris API
- name: SLACK_WEBHOOK_URL
value: {{ .Values.webhook }} # URL of the Slack webhook
imagePullPolicy: IfNotPresent
name: polaris-slack
resources:
requests:
memory: {{ .Values.resources.requests.memory }}
cpu: {{ .Values.resources.requests.cpu }}
limits:
memory: {{ .Values.resources.limits.memory }}
cpu: {{ .Values.resources.limits.cpu }}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
securityContext:
runAsNonRoot: true
runAsUser: 1000
schedule: {{ .Values.cron.schedule }}
successfulJobsHistoryLimit: 0 # Number of successful jobs to keep
suspend: false
status: {}
18 changes: 18 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image:
registry: "docker.registry"
tag: "latest"

url: "https://www.example.com"
token: "token"
webhook: "https://www.example.com"

resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

cron:
schedule: "0 10 * * 5" # Schedule for the CronJob every Friday at 10:00 AM