Skip to content

Commit

Permalink
feat(chart): Made node agent optional (#2623)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Hipwell <[email protected]>
  • Loading branch information
stevehipwell authored Oct 24, 2023
1 parent 703468a commit bb5dd6a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions charts/aws-vpc-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ The following table lists the configurable parameters for this chart and their d
| `init.image.override` | A custom docker image to use | `nil` |
| `init.env` | List of init container environment variables. See [here](https://github.com/aws/amazon-vpc-cni-k8s#cni-configuration-variables) for options | (see `values.yaml`) |
| `init.securityContext` | Init container Security context | `privileged: true` |
| `init.resources` | Init container resources, will defualt to .Values.resources if not set | `{}` |
| `originalMatchLabels` | Use the original daemonset matchLabels | `false` |
| `nameOverride` | Override the name of the chart | `aws-node` |
| `nodeAgent.enabled` | If the Node Agent container should be created | `true` |
| `nodeAgent.image.tag` | Image tag for Node Agent | `v1.0.4` |
| `nodeAgent.image.domain`| ECR repository domain | `amazonaws.com` |
| `nodeAgent.image.region`| ECR repository region to use. Should match your cluster | `us-west-2` |
Expand All @@ -74,6 +76,7 @@ The following table lists the configurable parameters for this chart and their d
| `nodeAgent.metricsBindAddr` | Node Agent port for metrics | `8162` |
| `nodeAgent.healthProbeBindAddr` | Node Agent port for health probes | `8163` |
| `nodeAgent.enableIpv6` | Enable IPv6 support for Node Agent | `false` |
| `nodeAgent.resources` | Node Agent resources, will defualt to .Values.resources if not set | `{}` |
| `extraVolumes` | Array to add extra volumes | `[]` |
| `extraVolumeMounts` | Array to add extra mount | `[]` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
Expand Down
16 changes: 13 additions & 3 deletions charts/aws-vpc-cni/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.init.securityContext | nindent 12 }}
{{- with default .Values.resources .Values.init.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
Expand Down Expand Up @@ -91,8 +93,10 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
{{- with .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
volumeMounts:
Expand All @@ -116,6 +120,7 @@ spec:
{{- with .Values.extraVolumeMounts }}
{{- toYaml .| nindent 10 }}
{{- end }}
{{- if .Values.nodeAgent.enabled }}
- name: aws-eks-nodeagent
image: {{ include "aws-vpc-cni.nodeAgentImage" . }}
env:
Expand All @@ -131,8 +136,10 @@ spec:
- --enable-policy-event-logs={{ .Values.nodeAgent.enablePolicyEventLogs }}
- --metrics-bind-addr={{ include "aws-vpc-cni.nodeAgentMetricsBindAddr" . }}
- --health-probe-bind-addr={{ include "aws-vpc-cni.nodeAgentHealthProbeBindAddr" . }}
{{- with default .Values.resources .Values.nodeAgent.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.nodeAgent.securityContext | nindent 12 }}
volumeMounts:
Expand All @@ -144,10 +151,13 @@ spec:
name: log-dir
- mountPath: /var/run/aws-node
name: run-dir
{{- end }}
volumes:
{{- if .Values.nodeAgent.enabled }}
- name: bpf-pin-path
hostPath:
path: /sys/fs/bpf
{{- end }}
- name: cni-bin-dir
hostPath:
path: /opt/cni/bin
Expand Down
3 changes: 3 additions & 0 deletions charts/aws-vpc-cni/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ init:
ENABLE_IPv6: "false"
securityContext:
privileged: true
resources: {}

nodeAgent:
enabled: true
image:
tag: v1.0.4
domain: amazonaws.com
Expand All @@ -44,6 +46,7 @@ nodeAgent:
enableIpv6: "false"
metricsBindAddr: "8162"
healthProbeBindAddr: "8163"
resources: {}

image:
tag: v1.15.1
Expand Down

0 comments on commit bb5dd6a

Please sign in to comment.