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

Make logging for creating/deleting AWS resources consistent #3143

Closed
pydctw opened this issue Feb 3, 2022 · 3 comments · Fixed by #3144
Closed

Make logging for creating/deleting AWS resources consistent #3143

pydctw opened this issue Feb 3, 2022 · 3 comments · Fixed by #3144
Assignees
Labels
priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@pydctw
Copy link
Contributor

pydctw commented Feb 3, 2022

While reviewing e2e test output, I noticed that logging for AWS resource creation/deletion is inconsistent. Some has only creation log while others (e.g. security groups) don't have any logging.

For example, CAPA log shows that there are creation logs for subnet, IGW and NGW (note that NGW log format could be consistent) while there are more logs for deletion.

I0203 17:46:13.141806      61 subnets.go:360] controller/awscluster "msg"="created subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "az"="us-west-1a" "cidr"="10.0.0.0/19" "id"="subnet-0db9b5aaa9d04648f" "public"=true
I0203 17:46:13.696397      61 subnets.go:360] controller/awscluster "msg"="created subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "az"="us-west-1a" "cidr"="10.0.64.0/18" "id"="subnet-06be222a28b37f939" "public"=false
I0203 17:46:14.171571      61 subnets.go:360] controller/awscluster "msg"="created subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "az"="us-west-1c" "cidr"="10.0.32.0/19" "id"="subnet-03259b1fd68553458" "public"=true
I0203 17:46:14.836421      61 subnets.go:360] controller/awscluster "msg"="created subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "az"="us-west-1c" "cidr"="10.0.128.0/18" "id"="subnet-0631cc3821aaff6df" "public"=false
I0203 17:46:15.505004      61 gateways.go:133] controller/awscluster "msg"="Created internet gateway for VPC" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "vpc-id"="vpc-0b96711048cce1221"
...
I0203 17:47:47.610187      61 natgateways.go:264] controller/awscluster "msg"="NAT gateway for subnet is now available" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "nat-gateway-id"="nat-010581bb86c376774" "subnet-id"="subnet-03259b1fd68553458"
...
I0203 18:00:47.144617      61 routetables.go:195] controller/awscluster "msg"="Deleted association between route table and subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-054109ab5193ae254" "subnet-id"="subnet-0db9b5aaa9d04648f"
I0203 18:00:47.256422      61 routetables.go:204] controller/awscluster "msg"="Deleted route table" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-054109ab5193ae254"
I0203 18:00:47.456331      61 routetables.go:195] controller/awscluster "msg"="Deleted association between route table and subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-07276406fe1cfffd5" "subnet-id"="subnet-0631cc3821aaff6df"
I0203 18:00:47.574764      61 routetables.go:204] controller/awscluster "msg"="Deleted route table" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-07276406fe1cfffd5"
I0203 18:00:47.836439      61 routetables.go:195] controller/awscluster "msg"="Deleted association between route table and subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-0e97e451b8a4b0f3a" "subnet-id"="subnet-06be222a28b37f939"
I0203 18:00:47.936686      61 routetables.go:204] controller/awscluster "msg"="Deleted route table" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-0e97e451b8a4b0f3a"
I0203 18:00:48.123060      61 routetables.go:195] controller/awscluster "msg"="Deleted association between route table and subnet" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-01e08a3091f446ce9" "subnet-id"="subnet-03259b1fd68553458"
I0203 18:00:48.244579      61 routetables.go:204] controller/awscluster "msg"="Deleted route table" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "route-table-id"="rtb-01e08a3091f446ce9"
I0203 18:00:48.595773      61 natgateways.go:277] controller/awscluster "msg"="Deleted NAT gateway in VPC" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "nat-gateway-id"="nat-0d0eb80f31b3d6fed" "vpc-id"="vpc-0b96711048cce1221"
I0203 18:00:48.693270      61 natgateways.go:277] controller/awscluster "msg"="Deleted NAT gateway in VPC" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "nat-gateway-id"="nat-010581bb86c376774" "vpc-id"="vpc-0b96711048cce1221"
I0203 18:01:59.113222      61 eips.go:143] controller/awscluster "msg"="released ElasticIP" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "allocation-id"="eipalloc-054b75354308a7858" "eip"="54.151.34.33"
I0203 18:01:59.744465      61 eips.go:143] controller/awscluster "msg"="released ElasticIP" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "allocation-id"="eipalloc-0066f6d7e4af359a6" "eip"="54.241.80.115"
I0203 18:02:00.130824      61 gateways.go:104] controller/awscluster "msg"="Detached internet gateway from VPC" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "internet-gateway-id"="igw-0cfe904cb514b5ab1" "vpc-id"="vpc-0b96711048cce1221"
I0203 18:02:00.262275      61 gateways.go:116] controller/awscluster "msg"="Deleted internet gateway in VPC" "cluster"="quick-start-4j8dyg" "name"="quick-start-4j8dyg" "namespace"="quick-start-c63w4e" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" "internet-gateway-id"="igw-0cfe904cb514b5ab1" "vpc-id"="vpc-0b96711048cce1221"

This is due to some resources miss the log statement while other resources use different log level, s.scope.Info vs. s.scope.V(2).Info().

What do you expect?

CAPA should have consistent log output for AWS resources creation/deletion as it helps debugging.

@pydctw
Copy link
Contributor Author

pydctw commented Feb 3, 2022

/assign

@k8s-ci-robot
Copy link
Contributor

@pydctw: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 3, 2022
@pydctw
Copy link
Contributor Author

pydctw commented Feb 3, 2022

I think Deleted association between route table and subnet and Detached internet gateway from VPC can be moved to level 2 logging.

@sedefsavas sedefsavas added priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Feb 4, 2022
@sedefsavas sedefsavas added this to the v1.3.0 milestone Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants