Skip to content

Sample YAML Script for Creation of Secrets in GCP #655

Closed

Description

@vivek725k

Hi Team,

please find the below query and help us to solve the error-

Bug Description##

Log Output

YAML snippets

apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
kind: SecretManagerSecret
metadata:
name: secretforpubsub
spec:
expireTime: 2022-12-30T12:30:00Z
replication:
userManaged:
replicas:

  • customerManagedEncryption:
    kmsKeyRef:
    name: todayskeyforsecret
    location: us-central1
    rotation:
    nextRotationTime: 2022-04-29T12:30:00Z
    rotationPeriod: 2592000s
    topics:
  • name: dep-pubsubtopic

Activity

  1. jcanseco commented on Apr 26, 2022

    @jcanseco
    Member

    Hi @vivek725k, can we ask you to fill out the bug template more completely? The details we ask there are critical for helping us understand and resolve your problem.

    In particular, can you share with us what error you're seeing?

  2. Vanditha-V-R commented on Apr 27, 2022

    @Vanditha-V-R

    @jcanseco
    /g.co/cloud/acm-errorsknv1067 KNV2009: failed to apply Secret ManagerSecret.secretmanager.cnrm.cloud.google.com, 2. topics: expected list, got & {map[name: dep-pubsubtopici]

  3. jcanseco commented on Apr 27, 2022

    @jcanseco
    Member

    @Vanditha-V-R it looks like your spec.replicas.topics field should have a list value, not an object value.

    i.e.

    spec:
      replicas:
        topics:
          - name: dep-pubsubtopic
    

    Also, in the future, can you please send us properly formatted YAML snippets? It makes it very difficult to debug issues when the YAML snippets are not formatted properly. Thank you.

  4. Vanditha-V-R commented on Apr 28, 2022

    @Vanditha-V-R

    @jcanseco
    Please check below code. which we have tried to create secrets.
    apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
    kind: SecretManagerSecret
    metadata:
    name: secrettest # name of the secret
    namespace: config-control # kpt-set: ${namespace}
    annotations:
    cnrm.cloud.google.com/project-id: blueprints-project # kpt-set: ${project-id}
    labels:
    replication-type: user-managed # type of replication
    spec:
    expireTime: 2022-12-30T12:30:00Z # Expiration in date time format
    replication:

    choose google managed or customer managed encryption

    userManaged:
      replicas:
      - customerManagedEncryption:
          kmsKeyRef:
            name: kmskeytest # Name of the key used for encryption
        # location where secret has to be created
        location: us-central1 # kpt-set: ${region}
    

    rotation:
    nextRotationTime: 2022-04-30T12:30:00Z
    rotationPeriod: 2592000s
    topics:

    • external: cloudfunctionsfunction-dep-pubsubtopic #also we tried attaching complete ID
  5. jcanseco commented on Apr 28, 2022

    @jcanseco
    Member

    Hi @Vanditha-V-R, can you elaborate on what the issue is? For example, what is the error message?

  6. Vanditha-V-R commented on Apr 29, 2022

    @Vanditha-V-R

    @jcanseco
    i have updated same error in earlier comment as well. posting again. is this possible to provide YAML template for secret creation in GCP

    /g.co/cloud/acm-errorsknv1067 KNV2009: failed to apply Secret ManagerSecret.secretmanager.cnrm.cloud.google.com, 2. topics: expected list, got & {map[name: dep-pubsubtopici]

  7. Vanditha-V-R commented on Apr 29, 2022

    @Vanditha-V-R

    apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
    kind: SecretManagerSecret
    metadata:
    name: secrettest # name of the secret
    namespace: config-control # kpt-set: ${namespace}
    annotations:
    cnrm.cloud.google.com/project-id: blueprints-project # kpt-set: ${project-id}
    labels:
    replication-type: user-managed # type of replication
    spec:
    expireTime: 2022-12-30T12:30:00Z # Expiration in date time format
    replication:

    choose google managed or customer managed encryption

    userManaged:
      replicas:
      - customerManagedEncryption:
          kmsKeyRef:
            name: kmskeytest # Name of the key used for encryption
        # location where secret has to be created
        location: us-central1 # kpt-set: ${region}
    

    rotation:
    nextRotationTime: 2022-04-30T12:30:00Z
    rotationPeriod: 2592000s
    topics:

    • external: cloudfunctionsfunction-dep-pubsubtopic #also we tried attaching complete ID
  8. jcanseco commented on Apr 29, 2022

    @jcanseco
    Member

    Hi @Vanditha-V-R, please format your YAML. We cannot determine what the issue is without proper YAML formatting.

    See "YAML snippets" in #623 for example.

  9. Vanditha-V-R commented on May 2, 2022

    @Vanditha-V-R

    apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
    kind: SecretManagerSecret
    metadata:
    name: prodsecret
    namespace: config-control # kpt-set: ${namespace}
    annotations:
    cnrm.cloud.google.com/project-id: blueprints-project # kpt-set: ${project-id}
    labels:
    replication-type: user-managed
    spec:
    expireTime: 2022-12-30T12:30:00Z
    replication:
    userManaged:
    replicas:
    - customerManagedEncryption:
    kmsKeyRef:
    name: todayskeyforsecret
    location: us-central1
    rotation:
    nextRotationTime: 2022-05-29T12:30:00Z
    rotationPeriod: 2592000s
    topics:

    • name: pubsubtopic12

    apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
    kind: PubSubTopic
    metadata:
    name: pubsubtopic12
    namespace: mig-test-2
    annotations:
    cnrm.cloud.google.com/project-id: "project-id" # kpt-set: ${project-id}

  10. Vanditha-V-R commented on May 2, 2022

    @Vanditha-V-R

    @jcanseco
    formatting is not taking place here. is there any alternative solution to address this issue

  11. jcanseco commented on May 2, 2022

    @jcanseco
    Member

    @Vanditha-V-R please refer to this guide on how to display code blocks in GitHub comments.

  12. Vanditha-V-R commented on May 3, 2022

    @Vanditha-V-R

    @jcanseco : pls look in to this
    apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1

    kind: SecretManagerSecret

    metadata:

    name: prodsecret

    namespace: config-control # kpt-set: ${namespace}

    annotations:

    cnrm.cloud.google.com/project-id: blueprints-project # kpt-set: ${project-id}
    

    labels:

    replication-type: user-managed
    

    spec:

    expireTime: 2022-12-30T12:30:00Z

    replication:

    userManaged:
    
      replicas:
    
      - customerManagedEncryption: 
    
          kmsKeyRef:
    
            name: todayskeyforsecret
    
        location: us-central1
    

    rotation:

    nextRotationTime: 2022-05-29T12:30:00Z
    
    rotationPeriod: 2592000s
    

    topics:

    • name: pubsubtopic12
  13. jcanseco commented on May 4, 2022

    @jcanseco
    Member

    @Vanditha-V-R Again, please format your entire YAML. It is very difficult to determine what you're actually applying if you give us unformatted YAML.

    Also, have you tried kubectl apply-ing your SecretManagerSecret resource directly? The error message you're seeing is coming from Config Sync (KNV2009) -- can you check if using just Config Connector works?

  14. Vanditha-V-R commented on May 4, 2022

    @Vanditha-V-R
  15. jcanseco commented on May 4, 2022

    @jcanseco
    Member

    Great thank you. We would have preferred formatted text, but this is good enough for now since it's not too long.

    Let us try to reproduce the issue then.

  16. caieo commented on May 9, 2022

    @caieo
    Contributor

    @Vanditha-V-R, I was able to reproduce your issue. The field in question that is causing this error is spec.topics. We're looking into why this is occurring and do not currently have a workaround for you at the moment.

  17. caieo commented on May 11, 2022

    @caieo
    Contributor

    @Vanditha-V-R, I've identified the bug causing this issue and have a fix going through review. Once it's merged, it will be included in next week's release.

  18. caieo commented on Jun 27, 2022

    @caieo
    Contributor

    @Vanditha-V-R, we released a fix in 1.85.0, please give it a try. I'm going to go ahead and close this issue for now, but if you still run into this issue or have any other issues, please feel free to re-open or file another bug!

  19. Vanditha-V-R commented on Jun 28, 2022

    @Vanditha-V-R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址