Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws-vpc-cni] Add CNI config via a configmap #204

Merged
merged 6 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -115,6 +115,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 @@ -130,6 +137,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