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

FieldExport is not populating the ConfigMap #2135

Open
nabeelaccount opened this issue Aug 13, 2024 · 1 comment
Open

FieldExport is not populating the ConfigMap #2135

nabeelaccount opened this issue Aug 13, 2024 · 1 comment
Labels
area/field-export Issues or PRs related to Field Export kind/bug Categorizes issue or PR as related to a bug.

Comments

@nabeelaccount
Copy link

nabeelaccount commented Aug 13, 2024

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
@nabeelaccount
Copy link
Author

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
  }
}

@a-hilaly a-hilaly added kind/bug Categorizes issue or PR as related to a bug. area/field-export Issues or PRs related to Field Export labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/field-export Issues or PRs related to Field Export kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants