Skip to content

Reverting PR 418 and syncing it with internal repo #462

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

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ff33d53
fix typo in document (#331)
ysam12345 Nov 15, 2023
4346533
Bump github.com/onsi/ginkgo/v2 from 2.12.1 to 2.13.0 (#322)
dependabot[bot] Nov 15, 2023
b94b068
Update VPC CNI version and force vulns check using latest go version …
haouc Nov 16, 2023
3a7c1e2
Bump github.com/onsi/gomega from 1.28.0 to 1.30.0 (#338)
dependabot[bot] Dec 1, 2023
3b2ee3d
Bump golang.org/x/time from 0.3.0 to 0.5.0 (#339)
dependabot[bot] Dec 1, 2023
f4a72cd
Bump github.com/prometheus/common from 0.44.0 to 0.45.0 (#337)
dependabot[bot] Dec 1, 2023
da4a300
update supported EC2 instances (#340)
haouc Dec 1, 2023
468eb44
Bump k8s.io/api from 0.28.3 to 0.28.4 (#336)
dependabot[bot] Dec 1, 2023
cd028ec
Add support to configure branch ENI cooldown period via configmap (#342)
sushrk Dec 7, 2023
91057be
manually update client-go in aligned with other dependencies (#341)
haouc Dec 7, 2023
5588773
fix the build issue
haouc Dec 8, 2023
af90f63
Update cooldown period in test (#344)
sushrk Dec 8, 2023
23dd415
update debugging doc (#349)
haouc Dec 22, 2023
31bfaa9
Bump github.com/google/uuid from 1.4.0 to 1.5.0 (#352)
dependabot[bot] Jan 2, 2024
7ee59cc
Bump github.com/aws/aws-sdk-go from 1.45.19 to 1.49.13 (#353)
dependabot[bot] Jan 2, 2024
9e88847
Bump github.com/prometheus/client_model (#354)
dependabot[bot] Jan 2, 2024
e95a9db
Bump github.com/samber/lo from 1.38.1 to 1.39.0 (#355)
dependabot[bot] Jan 2, 2024
25057d2
Bump github.com/aws/amazon-vpc-cni-k8s from 1.15.3 to 1.16.0 (#356)
dependabot[bot] Jan 2, 2024
e4ac94b
add data race detection in test (#357)
haouc Jan 3, 2024
88c4669
Update docs to add amazon-vpc-cni configmap options for SGPP and rela…
sushrk Jan 11, 2024
20c8069
add an node event example indicating cooldowm time windows has been u…
haouc Jan 12, 2024
acb1db7
update README to provide instructions to check its version (#361)
haouc Jan 18, 2024
ac00002
increase pod worker to 30 and update supported instance types list (#…
haouc Jan 30, 2024
296e1fd
Bump github.com/google/uuid from 1.5.0 to 1.6.0 (#364)
dependabot[bot] Feb 1, 2024
1fcce12
Bump k8s.io/client-go from 0.28.4 to 0.29.1 (#366)
dependabot[bot] Feb 1, 2024
59306ad
Bump github.com/prometheus/common from 0.45.0 to 0.46.0 (#367)
dependabot[bot] Feb 1, 2024
ee0d1ed
Bump github.com/onsi/gomega from 1.30.0 to 1.31.1 (#365)
dependabot[bot] Feb 1, 2024
4105de5
Bump sigs.k8s.io/controller-runtime from 0.16.3 to 0.17.0 (#363)
dependabot[bot] Feb 1, 2024
60d03c8
Increase windows test timeout (#368)
jchen6585 Feb 2, 2024
eab29a4
chore: migrate to kubebuilder v3 (#369)
sushrk Feb 6, 2024
f2c3e9b
rename windows flags (#371)
haouc Feb 20, 2024
604bc0b
fix: paginate DescribeNetworkInterfaces with deep filters (#375)
sushrk Feb 29, 2024
e4b7426
Bump github.com/aws/aws-sdk-go from 1.49.13 to 1.50.29 (#380)
dependabot[bot] Mar 1, 2024
0df4b12
Bump k8s.io/client-go from 0.29.1 to 0.29.2 (#377)
dependabot[bot] Mar 1, 2024
9a65750
Bump github.com/prometheus/common from 0.46.0 to 0.49.0 (#378)
dependabot[bot] Mar 1, 2024
b68a68d
Repo controlled build go version (#381)
xdu31 Mar 5, 2024
a86f654
update golang version (#383)
sushrk Mar 13, 2024
7affbf5
update protobuf to 1.33.0 (#387)
haouc Mar 19, 2024
b2c8c68
pin envtest version due to an upstream bug (#390)
haouc Mar 27, 2024
3b461d8
Bump k8s.io/client-go from 0.29.2 to 0.29.3 (#392)
dependabot[bot] Apr 1, 2024
e50d431
Bump github.com/aws/amazon-vpc-cni-k8s from 1.16.0 to 1.17.1 (#393)
dependabot[bot] Apr 1, 2024
861ab3e
Bump github.com/prometheus/common from 0.49.0 to 0.51.1 (#395)
dependabot[bot] Apr 2, 2024
384e4ad
Bump github.com/aws/aws-sdk-go from 1.50.29 to 1.51.12 (#397)
dependabot[bot] Apr 2, 2024
51ff604
add github action to run gosec static analysis (#398)
sushrk Apr 3, 2024
668273d
update golang and dependency to fix CVE (#401)
sushrk Apr 4, 2024
8bdd3b1
revert pagination and call DescribeNetworkInterfaces with vpcID or su…
sushrk Apr 4, 2024
db8ccee
update EC2 supported instance types (#402)
haouc Apr 4, 2024
11f8292
add finalizer handler in v1.4
haouc Jul 13, 2024
8e0b7c7
fix an err variable
haouc Aug 2, 2024
47bb479
adding logs for mismatched CNINode
haouc Aug 2, 2024
8eb3b40
add metrics for mismatches
haouc Aug 2, 2024
a40fef5
update EC2 instance types
haouc Aug 3, 2024
1c5b720
updating go version to 1.22 and controller gen version to 1.14.0
yash97 Aug 28, 2024
34c74a2
Revert "Merge branch eni-cleanup into master"
yash97 Sep 3, 2024
5b6edf6
syncing master with internal 1.4.7
yash97 Sep 3, 2024
a2b03f5
removing cni node test as part of revert PR
yash97 Sep 3, 2024
6c172e3
updating go mod
yash97 Sep 3, 2024
058a0e2
Merge branch 'master' into sync
yash97 Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ jobs:
- name: Install `gosec`
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
- name: Run Gosec Security Scanner
run: ~/go/bin/gosec -exclude-dir test -exclude-generated -severity medium ./...
run: ~/go/bin/gosec -exclude-dir test -exclude-generated -severity medium -exclude=G108,G114 ./...

2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21
1.22.5
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ VERSION ?= $(GIT_VERSION)
IMAGE ?= $(REPO):$(VERSION)
BASE_IMAGE ?= public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:latest.2
GOLANG_VERSION ?= $(shell cat .go-version)
BUILD_IMAGE ?= public.ecr.aws/docker/library/golang:$(GOLANG_VERSION)
BUILD_IMAGE ?= public.ecr.aws/bitnami/golang:$(GOLANG_VERSION)
GOARCH ?= amd64
PLATFORM ?= linux/amd64

export GOSUMDB = sum.golang.org
export GOTOOLCHAIN = go$(GOLANG_VERSION)

help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

Expand Down Expand Up @@ -76,11 +79,6 @@ docker-buildx: check-env test
docker-build: check-env test
docker build --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg ARCH=$(GOARCH) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) . -t ${IMAGE}


# Build the docker image with buildx and no tests
docker-buildx-no-test:
docker buildx build --platform=$(PLATFORM) -t $(IMAGE)_$(GOARCH) --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg $(GOARCH) --load .

# Push the docker image
docker-push: check-env
docker push ${IMAGE}
Expand Down
1 change: 0 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ resources:
version: v1beta1
- api:
crdVersion: v1
controller: true
domain: k8s.aws
group: vpcresources
kind: CNINode
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

Controller running on EKS Control Plane for managing Branch & Trunk Network Interface for [Kubernetes Pod](https://kubernetes.io/docs/concepts/workloads/pods/) using the [Security Group for Pod](https://docs.aws.amazon.com/eks/latest/userguide/security-groups-for-pods.html) feature and IPv4 Address Management(IPAM) of [Windows Nodes](https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html).

The controller broadcasts its version to nodes. Describing any node will provide the version information in node `Events`. The mapping between the controller's version and the cluster's platform version is also available in release notes. Please be aware that kubernetes events last for one hour in general and you may have to check the version information events in newly created nodes.

Version events example:
```
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ControllerVersionNotice 2m58s vpc-resource-controller The node is managed by VPC resource controller version v1.4.9
Normal NodeTrunkInitiated 2m55s vpc-resource-controller The node has trunk interface initialized successfully
```
The controller broadcasts its version to nodes. Describing any node will provide the version information in node `Events`. The mapping between the controller's version and the cluster's platform version is also available in release notes.

## Security Group for Pods

Expand Down
2 changes: 0 additions & 2 deletions apis/vpcresources/v1alpha1/cninode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ type Feature struct {
// CNINodeSpec defines the desired state of CNINode
type CNINodeSpec struct {
Features []Feature `json:"features,omitempty"`
// Additional tag key/value added to all network interfaces provisioned by the vpc-resource-controller and VPC-CNI
Tags map[string]string `json:"tags,omitempty"`
}

// CNINodeStatus defines the managed VPC resources.
Expand Down
8 changes: 0 additions & 8 deletions apis/vpcresources/v1alpha1/zz_generated.deepcopy.go

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

1 change: 0 additions & 1 deletion apis/vpcresources/v1beta1/zz_generated.deepcopy.go

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

31 changes: 15 additions & 16 deletions config/crd/bases/vpcresources.k8s.aws_cninodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: cninodes.vpcresources.k8s.aws
spec:
group: vpcresources.k8s.aws
Expand All @@ -27,20 +26,26 @@ spec:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: 'Important: Run "make" to regenerate code after modifying
this file CNINodeSpec defines the desired state of CNINode'
description: |-
Important: Run "make" to regenerate code after modifying this file
CNINodeSpec defines the desired state of CNINode
properties:
features:
items:
Expand All @@ -56,12 +61,6 @@ spec:
type: string
type: object
type: array
tags:
additionalProperties:
type: string
description: Additional tag key/value added to all network interfaces
provisioned by the vpc-resource-controller and VPC-CNI
type: object
type: object
status:
description: CNINodeStatus defines the managed VPC resources.
Expand Down
96 changes: 50 additions & 46 deletions config/crd/bases/vpcresources.k8s.aws_securitygrouppolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: securitygrouppolicies.vpcresources.k8s.aws
spec:
group: vpcresources.k8s.aws
Expand All @@ -29,48 +28,53 @@ spec:
description: Custom Resource Definition for applying security groups to pods
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: SecurityGroupPolicySpec defines the desired state of SecurityGroupPolicy
properties:
podSelector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
description: |-
A label selector is a label query over a set of resources. The result of matchLabels and
matchExpressions are ANDed. An empty label selector matches all objects. A null
label selector matches no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
Expand All @@ -83,13 +87,13 @@ spec:
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
securityGroups:
description: GroupIds contains the list of security groups that will
be applied to the network interface of the pod matching the criteria.
Expand All @@ -104,33 +108,33 @@ spec:
type: array
type: object
serviceAccountSelector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
description: |-
A label selector is a label query over a set of resources. The result of matchLabels and
matchExpressions are ANDed. An empty label selector matches all objects. A null
label selector matches no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
Expand All @@ -143,13 +147,13 @@ spec:
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
type: object
served: true
Expand Down
4 changes: 0 additions & 4 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: controller-role
rules:
- apiGroups:
Expand Down Expand Up @@ -61,8 +60,6 @@ rules:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- vpcresources.k8s.aws
Expand All @@ -76,7 +73,6 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: controller-role
namespace: kube-system
rules:
Expand Down
Loading
Loading