Closed tidusete closed 6 months ago
Soft ownership, which uses the name-linking, isn't the easiest way to create the object graph for objects from providers. ownerReferences are used by clusterctl move
for most objects AFAIK. Does the cluster-identity-secret
have any ownerReferences?
No, it doesn't have any relation. Maybe a better definition of a cluster-identity-secret could be really useful. I have been reading and trying to understand better the following documentation but I think is a little poor. https://capz.sigs.k8s.io/topics/multitenancy.html
It might be good to bring this up over at https://github.com/kubernetes-sigs/cluster-api-provider-azure for the real experts :slightly_smiling_face: You'll probably get better input on the definition of the secret - and the issues with clusterctl move
over on that repo.
I also was trying to follow this documentation but again no luck with it... https://release-1-2.cluster-api.sigs.k8s.io/clusterctl/provider-contract.html?highlight=clusterctl%20move#move
/triage support might be we can improve the error message above, but the scope of soft ownership detection has always been limited to cluster certificates, and this is re-enforced by https://github.com/kubernetes-sigs/cluster-api/blob/610b27ce5c884dd1c1221e80124f87dabd460e69/util/secret/secret.go#L63-L70 which accepts only well-known purposes/suffix for the secret name.
Also, as far as I remember the discussion about cluster identity:
And, given that we are talking about credential, there is also a security concern about including this info in the scope of clusterctl move --to-directory as suggested above.
Said that
clusterctl move offers some tools that can be used also in this case, like applying the force-move label to specific objects (the secret in this case), but this works only if the objects are in the same namespace being moved; more info in https://cluster-api.sigs.k8s.io/clusterctl/provider-contract.html#move.
Last but not least, please be aware that clusterctl move has been designed for the bootstrap/pivot scenario only (https://cluster-api.sigs.k8s.io/clusterctl/commands/move.html#warning-1), and for this use case we do not expect complex setup of cloud credentials
@fabriziopandini: The label(s) triage/support
cannot be applied, because the repository doesn't have them.
/triage accepted
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
/triage accepted
(org members only)/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted
/priority backlog
/remove-kind bug /close due to lack of updates; the explanation + alternatives is provided in https://github.com/kubernetes-sigs/cluster-api/issues/7936#issuecomment-1403787220
@fabriziopandini: Closing this issue.
What steps did you take and what happened:
As you can see, I would like to move the secret "cluster-identity-secret-"
What did you expect to happen: To not exclude the secret since its linked with the cluster that i'm doing the move. I would like to have on my testing_backup directory the secret resource cluster-identity-secret-" + all the files that are actually being moved.
Anything else you would like to add: Yes, I tried to debug a little bit and I believe the utility secretutil.ParseSecretName is not working properly since I'm always on the error condition. https://github.com/kubernetes-sigs/cluster-api/blob/d87a39c85f87f60858c578feaf5192d5679a140e/cmd/clusterctl/client/cluster/objectgraph.go#L434 I tried to check the
util/secret/secret.go
and I think that there is a misunderstood between the varsclusterName
purposeSuffix
and possibly theallSecretPurposes
which is defined on theutil/secret/consts.go
https://github.com/kubernetes-sigs/cluster-api/blob/314d98e0141489e2ac7a2915c66628ad2f22d006/util/secret/secret.go#L58Do we have a standard name convention for the resources that are being created? The reason is because when I launch
kubectl --kubeconfig ~/.kube/$(management_cluster) get secrets -n $(target_cluster)
I have the following output:When I launch
clusterctl move
and i'm checking what I have inside theallSecretPurposes
,clusterName
,purposeSuffix
. I have the following values using 2 different resources:Environment:
kubectl version
): v1.24.6/etc/os-release
):/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]