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

ACK Lambda and LogGroup Adopted resources default tags not getting updated #2163

Open
swapnachagam opened this issue Sep 4, 2024 · 13 comments
Labels
service/cloudwatchlogs Indicates issues or PRs that are related to cloudwatchlogs-controller. service/lambda Indicates issues or PRs that are related to lambda-controller.

Comments

@swapnachagam
Copy link

swapnachagam commented Sep 4, 2024

Describe the bug
I am trying to adopt the existing Lambda function and LogGroup along with IAM Roles, Policies and s3 Buckets for my project.
All the resources except lambda and loggroup have below default tags added as soon as ACK Controllers adopted them

Expected tags post ACK adoption
services.k8s.aws/controller-version
services.k8s.aws/namespace
 

Steps to reproduce

Manifest of the adopted resource

apiVersion: cloudwatchlogs.services.k8s.aws/v1alpha1
kind: LogGroup
metadata:
  annotations:
    services.k8s.aws/adopted: 'true'
  creationTimestamp: '2024-09-04T13:21:05Z'
  finalizers:
    - finalizers.cloudwatchlogs.services.k8s.aws/LogGroup
  generation: 1
  name: dexp-c-uw2-cloudwatch-to-splunk-test
  namespace: dexp-c-aws-1234567878
  resourceVersion: '1747752'
  uid: e2226e9e-a9ec-46ee-b526-7244f8e501b1
  selfLink: >-
    /apis/cloudwatchlogs.services.k8s.aws/v1alpha1/namespaces/dexp-c-aws-123456788/loggroups/dexp-c-uw2-cloudwatch-to-splunk-test
status:
  ackResourceMetadata:
    arn: >-
      arn:aws:logs:us-west-2:12345678:log-group:/aws/kinesisfirehose/dexp-c-uw2-cloudwatch-to-splunk-test:*
    ownerAccountID: '781371715081'
    region: us-west-2
  conditions:
    - lastTransitionTime: '2024-09-04T13:24:39Z'
      message: Resource synced successfully
      reason: ''
      status: 'True'
      type: ACK.ResourceSynced
  creationTime: 1725456006295
  metricFilterCount: 0
  retentionInDays: 30
  storedBytes: 0
spec:
  name: /aws/kinesisfirehose/dexp-c-uw2-cloudwatch-to-splunk-test
  retentionDays: 30

Expected outcome
Adopted resource should have the default tags.

Environment

  • Kubernetes version
  • 1.28
  • Using EKS (yes/no), if so version? yes
  • AWS service targeted (S3, RDS, etc.) - Log Group and Lambda function
@gecube
Copy link

gecube commented Sep 4, 2024

@swapnachagam Hi! I am kindly asking you to add a proper formatting to your issue otherwise it is very difficult to read it. Particularly - indentation of logs and yamls.

@swapnachagam
Copy link
Author

sorry i only attached the manifests. I have added the formatting now..

@swapnachagam
Copy link
Author

image
Default tags i am expecting for adopted resource.

@a-hilaly a-hilaly added the service/lambda Indicates issues or PRs that are related to lambda-controller. label Sep 4, 2024
@a-hilaly
Copy link
Member

a-hilaly commented Sep 4, 2024

@swapnachagam Can you please share the manifests of the original manifests of the AoptedResource and the state of the lambda function?

For LogGroups looks like we're missing the tags logic https://github.com/aws-controllers-k8s/cloudwatchlogs-controller/blob/main/pkg/resource/log_group/hook.go

@a-hilaly a-hilaly added the service/cloudwatchlogs Indicates issues or PRs that are related to cloudwatchlogs-controller. label Sep 4, 2024
@swapnachagam
Copy link
Author

swapnachagam commented Sep 4, 2024

@a-hilaly Please find the manifest for loggroup adopted resource. I will share the lambdaFunction one shortly. I have recreate this.

Yes we don't have tags, can we add the tags to the loggroups and also for lambdaFunctions?

