Skip to content

Commit

Permalink
[Helm chart] clean unused values and setup nodeselector and affinity (#…
Browse files Browse the repository at this point in the history
…78)

* remove service and autoscaling values

* remove autoscaling value in deployment

* implementing of nodeSelector and affinity in the helm chart

* removing unnecessary variable Release.Namespace

* removing unnecessary variable Release.Namespace
  • Loading branch information
rekcah78 authored Aug 12, 2024
1 parent e7c39dc commit 5dac935
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.configMapName }}
namespace: {{ .Release.Namespace }}
data:
# downscale for non-work hours
EXCLUDE_NAMESPACES: '{{- join "," .Values.excludedNamespaces }}'
Expand Down
11 changes: 8 additions & 3 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ metadata:
labels:
{{- include "py-kube-downscaler.labels" . | nindent 4 }}
name: {{ include "py-kube-downscaler.name" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "py-kube-downscaler.selectorLabels" . | nindent 6 }}
Expand Down Expand Up @@ -36,6 +33,14 @@ spec:
{{- toYaml .Values.securityContext | nindent 10 }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
1 change: 0 additions & 1 deletion chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "py-kube-downscaler.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
{{- if .Values.constrainedDownscaler }}
{{- if not .Values.constrainedNamespaces }}
Expand Down
10 changes: 0 additions & 10 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ securityContext:
drop:
- ALL

service:
type: ClusterIP
port: 80

resources:
limits:
cpu: 500m
Expand All @@ -54,12 +50,6 @@ resources:
cpu: 200m
memory: 300Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80

nodeSelector: {}

tolerations: []
Expand Down

0 comments on commit 5dac935

Please sign in to comment.