Skip to content

Commit

Permalink
feat(charts/*): add affinities (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
perriea authored Oct 10, 2023
1 parent 3b9863b commit 09b730d
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 40 deletions.
2 changes: 1 addition & 1 deletion charts/kube-downscaler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
name: kube-downscaler
apiVersion: v1
version: 0.1.0
version: 0.1.1
appVersion: 0.5.1
description: A Helm chart for kube-downscaler
keywords:
Expand Down
56 changes: 35 additions & 21 deletions charts/kube-downscaler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 23,38 @@ spec:
spec:
serviceAccountName: {{ if .Values.rbac.create }}{{ template "kube-downscaler.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
containers:
- name: {{ template "kube-downscaler.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
args:
- --interval={{ .Values.interval }}
{{- if .Values.namespace }}
{{- if .Values.namespace.active_in }}
- --namespace={{ .Values.namespace.active_in }}
{{- end }}
{{- if .Values.namespace.inactive_in }}
- --exclude-namespaces={{ .Values.namespace.inactive_in | join "," }}
{{- end }}
{{- end }}
{{- if .Values.debug.enable }}
- --debug
{{- end }}
{{- with .Values.image.args }}
{{ toYaml . | indent 8 }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{ toYaml .Values.resources | indent 10 }}
- name: {{ template "kube-downscaler.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
args:
- --interval={{ .Values.interval }}
{{- if .Values.namespace }}
{{- if .Values.namespace.active_in }}
- --namespace={{ .Values.namespace.active_in }}
{{- end }}
{{- if .Values.namespace.inactive_in }}
- --exclude-namespaces={{ .Values.namespace.inactive_in | join "," }}
{{- end }}
{{- end }}
{{- if .Values.debug.enable }}
- --debug
{{- end }}
{{- with .Values.image.args }}
{{ toYaml . | indent 12 }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
32 changes: 16 additions & 16 deletions charts/kube-downscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 6,48 @@
replicaCount: 1
name: kube-downscaler
debug:
enable: True
enable: false

## Namespace where kube-downscaler is going to be deployed.
# namespace:
namespace:
## Deployment will query all namespaces if left empty:
# active_in:
active_in: ""
## Deployment exclude these namespaces:
# inactive_in:
inactive_in: null
## How frequently kube-downscaler should query applications uptime, unit is in seconds.

## Default is 1 minute.
interval: 60
rbac:
## If true, create & use RBAC resources
create: false
create: true
## Ignored if rbac.create is true
serviceAccountName: default
image:
repository: hjacobs/kube-downscaler
tag: 22.9.0
tag: 23.2.0
pullPolicy: IfNotPresent
args: []
# --default-uptime="Mon-Fri 07:30-20:30 Europe/Berlin"
resources:
limits:
cpu: 50m
memory: 200Mi
memory: 100Mi
requests:
cpu: 50m
memory: 200Mi
memory: 100Mi
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000

## Allow the DaemonSet to schedule on tainted nodes (requires Kubernetes >= 1.6)
# tolerations: []
## Allow the DaemonSet to schedule on tainted nodes (requires Kubernetes >= 1.6)
tolerations: []

## Allow the DaemonSet to schedule on selected nodes
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
# nodeSelector: {}
## Allow the DaemonSet to schedule on selected nodes
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
nodeSelector: {}

## Allow the DaemonSet to schedule ussing affinity rules
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
# affinity: {}
## Allow the DaemonSet to schedule ussing affinity rules
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}
2 changes: 1 addition & 1 deletion charts/workflow/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 2,7 @@ apiVersion: v2
name: workflow
description: A Helm chart for Kubernetes Workflows
type: application
version: 0.2.1
version: 0.2.2
appVersion: "1.16.0"
home: https://github.com/arktos-fund/helm-charts
keywords:
Expand Down
14 changes: 13 additions & 1 deletion charts/workflow/templates/cron_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 34,16 @@ spec:
workflowTemplateRef:
name: {{ include "workflow.fullname" $dot }}-template
clusterScope: false
{{- end }}
{{- with $dot.Values.tolerations }}
tolerations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $dot.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $dot.Values.affinity }}
affinity:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

0 comments on commit 09b730d

Please sign in to comment.