Skip to content

Commit

Permalink
document cni binary and conflist paths (#2501)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdn5126 authored Aug 24, 2023
1 parent d3ab194 commit 121a7b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ To select an `ENIConfig` based upon availability zone set this to `topology.kube

---

#### `HOST_CNI_BIN_PATH`

Type: String

Default: `/host/opt/cni/bin`

Specifies the location to install CNI binaries. Note that the `aws-node` daemonset mounts `/opt/cni/bin` to `/host/opt/cni/bin`. The value you choose must be a location that the `aws-node` pod can write to.

---

#### `HOST_CNI_CONFDIR_PATH`

Type: String

Default: `/host/etc/cni/net.d`

Specifies the location to install the VPC CNI conflist. Note that the `aws-node` daemonset mounts `/etc/cni/net.d` to `/host/etc/cni/net.d`. The value you choose must be a location that the `aws-node` pod can write to.

#### `AWS_VPC_ENI_MTU` (v1.6.0+)

Type: Integer as a String
Expand Down
9 changes: 5 additions & 4 deletions cmd/aws-vpc-cni/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const (
egressPluginIpamDstV6 = "::/0"
egressPluginIpamDataDirV4 = "/run/cni/v6pd/egress-v4-ipam"
egressPluginIpamDataDirV6 = "/run/cni/v4pd/egress-v6-ipam"
defaultHostCNIBinPath = "/host/opt/cni/bin"
defaultHostCNIConfDirPath = "/host/etc/cni/net.d"
defaultHostCniBinPath = "/host/opt/cni/bin"
defaultHostCniConfDirPath = "/host/etc/cni/net.d"
defaultAWSconflistFile = "/app/10-aws.conflist"
tmpAWSconflistFile = "/tmp/10-aws.conflist"
defaultVethPrefix = "eni"
Expand Down Expand Up @@ -404,7 +404,7 @@ func _main() int {
}

pluginBins := []string{"aws-cni", "egress-cni"}
hostCNIBinPath := utils.GetEnv(envHostCniBinPath, defaultHostCNIBinPath)
hostCNIBinPath := utils.GetEnv(envHostCniBinPath, defaultHostCniBinPath)
err := cp.InstallBinaries(pluginBins, hostCNIBinPath)
if err != nil {
log.WithError(err).Error("Failed to install CNI binaries")
Expand Down Expand Up @@ -445,7 +445,8 @@ func _main() int {
return 1
}

err = cp.CopyFile(tmpAWSconflistFile, defaultHostCNIConfDirPath+awsConflistFile)
hostCniConfDirPath := utils.GetEnv(envHostCniConfDirPath, defaultHostCniConfDirPath)
err = cp.CopyFile(tmpAWSconflistFile, hostCniConfDirPath+awsConflistFile)
if err != nil {
log.WithError(err).Errorf("Failed to copy %s", awsConflistFile)
return 1
Expand Down

0 comments on commit 121a7b1

Please sign in to comment.