Solved

Bug: Cluster scoped resources and labels


Userlevel 3

Saving a policy that (1) selects applications By Labels (2) has Snapshot Cluster-Scoped Resources doesn’t behave as expected.

Expected:

  1. Labels remain unchanged.
  2. Snapshot Cluster-Scoped Resources remains checked.
  3. Applications page recognizes that Cluster-Scoped Resources policy exists.

Actual:

  1. K10 adds a label k10.kasten.io/appNamespace=kasten-io-cluster to the label list.
  2. Snapshot Cluster-Scoped Resources is changed to unchecked.
  3. Applications page does not recognize that a Cluster-Scoped Resources policy exists.
  4. Policy fails even though all listed actions complete successfully.
icon

Best answer by Hagag 9 May 2022, 18:34

View original

9 comments

Userlevel 5
Badge +2

Hello @Aaron Oneal 

could you clarify and provide more details about the first 3 steps ?

for the 4th point, please share the debug logs to chekc why the policyrun fails.

 

curl -s https://docs.kasten.io/tools/k10_debug.sh |  bash;

 

Thanks

Ahmed Hagag

Userlevel 3

@Hagag, Point 4 is due to the bug reported here:

 

The other 3 bullets are easy to reproduce. As I mentioned, create a label-based policy and then check the Snapshot Cluster-Scoped Resources toggle. After you save and then edit the policy again you will see the results I mentioned.

Userlevel 5
Badge +2

@Aaron Oneal Could you please share screenshot from what are you trying to do. i did saved the policy and edited it again and nothing changed , Snapshot cluster-scoped Resources remained checked for example.

it would be great to share the k10 version as well.

Userlevel 3

@Hagag, and was it a label-based policy? This repros every time. v4.5.14.

  1. Create new policy
  2. Select Applications by Labels
  3. Add a label
  4. Check Snapshot Cluster-Scoped Resources
  5. Save policy (Create Policy button)
  6. Edit the just created policy and witness it unchecked snapshot resources and added an extra label.

 

Userlevel 3

@Hagag, have you reproduced this? I’m unclear why your question above was marked as a solution. 

Userlevel 4
Badge +2

@Hagag, have you reproduced this? I’m unclear why your question above was marked as a solution. 

Hello @Aaron Oneal .

When using the cluster-scoped option the recommended way is selecting your application by "name", if you are filtering already with label your apps , filtering cluster-scoped resources with a different label will not work.

We have a documentation regarding this where the app is selected by name:

https://docs.kasten.io/latest/usage/clusterscoped.html#snapshot-policies-for-application-and-cluster-scoped-resources

This process can be enhanced , but for now it is working as designed. I noted about this and will register a feature request to engineering so they can assess to be added in any future releases.

Regards
Fernando

Userlevel 3

While that happens to be how the policy is configured in a screenshot, there is nothing in the text that says filter by name is required. Since configuring otherwise breaks the functionality, it would be better to disable the snapshot toggle in the UI when labels are configured because it leads to this non-functional behavior. I am baffled this is considered as designed and not an obvious bug.

Userlevel 4
Badge +2

While that happens to be how the policy is configured in a screenshot, there is nothing in the text that says filter by name is required. Since configuring otherwise breaks the functionality, it would be better to disable the snapshot toggle in the UI when labels are configured because it leads to this non-functional behavior. I am baffled this is considered as designed and not an obvious bug.

Hello Aaron,

Thank you for your reply,  I will be working to update our docs to include that information regarding the filter by "name", and also it is already reported to our engineering team for future enhancements. 

Regarding working as designed, in the sense that while using label for both apps and cluster-scoped resources what K10 does it tries to add a single entry of k10.kasten.io/appNamespace: kasten-io-cluster as label that will match and select cluster scoped resources related with the app being backed up, what could help is a better information in the UI and also in our docs related to this that for now we must filter the apps by "name" while using cluster-scoped resources, because in the actual version there is no way to select both apps and cluster-scoped resources using matchLabels., that is what I will be checking with our team to update our docs.

If you would to know more about it, there is our API docs where you can check about matchLabels:

https://docs.kasten.io/latest/api/policies.html#policy-api-type.

Thank you for your cooperation to improve K10 functionalities. 

Let me know please if you have any other questions.

Fernando C.

Userlevel 4
Badge +2

While that happens to be how the policy is configured in a screenshot, there is nothing in the text that says filter by name is required. Since configuring otherwise breaks the functionality, it would be better to disable the snapshot toggle in the UI when labels are configured because it leads to this non-functional behavior. I am baffled this is considered as designed and not an obvious bug.

Hello Aaron,

Thank you for your reply,  I will be working to update our docs to include that information regarding the filter by "name", and also it is already reported to our engineering team for future enhancements. 

Regarding working as designed, in the sense that while using label for both apps and cluster-scoped resources what K10 does it tries to add a single entry of k10.kasten.io/appNamespace: kasten-io-cluster as label that will match and select cluster scoped resources related with the app being backed up, what could help is a better information in the UI and also in our docs related to this that for now we must filter the apps by "name" while using cluster-scoped resources, because in the actual version there is no way to select both apps and cluster-scoped resources using matchLabels., that is what I will be checking with our team to update our docs.

If you would to know more about it, there is our API docs where you can check about matchLabels:

https://docs.kasten.io/latest/api/policies.html#policy-api-type.

Thank you for your cooperation to improve K10 functionalities. 

Let me know please if you have any other questions.

Fernando C.

Hello @Aaron Oneal 

 

After discussing this with engineering team, the behaviour what you saw is indeed incorrect, which was probably introduced in the newer releases. We will have this issue addressed in our future releases

Thank you again for your cooperation to improve Kasten K10.

Please let me know if you have any additional questions.

Fernando C.

Comment