Skip to content

Commit e20e081

Browse files
add logs about the vpc values fetched by the controller
1 parent 3a0ebce commit e20e081

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/deploy/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You can set the IMDSv2 as follows:
3737
aws ec2 modify-instance-metadata-options --http-put-response-hop-limit 2 --http-tokens required --region <region> --instance-id <instance-id>
3838
```
3939

40-
Instead of depending on IMDSv2, you can specify the AWS Region via the controller flag `--aws-region`, and the AWS VPC via controller flag `--aws-vpc-id` or by specifying vpc tags via the flag `--aws-vpc-tags` and an optional flag `--aws-vpc-tag-key` if you have a different key for the tag other than "Name".
40+
Instead of depending on IMDSv2, you can specify the AWS Region via the controller flag `--aws-region`, and the AWS VPC via controller flag `--aws-vpc-id` or by specifying vpc tags via the flag `--aws-vpc-tags` and an optional flag `--aws-vpc-tag-key` if you have a different key for the tag other than "Name". Note that if you specify flags `--aws-vpc-id` and `--aws-vpc-tags`, then value given `--aws-vpc-id` will be taken by controller.
4141

4242
## Configure IAM
4343

pkg/aws/cloud.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/aws/aws-sdk-go/aws/endpoints"
1212
"github.com/aws/aws-sdk-go/aws/session"
1313
"github.com/aws/aws-sdk-go/service/ec2"
14+
"github.com/go-logr/logr"
1415
"github.com/pkg/errors"
1516
"github.com/prometheus/client_golang/prometheus"
1617
amerrors "k8s.io/apimachinery/pkg/util/errors"
@@ -131,7 +132,10 @@ func NewCloud(cfg CloudConfig, metricsRegisterer prometheus.Registerer) (Cloud,
131132
}
132133

133134
func getVpcID(cfg CloudConfig, ec2Service services.EC2, metadata services.EC2Metadata) (string, error) {
135+
136+
logger := logr.Logger{}
134137
if cfg.VpcID != "" {
138+
logger.V(1).Info("vpcid is specified using flag --aws-vpc-id, controller will use the value %s", cfg.VpcID)
135139
return cfg.VpcID, nil
136140
}
137141

0 commit comments

Comments
 (0)