-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: Creating Gardener Cluster CR as part of cluster provisioning #293
Conversation
imv1.LabelKymaShootName: shoot.Name, | ||
|
||
// hardcoded values | ||
imv1.LabelKymaManagedBy: "lifecycle-manager", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imv1.LabelKymaManagedBy: "lifecycle-manager", | |
imv1.LabelKymaManagedBy: "infrastructure-manager", |
KEB sets that currently to lifecycle-manager
which is wrong. KIM is managing this resource. It should be set to infrastructure-manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
}, | ||
), | ||
Entry( | ||
"should return sFnUpdateStatus and no error when CR has been created without finalizer - Add finalizer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entry says that it should return sFnUpdateStatus
while matcher is MatchNextFnState: BeNil(),
api/v1/runtime_types.go
Outdated
LabelKymaRuntimeID = "kyma-project.io/runtime-id" | ||
LabelKymaShootName = "kyma-project.io/shootName" | ||
LabelKymaRegion = "kyma-project.io/region" | ||
LabelKymaName = "kyma-project.io/kyma-name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KEB had label key operator.kyma-project.io/kyma-name
(with operator.
). Was it intended to be different in KIM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verification update
While the Runtime CR is described as:
I would expect the following instead:
Attaching logs from the last 2 reconciliations (the one where GardenerCluster CR was created, and the next one that resulted in error) 2024-07-18T14:10:14+02:00 INFO Reconciling Runtime {"Name": "kim-md2", "Namespace": "kcp-system"}
2024-07-18T14:10:14+02:00 INFO reqID 36 Take snapshot state
2024-07-18T14:10:14+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnTakeSnapshot to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnInitialize {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:14+02:00 INFO reqID 36 Gardener shoot exists, processing
2024-07-18T14:10:14+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnInitialize to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnSelectShootProcessing {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:14+02:00 INFO reqID 36 Select shoot processing state
2024-07-18T14:10:14+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnSelectShootProcessing to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnWaitForShootCreation {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:14+02:00 INFO reqID 36 Waiting for shoot creation state
2024-07-18T14:10:14+02:00 INFO reqID 36 Shoot kim-md2 successfully created
2024-07-18T14:10:14+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnWaitForShootCreation to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnCreateKubeconfig {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 36 Create Gardener Cluster CR state
2024-07-18T14:10:19+02:00 INFO reqID 36 GardenerCluster CR is ready {"Name": "059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8"}
2024-07-18T14:10:19+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnCreateKubeconfig to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnUpdateStatus.func1 {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnUpdateStatus.func1 to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnEmmitEventfunc.func1 {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 36 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnEmmitEventfunc.func1 to {"result": {"Requeue":true,"RequeueAfter":0}, "err": null, "mFnIsNill": true}
2024-07-18T14:10:19+02:00 INFO reqID 36 reconciliation done {"error": null, "result": {"Requeue":true,"RequeueAfter":0}}
2024-07-18T14:10:19+02:00 DEBUG events Gardener Cluster CR is ready.: kcp-system/kim-md2 {"type": "Normal", "object": {"kind":"Runtime","namespace":"kcp-system","name":"kim-md2","uid":"fab9417d-7065-4612-bd05-ce75fce4ebf6","apiVersion":"infrastructuremanager.kyma-project.io/v1","resourceVersion":"1628"}, "reason": "GardenerClusterCRReady"}
2024-07-18T14:10:19+02:00 INFO kcp-system/kim-md2
2024-07-18T14:10:19+02:00 INFO Reconciling Runtime {"Name": "kim-md2", "Namespace": "kcp-system"}
2024-07-18T14:10:19+02:00 INFO reqID 37 Take snapshot state
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnTakeSnapshot to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnInitialize {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 Gardener shoot exists, processing
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnInitialize to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnSelectShootProcessing {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 Select shoot processing state
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnSelectShootProcessing to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnWaitForShootCreation {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 Waiting for shoot creation state
2024-07-18T14:10:19+02:00 INFO reqID 37 Shoot kim-md2 successfully created
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnWaitForShootCreation to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnCreateKubeconfig {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 Create Gardener Cluster CR state
2024-07-18T14:10:19+02:00 INFO reqID 37 GardenerCluster CR is ready {"Name": "059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8"}
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnCreateKubeconfig to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnProcessShoot {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 Process cluster state - the last one
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnProcessShoot to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnUpdateStatus.func1 {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnUpdateStatus.func1 to github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnEmmitEventfunc.func1 {"result": null, "err": null, "mFnIsNill": false}
2024-07-18T14:10:19+02:00 INFO reqID 37 switching state from github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm.sFnEmmitEventfunc.func1 to {"result": null, "err": null, "mFnIsNill": true}
2024-07-18T14:10:19+02:00 INFO reqID 37 reconciliation done {"error": null, "result": null}
2024-07-18T14:10:19+02:00 DEBUG events Runtime processing completed successfully: kcp-system/kim-md2 {"type": "Normal", "object": {"kind":"Runtime","namespace":"kcp-system","name":"kim-md2","uid":"fab9417d-7065-4612-bd05-ce75fce4ebf6","apiVersion":"infrastructuremanager.kyma-project.io/v1","resourceVersion":"1630"}, "reason": "ConfigurationCompleted"}
2024-07-18T14:16:44+02:00 INFO Starting reconciliation. {"GardenerCluster": "059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8", "Namespace": "kcp-system"}
2024-07-18T14:16:44+02:00 INFO rotation params {"GardenerCluster": "059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8", "Namespace": "kcp-system", "lastSync": "0001-01-01 00:00:00", "requeueAfter": "6m38.999999999s", "gardenerRequestTimeout": "1m0s"}
2024-07-18T14:16:45+02:00 INFO result without requeue
2024-07-18T14:16:45+02:00 ERROR Reconciler error {"controller": "gardenercluster", "controllerGroup": "infrastructuremanager.kyma-project.io", "controllerKind": "GardenerCluster", "GardenerCluster": {"name":"059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8","namespace":"kcp-system"}, "namespace": "kcp-system", "name": "059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8", "reconcileID": "c80b4051-b00d-4dba-8cf2-21051782a66f", "error": "secrets \"kubeconfig-059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8\" already exists"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/Users/i316752/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:324
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/Users/i316752/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:261
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/Users/i316752/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:222
2024-07-18T14:16:45+02:00 INFO Starting reconciliation. {"GardenerCluster": "059dbc39-fd2b-4186-b0e5-8a1bc8ede5b8", "Namespace": "kcp-system"}
|
Probably that's the fix https://github.com/koala7659/infrastructure-manager/pull/2/files. However as @koala7659 is on vacation, I will merge this PR and work on a follow-up. |
Description
Changes proposed in this pull request:
Required labels:
Testing:
Related issue(s)
#282