Skip to content

Commit

Permalink
Fixes and address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
moshevayner committed Jun 21, 2021
1 parent b8c401d commit dd26563
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 69 deletions.
22 changes: 5 additions & 17 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3121,22 +3121,9 @@ spec:
description: AmazonVPCNetworkingSpec declares that we want Amazon
VPC CNI networking
properties:
awsVpcK8sCniConfigureRpFilter:
description: Specifies whether ipamd should configure rp filter
for primary interface. Setting this to false will require
rp filter to be configured through init container.
type: string
disableTCPEarlyDemux:
description: If ENABLE_POD_ENI is set to true, in order for
the kubelet to connect via TCP (for liveness or readiness
probes) to pods that are using per pod security groups,
DISABLE_TCP_EARLY_DEMUX should be set to true for amazon-k8s-cni-init
container under initcontainers. This will increase the local
TCP connection latency slightly. To use this setting, a
Linux kernel version of at least 4.6 is needed on the worker
node.
type: string
env:
description: Env is a list of environment variables to set
in the container.
items:
description: EnvVar represents an environment variable present
in a Container.
Expand All @@ -3161,10 +3148,11 @@ spec:
type: object
type: array
imageName:
description: The container image name to use
description: ImageName is the container image name to use.
type: string
initImageName:
description: The init container image name to use
description: InitImageName is the init container image name
to use.
type: string
type: object
calico:
Expand Down
15 changes: 4 additions & 11 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,12 @@ type RomanaNetworkingSpec struct {

// AmazonVPCNetworkingSpec declares that we want Amazon VPC CNI networking
type AmazonVPCNetworkingSpec struct {
// Specifies whether ipamd should configure rp filter for primary interface.
// Setting this to false will require rp filter to be configured through init container.
AwsVpcK8sCniConfigureRpFilter string `json:"awsVpcK8sCniConfigureRpFilter,omitempty"`
Env []EnvVar `json:"env,omitempty"`
// If ENABLE_POD_ENI is set to true, in order for the kubelet to connect via TCP (for liveness or readiness probes) to pods that are using per pod security groups,
// DISABLE_TCP_EARLY_DEMUX should be set to true for amazon-k8s-cni-init container under initcontainers.
// This will increase the local TCP connection latency slightly.
// To use this setting, a Linux kernel version of at least 4.6 is needed on the worker node.
DisableTCPEarlyDemux string `json:"disableTCPEarlyDemux,omitempty"`
// The container image name to use
// ImageName is the container image name to use.
ImageName string `json:"imageName,omitempty"`
// The init container image name to use
// InitImageName is the init container image name to use.
InitImageName string `json:"initImageName,omitempty"`
// Env is a list of environment variables to set in the container.
Env []EnvVar `json:"env,omitempty"`
}

const CiliumIpamEni = "eni"
Expand Down
15 changes: 4 additions & 11 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,12 @@ type RomanaNetworkingSpec struct {

// AmazonVPCNetworkingSpec declares that we want Amazon VPC CNI networking
type AmazonVPCNetworkingSpec struct {
// Specifies whether ipamd should configure rp filter for primary interface.
// Setting this to false will require rp filter to be configured through init container.
AwsVpcK8sCniConfigureRpFilter string `json:"awsVpcK8sCniConfigureRpFilter,omitempty"`
Env []EnvVar `json:"env,omitempty"`
// If ENABLE_POD_ENI is set to true, in order for the kubelet to connect via TCP (for liveness or readiness probes) to pods that are using per pod security groups,
// DISABLE_TCP_EARLY_DEMUX should be set to true for amazon-k8s-cni-init container under initcontainers.
// This will increase the local TCP connection latency slightly.
// To use this setting, a Linux kernel version of at least 4.6 is needed on the worker node.
DisableTCPEarlyDemux string `json:"disableTCPEarlyDemux,omitempty"`
// The container image name to use
// ImageName is the container image name to use.
ImageName string `json:"imageName,omitempty"`
// The init container image name to use
// InitImageName is the init container image name to use.
InitImageName string `json:"initImageName,omitempty"`
// Env is a list of environment variables to set in the container.
Env []EnvVar `json:"env,omitempty"`
}

const CiliumIpamEni = "eni"
Expand Down
12 changes: 4 additions & 8 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"containers":
- "env":
- "name": "AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER"
"value": "{{ AwsVpcK8sCniConfigureRpFilter }}"
"value": "false"
# The below envs are commented-out on purpose. See https://github.com/kubernetes/kops/issues/11144 for more context.
# - "name": "AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG"
# "value": "false"
Expand Down Expand Up @@ -135,6 +135,8 @@
"valueFrom":
"fieldRef":
"fieldPath": "spec.nodeName"
# - "name": "WARM_ENI_TARGET"
# "value": "1"
- "name": "CLUSTER_NAME"
"value": "{{ ClusterName }}"
{{- range .Networking.AmazonVPC.Env }}
Expand Down Expand Up @@ -183,7 +185,7 @@
"initContainers":
- "env":
- "name": "DISABLE_TCP_EARLY_DEMUX"
"value": " {{ DisableTCPEarlyDemux }}"
"value": "false"
"image": "{{- or .Networking.AmazonVPC.InitImageName "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:v1.8.0" }}"
"imagePullPolicy": "Always"
"name": "aws-vpc-cni-init"
Expand Down
16 changes: 0 additions & 16 deletions upup/pkg/fi/cloudup/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,6 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
}
}

if cluster.Spec.Networking != nil && cluster.Spec.Networking.AmazonVPC != nil {
c := cluster.Spec.Networking.AmazonVPC
dest["AwsVpcK8sCniConfigureRpFilter"] = func() string {
if c.AwsVpcK8sCniConfigureRpFilter != "" {
return c.AwsVpcK8sCniConfigureRpFilter
}
return "false"
}
dest["DisableTCPEarlyDemux"] = func() string {
if c.DisableTCPEarlyDemux != "" {
return c.DisableTCPEarlyDemux
}
return "false"
}
}

if cluster.Spec.Networking != nil && cluster.Spec.Networking.Calico != nil {
c := cluster.Spec.Networking.Calico
dest["CalicoIPv4PoolIPIPMode"] = func() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
version: 1.17.0
- id: k8s-1.16
manifest: networking.amazon-vpc-routed-eni/k8s-1.16.yaml
manifestHash: 102ad54bf34da0a827df22e8cbaae453b83b0db9
manifestHash: 85f44dc21be84b6aeb78997a38b06183b7dc6e44
name: networking.amazon-vpc-routed-eni
needsRollingUpdate: all
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ spec:
initContainers:
- env:
- name: DISABLE_TCP_EARLY_DEMUX
value: ' false'
value: "false"
image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:v1.8.0
imagePullPolicy: Always
name: aws-vpc-cni-init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
version: 1.17.0
- id: k8s-1.16
manifest: networking.amazon-vpc-routed-eni/k8s-1.16.yaml
manifestHash: 102ad54bf34da0a827df22e8cbaae453b83b0db9
manifestHash: 85f44dc21be84b6aeb78997a38b06183b7dc6e44
name: networking.amazon-vpc-routed-eni
needsRollingUpdate: all
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ spec:
initContainers:
- env:
- name: DISABLE_TCP_EARLY_DEMUX
value: ' false'
value: "false"
image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:v1.8.0
imagePullPolicy: Always
name: aws-vpc-cni-init
Expand Down

0 comments on commit dd26563

Please sign in to comment.