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

Deploy custom policy as part of cluster deployment #345

Merged
merged 10 commits into from
Sep 19, 2022

Conversation

ulkeba
Copy link
Contributor

@ulkeba ulkeba commented Sep 15, 2022

PR contains:

  • Motivation to deploy a custom policy (Ingress hosts must have a well-defined domain suffix.)
  • Code to deploy the custom policy using Azure Policy.
  • Validation procedure, illustrating how creation of a violating resource will be rejected.

@ulkeba
Copy link
Contributor Author

ulkeba commented Sep 15, 2022

I decided for a Base64-coded specification of the Gatekeeper policy. The advantage is that the bicep is self-containing and we do not have a dependency of an external file we'd need to download from a GitHub repository. The disadvantage is that users cannot really read it.

We could (a) leave it like that, (b) commit the policy into the repository (for reference only) and link in the explanation, (c) replace the encoding with the URL to the (readable) spec.

Any thoughts on this?

Copy link
Member

@ckittel ckittel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is great, @ulkeba. THANK YOU. Can you consider my suggestions below?

08-workload-prerequisites.md Outdated Show resolved Hide resolved
cluster-stamp.bicep Outdated Show resolved Hide resolved
cluster-stamp.bicep Outdated Show resolved Hide resolved
11-validation.md Outdated Show resolved Hide resolved
11-validation.md Outdated Show resolved Hide resolved
cluster-stamp.bicep Outdated Show resolved Hide resolved
cluster-stamp.bicep Outdated Show resolved Hide resolved
cluster-stamp.bicep Outdated Show resolved Hide resolved
@ulkeba
Copy link
Contributor Author

ulkeba commented Sep 19, 2022

I decided for a Base64-coded specification of the Gatekeeper policy. The advantage is that the bicep is self-containing and we do not have a dependency of an external file we'd need to download from a GitHub repository. The disadvantage is that users cannot really read it.

We could (a) leave it like that, (b) commit the policy into the repository (for reference only) and link in the explanation, (c) replace the encoding with the URL to the (readable) spec.

Any thoughts on this?

Any thoughts on this? ☝️

@ckittel
Copy link
Member

ckittel commented Sep 19, 2022

Any thoughts on this? ☝️

I have no problem with it base64 encoded like you have it, without having to maintain a shadow copy. I was going to link to a base64 decoder in a comment, but didn't see any that MSFT owned publicly so I passed on that. If you wanted to give the user a hint, you can add a comment that says the body is base64 encoded, and if they wish to view it, to open it in a decoder. But I wouldn't worry about it.

@ckittel
Copy link
Member

ckittel commented Sep 19, 2022

Looks like there are some merge conflicts @ulkeba -- if you can address those, and if you wanted to do any suggestions for the user to check out a decoder for the contents, then we'd be good to go with this.

Copy link
Member

@ckittel ckittel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thank you, @ulkeba!

@ckittel ckittel merged commit 5d97ee0 into mspnp:main Sep 19, 2022
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.

None yet

2 participants