Skip to content

Commit

Permalink
Merge pull request #11 from fiverr/cilium_native_support
Browse files Browse the repository at this point in the history
Support cilium in a more native fashion
  • Loading branch information
nadavbuc authored May 5, 2024
2 parents d13b245 + 681bb7b commit e01dbee
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/karpenter_nodes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: karpenter_nodes
version: 1.0.1
version: 1.0.2
description: A Helm chart for generating NodeClasses and NodePools for Karpenter
maintainers:
- name: nadavbuc
2 changes: 2 additions & 0 deletions charts/karpenter_nodes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Note - Most of the values can be overridden per nodegroup (If not specified, it
| `headRoom` | Generate Ultra Low Priority Class for Headroom (see below) | `String` || x |
| `additionalRequirements` | add NodePool requirements which are not covered by this chart | `List(map)` |||
| `autoTaint` | add NodePool taint with `dedicated` as key and nodegroup name as value (`-` replaced with `_`) | `Boolean(String)` |||
| `cilium` | Add startupTaints for Cilium | `Boolean` |||
| `ciliumEffect` | Set Effect on CiliumStartupTaint (Default `NoExecute`) [Documentation](https://docs.cilium.io/en/stable/installation/taints/) | `String` |||

### NodeGroup Configuration
| Key Name | Description | Type | Optional? | Optional Per NodeGroup? |
Expand Down
11 changes: 9 additions & 2 deletions charts/karpenter_nodes/templates/nodepool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if hasKey $v "startupTaints" }}
{{- if or (hasKey $v "startupTaints") ($v.cilium | default $.Values.cilium) }}
startupTaints:
{{- range $v.startupTaints }}
{{- if hasKey $v "startupTaints" }}
{{- range $v.startupTaints }}
- key: {{ .key }}
value: {{ .value }}
effect: {{ .effect }}
{{- end }}
{{- end }}
{{- if $v.cilium | default $.Values.cilium }}
- key: node.cilium.io/agent-not-ready
value: "true"
effect: {{ $v.ciliumEffect | default $.Values.ciliumEffect }}
{{- end }}
{{- end }}
requirements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ tests:
value: t3a.xlarge
- isNull:
path: spec.template.spec.requirements[6]
- equal:
path: spec.template.spec.startupTaints[0].key
value: "node.cilium.io/agent-not-ready"
- equal:
path: spec.template.spec.startupTaints[0].value
value: "true"
- equal:
path: spec.template.spec.startupTaints[0].effect
value: NoExecute
9 changes: 9 additions & 0 deletions charts/karpenter_nodes/tests/nodepool_nodes_noclass_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,12 @@ tests:
- equal:
path: spec.template.spec.requirements[6].values[0]
value: "linux"
- equal:
path: spec.template.spec.startupTaints[0].key
value: "node.cilium.io/agent-not-ready"
- equal:
path: spec.template.spec.startupTaints[0].value
value: "true"
- equal:
path: spec.template.spec.startupTaints[0].effect
value: NoSchedule
2 changes: 0 additions & 2 deletions charts/karpenter_nodes/tests/nodepool_nodes_workers_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ tests:
path: spec.template.spec.taints[0].effect
value: NoSchedule


- it: Verify nodes-workers requirements
documentIndex: 3
asserts:
Expand Down Expand Up @@ -210,4 +209,3 @@ tests:
- equal:
path: spec.weight
value: 3

3 changes: 3 additions & 0 deletions charts/karpenter_nodes/tests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ nodeGroups:
instances: {}
nodeClassRef:
name: default
cilium: true
ciliumEffect: "NoSchedule"

nodes-workers:
additionalNodeTags:
Expand Down Expand Up @@ -137,6 +139,7 @@ nodeGroups:
- t3a.xlarge
nodeClassRef:
name: default
cilium: true

#Default cluster Settings
clusterName: "eks-dev"
Expand Down
3 changes: 3 additions & 0 deletions charts/karpenter_nodes/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ nodeGroups: {}
# additionalRequirements:
# - key: "karpenter.k8s.aws/instance-local-nvme"
# operator: "Exists"

cilium: false
ciliumEffect: "NoExecute" # "NoSchedule"

0 comments on commit e01dbee

Please sign in to comment.