aws-vpc-cni

by Helm

Helm chartv1.23.3App v1.23.3

A Helm chart for the AWS VPC CNI

About this chart

AWS VPC CNI

This chart installs the AWS CNI Daemonset: https://github.com/aws/amazon-vpc-cni-k8s

Prerequisites

  • Kubernetes 1.11+ running on AWS
  • Helm v3

Installing the Chart

First add the EKS repository to Helm:

helm repo add eks https://aws.github.io/eks-charts

To install the chart with the release name aws-vpc-cni and default configuration:

$ helm install aws-vpc-cni --namespace kube-system eks/aws-vpc-cni

To install into an EKS cluster where the CNI is already installed, see this section below

To migrate helm release for aws-vpc-cni chart from v2 to v3, see Migrate from helm v2 to helm v3

Configuration

The following table lists the configurable parameters for this chart and their default values.

ParameterDescriptionDefault
affinityMap of node/pod affinities{}
cniConfig.enabledEnable overriding the default 10-aws.conflist filefalse
cniConfig.fileContentsThe contents of the custom cni config filenil
eniConfig.createSpecifies whether to create ENIConfig resource(s)false
eniConfig.regionRegion to use when generating ENIConfig resource namesus-west-2
eniConfig.subnetsA map of AZ identifiers to config per AZnil
eniConfig.subnets.idThe ID of the subnet within the AZ which will be used in the ENIConfignil
eniConfig.subnets.securityGroupsThe IDs of the security groups which will be used in the ENIConfignil
envList of environment variables. See here for options(see values.yaml)
enableWindowsIpamEnable windows support for your clusterfalse
enableNetworkPolicyEnable Network Policy Controller and Agent for your clusterfalse
enableWindowsPrefixDelegationEnable windows prefix delegation support for your clusterfalse
warmWindowsPrefixTargetWarm prefix target value for Windows prefix delegation0
warmWindowsIPTargetWarm IP target value for Windows prefix delegation1
minimumWindowsIPTargetMinimum IP target value for Windows prefix delegation3
branchENICooldownNumber of seconds that branch ENIs remain in cooldown60
fullnameOverrideOverride the fullname of the chartaws-node
image.tagImage tagv1.23.3
image.domainECR repository domainamazonaws.com
image.regionECR repository region to use. Should match your clusterus-west-2
image.endpointECR repository endpoint to use.ecr
image.accountECR repository account number602401143452
image.pullPolicyContainer pull policyIfNotPresent
image.overrideRepositoryRepository override for the image (does not change the tag)nil
image.overrideA custom docker image to usenil
imagePullSecretsDocker registry pull secret[]
init.image.tagImage tagv1.23.3
init.image.domainECR repository domainamazonaws.com
init.image.regionECR repository region to use. Should match your clusterus-west-2
init.image.endpointECR repository endpoint to use.ecr
init.image.accountECR repository account number602401143452
init.image.pullPolicyContainer pull policyIfNotPresent
init.image.overrideRepositoryRepository override for the image (does not change the tag)nil
init.image.overrideA custom docker image to usenil
init.envList of init container environment variables. See here for options(see values.yaml)
init.securityContextInit container Security contextprivileged: true
init.resourcesInit container resources, will defualt to .Values.resources if not set{}
originalMatchLabelsUse the original daemonset matchLabelsfalse
nameOverrideOverride the name of the chartaws-node
nodeAgent.enabledIf the Node Agent container should be createdtrue
nodeAgent.image.tagImage tag for Node Agentv1.5.0
nodeAgent.image.domainECR repository domainamazonaws.com
nodeAgent.image.regionECR repository region to use. Should match your clusterus-west-2
nodeAgent.image.endpointECR repository endpoint to use.ecr
nodeAgent.image.accountECR repository account number602401143452
nodeAgent.image.pullPolicyContainer pull policyIfNotPresent
nodeAgent.image.overrideRepositoryRepository override for the image (does not change the tag)nil
nodeAgent.image.overrideA custom docker image to usenil
nodeAgent.securityContextNode Agent container Security contextcapabilities: add: - "NET_ADMIN" privileged: true
nodeAgent.enableCloudWatchLogsEnable CW logging for Node Agentfalse
nodeAgent.networkPolicyAgentLogFileLocationLog File location of Network Policy Agent/var/log/aws-routed-eni/network-policy-agent.log
nodeAgent.enablePolicyEventLogsEnable policy decision logs for Node Agentfalse
nodeAgent.metricsBindAddrNode Agent port for metrics8162
nodeAgent.healthProbeBindAddrNode Agent port for health probes8163
nodeAgent.conntrackCacheCleanupPeriodCleanup interval for network policy agent conntrack cache300
nodeAgent.conntrackCacheTableSizeSize of the conntrack cache table (valid range: 32K-1024K)524288
nodeAgent.enableIpv6Enable IPv6 support for Node Agentfalse
nodeAgent.resourcesNode Agent resources, will defualt to .Values.resources if not set{}
nodeAgent.logLevelNode Agent logging verbosity level.debug
extraVolumesArray to add extra volumes[]
extraVolumeMountsArray to add extra mount[]
nodeSelectorNode labels for pod assignment{}
podSecurityContextPod Security Context{}
podAnnotationsannotations to add to each pod{}
podLabelsLabels to add to each pod{}
priorityClassNameName of the priorityClasssystem-node-critical
resourcesResources for containers in podrequests.cpu: 25m
securityContextContainer Security contextcapabilities: add: - "NET_ADMIN" - "NET_RAW"
serviceAccount.nameThe name of the ServiceAccount to usenil
serviceAccount.createSpecifies whether a ServiceAccount should be createdtrue
serviceAccount.annotationsSpecifies the annotations for ServiceAccount{}
livenessProbeLivenness probe settings for daemonset(see values.yaml)
readinessProbeReadiness probe settings for daemonset(see values.yaml)
tolerationsOptional deployment tolerations[{"operator": "Exists"}]
updateStrategyOptional update strategytype: RollingUpdate
minReadySecondsMinimum seconds a new pod must be ready to be availablenil

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install aws-vpc-cni --namespace kube-system eks/aws-vpc-cni --values values.yaml

