Skip to content

Commit

Permalink
Generate rke2-canal resource bounds from template values rather than …
Browse files Browse the repository at this point in the history
…hardcoding. (#359)

* use template values to set resource bounds
* packageVersion increment

Signed-off-by: Anson Mansfield <[email protected]>
  • Loading branch information
AJMansfield committed Jul 14, 2023
1 parent 16b7300 commit 35ef849
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/rke2-canal/charts/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ spec:
{{- end }}
securityContext:
privileged: true
resources:
requests:
cpu: 250m
{{- if .Values.calico.resources }}
resources: {{- toYaml .Values.calico.resources | nindent 12 }}
{{- end }}
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -239,6 +239,9 @@ spec:
{{- end }}
securityContext:
privileged: true
{{- if .Values.flannel.resources }}
resources: {{- toYaml .Values.flannel.resources | nindent 12 }}
{{- end }}
env:
- name: POD_NAME
valueFrom:
Expand Down
16 changes: 16 additions & 0 deletions packages/rke2-canal/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ flannel:
#tunnelMode: "separate"
# Persistent keep interval to use
keepaliveInterval: 0
# Resource bounds for the kube-flannel daemon container
resources: ~
# requests:
# memory: 32Mi
# cpu: 100m
# limits:
# memory: 128Mi
# cpu: 500m

calico:
# CNI installation image.
Expand Down Expand Up @@ -112,6 +120,14 @@ calico:
ip6AutoDetectionMethod: "first-found"
# Enable calico kube-controllers
calicoKubeControllers: false
# Resource bounds for the calico-node daemon container
resources:
requests:
cpu: 250m
# memory: 128Mi
# limits:
# cpu: 250m
# memory: 256Mi

global:
systemDefaultRegistry: ""
Expand Down
2 changes: 1 addition & 1 deletion packages/rke2-canal/package.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
url: local
packageVersion: 03
packageVersion: 04

0 comments on commit 35ef849

Please sign in to comment.