-
Notifications
You must be signed in to change notification settings - Fork 543
Azure check policy relaxation #6353
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
base: master
Are you sure you want to change the base?
Azure check policy relaxation #6353
Conversation
hubatish
left a comment
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.
Thanks for the fix! Hopefully this contains the errors to one spot.
| [ | ||
| FLAGS.kubectl, | ||
| '--kubeconfig', | ||
| FLAGS.kubeconfig, |
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.
Use RunKubectlCommand rather than specifying FLAGS.kubectl & FLAGS.kubeconfig.
| self._RelaxAKSPolicy() | ||
| self._GetCredentials(use_admin=False) | ||
| self._WaitForDefaultServiceAccount() | ||
| self._WaitForPolicyRelaxation() |
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.
can this go at the end after _AttachContainerRegistry? Just to save a little time waiting while the latter command runs. Or do you think AttachContainerRegistry can also run into policy errors?
Add the
_WaitForPolicyRelaxationmethod to ensure policy relaxation takes effectThe constraints for Resource Requests, Probes, and Image Tags are all part of the same "Safeguards" policy initiative and are bundled together in the Azure Policy assignment. Therefore, it is sufficient to check just one constraint. If the cluster update for the "Resource Requests" constraint is applied, the updates for "Probes" and "Image Tag" constraints are also included, as they are processed in the same transaction.
This method works by monitoring the
K8sAzureV1ContainerRequestsconstraint and waiting for its status to switch fromdenytodryrun.