Adopting the existing aws-node resources in an EKS cluster

If you do not want to delete the existing aws-node resources in your cluster that run the aws-vpc-cni and then install this helm chart, you can adopt the resources into a release instead. Refer to the script below to import existing resources into helm. Once you have annotated and labeled all the resources this chart specifies, enable the originalMatchLabels flag. If you have been careful, this should not diff and leave all the resources unmodified and now under management of helm.

#!/usr/bin/env bash

set -euo pipefail

for kind in daemonSet clusterRole clusterRoleBinding serviceAccount; do
  echo "setting annotations and labels on $kind/aws-node"
  kubectl -n kube-system annotate --overwrite $kind aws-node meta.helm.sh/release-name=aws-vpc-cni
  kubectl -n kube-system annotate --overwrite $kind aws-node meta.helm.sh/release-namespace=kube-system
  kubectl -n kube-system label --overwrite $kind aws-node app.kubernetes.io/managed-by=Helm
done

kubectl -n kube-system annotate --overwrite configmap amazon-vpc-cni meta.helm.sh/release-name=aws-vpc-cni
kubectl -n kube-system annotate --overwrite configmap amazon-vpc-cni meta.helm.sh/release-namespace=kube-system
kubectl -n kube-system label --overwrite configmap amazon-vpc-cni app.kubernetes.io/managed-by=Helm

Kubernetes recommends using server-side apply for more control over the field manager. After adopting the chart resources, you can run the following command to apply the chart:

helm template aws-vpc-cni --include-crds --namespace kube-system eks/aws-vpc-cni --set originalMatchLabels=true | kubectl apply --server-side --force-conflicts --field-manager Helm -f -


## Migrate from Helm v2 to Helm v3
You can use the [Helm 2to3 plugin](https://github.com/helm/helm-2to3) to migrate releases from Helm v2 to Helm v3. For a more detailed explanation with some examples about this migration plugin, refer to Helm blog post: [How to migrate from Helm v2 to Helm v3](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/).

Deploy aws-vpc-cni with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has aws-vpc-cni on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartaws-vpc-cni is pinned at v1.23.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply