aws-controllers-k8s/community

FieldExport is not populating the ConfigMap

nabeelaccount opened this issue · 1 comments

Describe the bug
FieldExport is not populating the ConfigMap. I have checked the paths and they look correct. I have also noticed this message from the ack logs: "msg":"desired resource state has changed"

which is backed by this message from the dbinstance:
conditions:

  • lastTransitionTime: "2024-08-13T22:12:23Z"
    status: "False"
    type: ACK.ResourceSynced

Steps to reproduce

---
apiVersion: rds.services.k8s.aws/v1alpha1
kind: DBInstance
metadata:
  name: "postgres-db"
spec:
  allocatedStorage: 20
  dbInstanceClass: db.t4g.micro
  dbInstanceIdentifier: "postgres-db"
  engine: postgres
  engineVersion: "14"
  masterUsername: "postgres"
  masterUserPassword:
    namespace: default
    name: "postgres-password"
    key: password

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: postgres-db-conn-cm
data: {}
---
apiVersion: services.k8s.aws/v1alpha1
kind: FieldExport
metadata:
  name: postgres-db-host
spec:
  to:
    name: postgres-db-conn-cm
    kind: configmap
  from:
    path: ".status.endpoint.address"
    resource:
      group: rds.services.k8s.aws
      kind: DBInstance
      name: postgres-db
---
apiVersion: services.k8s.aws/v1alpha1
kind: FieldExport
metadata:
  name: postgres-db-port
spec:
  to:
    name: postgres-db-conn-cm
    kind: configmap
  from:
    path: ".status.endpoint.port"
    resource:
      group: rds.services.k8s.aws
      kind: DBInstance
      name: postgres-db
---
apiVersion: services.k8s.aws/v1alpha1
kind: FieldExport
metadata:
  name: postgres-db-user
spec:
  to:
    name: postgres-db-conn-cm
    kind: configmap
  from:
    path: ".spec.masterUsername"
    resource:
      group: rds.services.k8s.aws
      kind: DBInstance
      name: postgres-db

Expected outcome
I expect the FieldExport to populate the configmap with the correct values from the specified keys/path.

Environment
prod

Logs
{"level":"info","ts":"2024-08-13T22:12:54.593Z","logger":"ackrt","msg":"updated resource","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3}
{"level":"info","ts":"2024-08-13T22:13:24.840Z","logger":"ackrt","msg":"desired resource state has changed","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3,"diff":[{"Path":{"Parts":["Spec","CACertificateIdentifier"]},"A":null,"B":"rds-ca-rsa2048-g1"},{"Path":{"Parts":["Spec","StorageThroughput"]},"A":null,"B":0}]}
{"level":"info","ts":"2024-08-13T22:13:25.729Z","logger":"ackrt","msg":"updated resource","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3}
{"level":"info","ts":"2024-08-13T22:13:55.984Z","logger":"ackrt","msg":"desired resource state has changed","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3,"diff":[{"Path":{"Parts":["Spec","CACertificateIdentifier"]},"A":null,"B":"rds-ca-rsa2048-g1"},{"Path":{"Parts":["Spec","StorageThroughput"]},"A":null,"B":0}]}
{"level":"info","ts":"2024-08-13T22:13:57.023Z","logger":"ackrt","msg":"updated resource","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3}
{"level":"info","ts":"2024-08-13T22:14:27.289Z","logger":"ackrt","msg":"desired resource state has changed","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3,"diff":[{"Path":{"Parts":["Spec","CACertificateIdentifier"]},"A":null,"B":"rds-ca-rsa2048-g1"},{"Path":{"Parts":["Spec","StorageThroughput"]},"A":null,"B":0}]}
{"level":"info","ts":"2024-08-13T22:14:28.244Z","logger":"ackrt","msg":"updated resource","kind":"DBInstance","namespace":"default","name":"postgres-db","account":"123456789","role":"","region":"eu-west-2","is_adopted":false,"generation":3}

  • Kubernetes version:
    Client Version: v1.30.3
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.30.3-eks-2f46c53
  • Using EKS (yes/no), if so version?: Yes. 1.30
  • AWS service targeted (S3, RDS, etc.) RDS

This is how the ACK was created:

resource "helm_release" "ack_rds" {
  name             = "ack-rds"
  namespace        = "kube-system"
  repository       = "oci://public.ecr.aws/aws-controllers-k8s"
  chart            = "rds-chart"
  version          = "1.4.3"
  create_namespace = false
  
  set {
    name  = "aws.region"
    value = var.region
  }

  set {
    name  = "serviceAccount.create"
    value = "false"
  }

  set {
    name  = "serviceAccount.name"
    value = kubernetes_service_account.ack_rds.metadata[0].name
  }
}