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

Mark DataSecretAvailable condition to true when setting dataSecretName #16

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

mkmik
Copy link
Contributor

@mkmik mkmik commented Dec 9, 2022

Closes #15

I manually tried to edit the status subresource with the kubectl edit-status plugin and I confirm that once the DataSecretAvailable flips, then the Ready condition flips too and the cluster is fully initialized:

$ clusterctl describe cluster k3-test-2
NAME                                                          READY  SEVERITY  REASON  SINCE  MESSAGE
Cluster/k3-test-2                                             True                     143m
├─ClusterInfrastructure - AWSCluster/k3-test-2                True                     5h45m
├─ControlPlane - KThreesControlPlane/k3-test-2-control-plane  True                     143m
│ └─Machine/k3-test-2-control-plane-4s42f                     True                     5h45m
└─Workers
  └─MachineDeployment/k3-test-2-md-0                          True                     141m
    └─Machine/k3-test-2-md-0-6454966fcd-mvbnt                 True                     143m

(I still need to actually test the code by building my branch into an image and trying it out)

@mkmik
Copy link
Contributor Author

mkmik commented Dec 9, 2022

I'm trying the build of my branch in ghcr.io/mkmik/cluster-api-k3s/bootstrap-controller:v0.1.5

(I don't have a local env; so I'm trying this out in my test account on AWS)

@mkmik
Copy link
Contributor Author

mkmik commented Dec 9, 2022

nope it didn't work :-(

status:
  conditions:
  - lastTransitionTime: "2022-12-09T17:42:29Z"
    reason: WaitingForControlPlaneAvailable
    severity: Info
    status: "False"
    type: Ready
  - lastTransitionTime: "2022-12-09T17:42:29Z"
    status: "True"
    type: CertificatesAvailable
  - lastTransitionTime: "2022-12-09T17:42:29Z"
    reason: WaitingForControlPlaneAvailable
    severity: Info
    status: "False"
    type: DataSecretAvailable
  dataSecretName: k3-test-4-control-plane-q5vd4
  observedGeneration: 2
  ready: true

Ok, I think I'll have to actually read and understand the code a bit better and run the controller locally so I can iterate on it :-(

@mkmik mkmik marked this pull request as draft December 9, 2022 17:47
@mkmik mkmik marked this pull request as ready for review December 9, 2022 17:55
@zawachte
Copy link
Collaborator

zawachte commented Dec 9, 2022

nope it didn't work :-(

status:
  conditions:
  - lastTransitionTime: "2022-12-09T17:42:29Z"
    reason: WaitingForControlPlaneAvailable
    severity: Info
    status: "False"
    type: Ready
  - lastTransitionTime: "2022-12-09T17:42:29Z"
    status: "True"
    type: CertificatesAvailable
  - lastTransitionTime: "2022-12-09T17:42:29Z"
    reason: WaitingForControlPlaneAvailable
    severity: Info
    status: "False"
    type: DataSecretAvailable
  dataSecretName: k3-test-4-control-plane-q5vd4
  observedGeneration: 2
  ready: true

Ok, I think I'll have to actually read and understand the code a bit better and run the controller locally so I can iterate on it :-(

Sounds good!

A bit busy the next few days ... when I have a second, I would love to help out!

@mkmik
Copy link
Contributor Author

mkmik commented Dec 9, 2022

I ran it locally with make run-bootstrap and it worked just fine. I think it may have pushed a bad image (i.e. not the code I actually build)

@mkmik mkmik marked this pull request as draft December 9, 2022 18:01
@mkmik
Copy link
Contributor Author

mkmik commented Dec 9, 2022

no actually, it didn't work fine when I re-created the resource; it only worked when I restarted the controller after manually removing dataSecretName and ready. This means that I have to understand the state transitions and fix the bug properly.

Unfortunately it's EOD for me in this part of the world; I'll continue on Monday.

@mkmik mkmik force-pushed the fix-datasecretname-condition branch from 8c3ce3c to cf920cb Compare December 12, 2022 12:27
@mkmik mkmik marked this pull request as ready for review December 12, 2022 12:28
@mkmik
Copy link
Contributor Author

mkmik commented Dec 12, 2022

ok, turns out there were two // conditions.MarkTrue(scope.Config, bootstrapv1.DataSecretAvailableCondition) lines to uncomment.

Now I got the controlplane working. The bootstrap data secret for the worker node still doesn't work, but I think that may be another problem.

@mkmik
Copy link
Contributor Author

mkmik commented Dec 12, 2022

The issue I'm having with the workernode data secret is caused by https://github.com/zawachte/cluster-api-k3s/issues/17.

I confirm that with this PR I can get a cluster created correctly.

@zawachte
Copy link
Collaborator

@mkmik good to merge?

@mkmik
Copy link
Contributor Author

mkmik commented Dec 13, 2022

yes :shipit:

@zawachte zawachte merged commit 5feaa86 into k3s-io:main Dec 13, 2022
@mkmik mkmik deleted the fix-datasecretname-condition branch December 13, 2022 13:39
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

Successfully merging this pull request may close these issues.

Ready and DataSecretAvailable conditions are false despite there being a dataSecretName
2 participants