Skip to content

Commit

Permalink
[aws-vpc-cni] Add CNI config via a configmap (#204)
Browse files Browse the repository at this point in the history
* [aws-vpc-cni] add optional configmap for the cni config

* bump chart version

* add newline to config map
  • Loading branch information
willejs committed Jan 13, 2021
1 parent 6ea9b88 commit c145468
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stable/aws-vpc-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The following table lists the configurable parameters for this chart and their d
| Parameter | Description | Default |
| ------------------------|---------------------------------------------------------|-------------------------------------|
| `affinity` | Map of node/pod affinities | `{}` |
| `cniConfig.enabled` | Enable overriding the default 10-aws.conflist file | `false` |
| `cniConfig.fileContents`| The contents of the custom cni config file | `nil` |
| `env` | List of environment variables. See [here](https://github.com/aws/amazon-vpc-cni-k8s#cni-configuration-variables) for options | (see `values.yaml`) |
| `fullnameOverride` | Override the fullname of the chart | `aws-node` |
| `image.region` | ECR repository region to use. Should match your cluster | `us-west-2` |
Expand Down
10 changes: 10 additions & 0 deletions stable/aws-vpc-cni/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.cniConfig.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "aws-vpc-cni.fullname" . }}
labels:
{{ include "aws-vpc-cni.labels" . | indent 4 }}
data:
10-aws.conflist: {{ .Values.cniConfig.fileContents | b64enc }}
{{- end -}}
12 changes: 12 additions & 0 deletions stable/aws-vpc-cni/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ spec:
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
{{- if .Values.cniConfig.enabled }}
# the dockerfile copies the baked in config to this location, lets overwrite it with ours
# the entrypoint.sh script will then copy our config to /host/etc/cni/net.d on boot
- name: cni-config
mountPath: /app/10-aws.conflist
subPath: 10-aws.conflist
{{- end }}
- mountPath: /host/var/log/aws-routed-eni
name: log-dir
- mountPath: /var/run/dockershim.sock
Expand All @@ -98,6 +105,11 @@ spec:
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d
{{- if .Values.cniConfig.enabled }}
- name: cni-config
configMap:
name: {{ include "aws-vpc-cni.fullname" . }}
{{- end }}
- name: dockershim
hostPath:
path: /var/run/dockershim.sock
Expand Down
4 changes: 4 additions & 0 deletions stable/aws-vpc-cni/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ env:
# You can then annotate and label the original aws-node resources and 'adopt' them into a helm release
originalMatchLabels: false

cniConfig:
enabled: false
fileContents: ""

imagePullSecrets: []

fullnameOverride: "aws-node"
Expand Down

0 comments on commit c145468

Please sign in to comment.