apiVersion: services.k8s.aws/v1alpha1 kind: AdoptedResource metadata: creationTimestamp: '2024-09-04T16:18:30Z' finalizers: - finalizers.services.k8s.aws/AdoptedResource generation: 1 name: dexp-c-uw2-kinesis-firehose-logs-transformer-test namespace: dexp-c-aws-781371715081 resourceVersion: '1770078' uid: 335f7aff-74ed-4679-960e-78e52f1f732b status: conditions: - status: 'True' type: ACK.Adopted spec: aws: nameOrID: /aws/lambda/dexp-c-uw2-KinesisFirehoseCWLogsTransformertest kubernetes: group: cloudwatchlogs.services.k8s.aws kind: LogGroup metadata: name: dexp-c-uw2-kinesis-firehose-logs-transformer-test namespace: dexp-c-aws-781371715081

@gecube
Copy link

gecube commented Sep 4, 2024

@swapnachagam again please fix formatting.

@swapnachagam
Copy link
Author

swapnachagam commented Sep 4, 2024

Uploading loggroup.txt…

I am not able to fix the formatting but i have attached the logs here as file

@gecube
Copy link

gecube commented Sep 4, 2024

apiVersion: services.k8s.aws/v1alpha1
kind: AdoptedResource
metadata:
  creationTimestamp: '2024-09-04T16:18:30Z'
  finalizers:
    - finalizers.services.k8s.aws/AdoptedResource
  generation: 1
  name: dexp-c-uw2-kinesis-firehose-logs-transformer-test
  namespace: dexp-c-aws-781371715081
  resourceVersion: '1770078'
  uid: 335f7aff-74ed-4679-960e-78e52f1f732b
status:
  conditions:
    - status: 'True'
      type: ACK.Adopted
spec:
  aws:
    nameOrID: /aws/lambda/dexp-c-uw2-KinesisFirehoseCWLogsTransformertest
  kubernetes:
    group: cloudwatchlogs.services.k8s.aws
    kind: LogGroup
    metadata:
      name: dexp-c-uw2-kinesis-firehose-logs-transformer-test
      namespace: dexp-c-aws-781371715081

I did it on your behalf :-)

@swapnachagam
Copy link
Author

swapnachagam commented Sep 4, 2024

Attaching the lambda adopted resource manifests. Thank you for the above i am still not able to properly format
lambafunction.txt

apiVersion: services.k8s.aws/v1alpha1
kind: AdoptedResource
metadata:
  creationTimestamp: '2024-09-04T16:18:30Z'
  finalizers:
    - finalizers.services.k8s.aws/AdoptedResource
  generation: 1
  name: dexp-c-uw2-kinesis-firehose-logs-transformer-test
  namespace: dexp-c-aws-12345667788
  resourceVersion: '1770078'
  uid: 335f7aff-74ed-4679-960e-78e52f1f732b
status:
  conditions:
    - status: 'True'
      type: ACK.AdoptedResource
spec:
  aws:
    nameOrID: /aws/lambda/dexp-c-uw2-KinesisFirehoseCWLogsTransformertest
  kubernetes:
    group: cloudwatchlogs.services.k8s.aws
    kind: LogGroup
    metadata:
      name: dexp-c-uw2-kinesis-firehose-logs-transformer-test
      namespace: dexp-c-aws-12345667788

One more thing I want to double check if any updates made to the resource after being adapted, will ACK controller keep track of it?

@gecube
Copy link

gecube commented Sep 4, 2024

use three

`

signs before and three signs

`

after the text - it is typical markdown.

@swapnachagam
Copy link
Author

Can i get an ETA for this issue please?

@a-hilaly
Copy link
Member

cc @aws-controllers-k8s/lambda-maintainer

@swapnachagam
Copy link
Author

I need an update for LogGroups as tags are not updated for log groups mainly. Lambda seems to be intermittent for me. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/cloudwatchlogs Indicates issues or PRs that are related to cloudwatchlogs-controller. service/lambda Indicates issues or PRs that are related to lambda-controller.
Projects
None yet
Development

No branches or pull requests

3 participants