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

Unable to delete DBInstance in AWS using deletion policy delete on my DBInstance CRD #2046

Open
ferozemohideen opened this issue Mar 22, 2024 · 1 comment
Labels
area/deletion-policy Issues or PRs related to deletion policy. kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.

Comments

@ferozemohideen
Copy link

Describe the bug
I am installing my RDS controller using https://github.com/aws-controllers-k8s/ack-chart (image: public.ecr.aws/aws-controllers-k8s/rds-controller:1.2.1) with the following values:

rds:
  enabled: true
  deployment:
    replicas: 1
  aws:
    region: us-east-1 
  deletionPolicy: retain
  resources:
    requests:
      memory: "64Mi"
      cpu: "50m"
    limits:
      memory: "128Mi"
      cpu: "100m"

I include deletionPolicy: retain for general safety. I provision a DBInstance using the following file:

apiVersion: rds.services.k8s.aws/v1alpha1
kind: DBInstance
metadata:
  name: "test-db"
  namespace: "<aws-account-id>"
  annotations:
    services.k8s.aws/region: "<aws-region>"
spec:
  dbInstanceClass: db.t4g.medium
  dbInstanceIdentifier: "test-db"
  engine: postgres
  engineVersion: "15.3"
  allocatedStorage: 30
  masterUsername: postgres
  masterUserPassword:
    namespace: default
    name: "test-secret"
    key: password

I would like to override the deletion policy on the controller, such that when I delete this DBInstance, it deletes the resource in AWS. Based on these docs, I tried adding a services.k8s.aws/deletion-policy: delete annotation on by DBInstance CRD first, then deleting it, but doing so still does not clean up the DBInstance in AWS.

I was able to achieve the behavior I desired by restarting the RDS controller after I add the annotation, and then deleting, after which I saw the resource delete in AWS. I believe the bug here is that the CRD does not immediately reconcile after I add this annotation.

Steps to reproduce
Install the chart
Expected outcome
A concise description of what you expected to happen.

Environment

  • Kubernetes version
    1.24
  • Using EKS (yes/no), if so version?
    yes, 1.24
  • AWS service targeted (S3, RDS, etc.)
    RDS
@a-hilaly a-hilaly added kind/bug Categorizes issue or PR as related to a bug. area/deletion-policy Issues or PRs related to deletion policy. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Mar 23, 2024
@ack-bot
Copy link
Collaborator

ack-bot commented Sep 21, 2024

Issues go stale after 180d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 60d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale

@ack-prow ack-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deletion-policy Issues or PRs related to deletion policy. kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
Development

No branches or pull requests

3 participants