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

[bug] kcm controller doesn't create release and crashes if createManagement is set to false #940

Open
Algeran opened this issue Jan 22, 2025 · 4 comments · May be fixed by #996
Open

[bug] kcm controller doesn't create release and crashes if createManagement is set to false #940

Algeran opened this issue Jan 22, 2025 · 4 comments · May be fixed by #996
Assignees
Labels
bug Something isn't working

Comments

@Algeran
Copy link

Algeran commented Jan 22, 2025

Describe the bug
Deployed kcm-controller v0.0.7 with disabled default Management object creation. Controller pod fails to start, prints in logs a lot of errors and doesn't create the release object.

To Reproduce
Steps to reproduce the behavior:

  1. Values:
    controller:
      createManagement: false
    
  2. deploy kcm helm chart
  3. monitor logs and pod status, check that release object is not created

Expected behavior
Controller should start and create release kcm-0-0-7 release object

Additional context

controller.log

@Algeran Algeran added the bug Something isn't working label Jan 22, 2025
@github-project-automation github-project-automation bot moved this to Todo in k0rdent Jan 22, 2025
@Algeran Algeran changed the title [bug] kcm controller doesn't create release and crashes if createManagement and createAccessManagement are set to false [bug] kcm controller doesn't create release and crashes if createManagement is set to false Jan 22, 2025
@kylewuolle
Copy link
Contributor

I've tried with the latest code and this is now fixed:

  1. git checkout 5c0ce3213dfc2c989e9ee4efeb266d0ee34fb21b (0.0.7 tag)
  2. make kind-deploy registry-deploy dev-push
  3. helm install kcm oci://127.0.0.1:5001/charts/kcm --version 0.0.7 -n kcm-system --create-namespace --set="controller.createManagement=false" --set="image.repository=localhost/kcm/controller"
  4. I get the same error as in the issue
  5. make dev-destroy
  6. git checkout c486cd1fdcc5e9af4d68afe7c74ccce836459c5c (current main revision)
  7. make kind-deploy registry-deploy dev-push
  8. helm install kcm oci://127.0.0.1:5001/charts/kcm --version 0.0.7 -n kcm-system --create-namespace --set="controller.createManagement=false" --set="image.repository=localhost/kcm/controller"
  9. It now works as expected

@kylewuolle kylewuolle self-assigned this Jan 27, 2025
@Algeran
Copy link
Author

Algeran commented Jan 28, 2025

Hi @kylewuolle ,
I started the controller from the main revision as you described. Controller is now not crushing, but it still doesn't create release object. So, it's not possible to create any custom Management object due to it requires to specify the release name. In operator pod logs I can see a lot of errors from all internal controllers that they can't find the Management object to backup. And I think this is the reason why the release object is not created as well:

err = r.Get(ctx, client.ObjectKey{Name: kcm.ManagementName}, management)

This condition blocks reconciliation loop in all controllers. Moreover,

  1. it's not clear why it tries to backup the management object with the kcm name. I understand, that this is the default name for the Management object that is created automatically, but I can create the custom one with any name, not kcm. And it will block the reconciliation process for all CRDs that managed by the operator.
  2. Why the Release reconciliation loop includes the Management object backup logic. As far as I understand, the relation between release and management objects is inverse - you can't create and reconcile management object without fully deployed release.

@Algeran
Copy link
Author

Algeran commented Jan 28, 2025

Added the log file from the controller pod

controller.log

@zerospiel
Copy link
Contributor

zerospiel commented Jan 29, 2025

Not related actually, there is bit another kind of the problem, related either to out local dev ops or how to properly set the latest version of te kcm-templates chart

I believe the recent changes from #906 are related to the errors above

The aforementioned LOC is not related though

kylewuolle added a commit to kylewuolle/hmc that referenced this issue Jan 30, 2025
…object and the management object depends on the provider templates making it impossible to deploy kcm with the create management flag set to false. Resolves issue k0rdent#940
@kylewuolle kylewuolle moved this from Todo to In Progress in k0rdent Jan 30, 2025
kylewuolle added a commit to kylewuolle/hmc that referenced this issue Jan 31, 2025
…object and the management object depends on the provider templates making it impossible to deploy kcm with the create management flag set to false. Resolves issue k0rdent#940
kylewuolle added a commit to kylewuolle/hmc that referenced this issue Feb 3, 2025
…object and the management object depends on the provider templates making it impossible to deploy kcm with the create management flag set to false. Resolves issue k0rdent#940
kylewuolle added a commit to kylewuolle/hmc that referenced this issue Feb 4, 2025
…object and the management object depends on the provider templates making it impossible to deploy kcm with the create management flag set to false. Resolves issue k0rdent#940
kylewuolle added a commit to kylewuolle/hmc that referenced this issue Feb 5, 2025
…object and the management object depends on the provider templates making it impossible to deploy kcm with the create management flag set to false. Resolves issue k0rdent#940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants