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

ConfigMap/Secret Field Manager Issues #755

Open
reedptaylor opened this issue Aug 31, 2023 · 1 comment
Open

ConfigMap/Secret Field Manager Issues #755

reedptaylor opened this issue Aug 31, 2023 · 1 comment

Comments

@reedptaylor
Copy link

Operating system

Windows 11, Ubuntu 22.04.2

Kluctl Version

2.20.8

Kubernetes Version

v1.25.11

kubectl Version

v1.27.3

Bug description

It seems that there is an issue that can cause the field manager on server side apply for ConfigMaps and Secrets to not switch to kluctl when the key is added to the kluctl deployment, but the value is unchanged. See steps below for how to reproduce.

Suggestions:

  • If possible, change the field manager to kluctl whenever a key is added to the deployment for a ConfigMap/Secret even if the value is unchanged from what it was before.
  • Add a warning either
    • When removing an unchanged key from the deployment
    • When a ConfigMap/Secret contains keys unmanaged by kluctl
  • Add an option for ConfigMap/Secret to fully sync the data with the kluctl deployment

Steps to reproduce

  1. Create and deploy a kluctl deployment with a ConfigMap or Secret with any number of keys
  2. Manually edit the ConfigMap/Secret using a tool such as kubectl edit and add 2 new keys.
  3. Add the keys from step 2 to your kluctl deployment while leaving the value of one of the keys the same and changing the value of the other. Apply the changes.
  4. Remove the keys from step 2 from your kluctl deployment and apply the changes.

Only the key that was changed is removed even though both were included in the deployment and then removed.

Relevant log output

No response

@shirkevich
Copy link
Contributor

shirkevich commented Sep 21, 2023

Was having the same issue, when there is a managedFields created by kubectl-edit it prevents kluctl to fully own the object. It can change it, but will not delete it.

  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:iam.gke.io/gcp-service-account: {}
          f:kluctl.io/deployment-item-dir: {}
        f:labels:
          f:app.kubernetes.io/component: {}
          ...
    manager: kluctl
    operation: Apply
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:iam.gke.io/gcp-service-account: {}
    manager: kubectl-edit
    operation: Update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants