Skip to content

Conversation

jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Oct 21, 2024

Description

This documents KEP-3962 for the alpha release of the enhancement in 1.32.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 21, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign reylejano for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Oct 21, 2024
@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Oct 21, 2024
Copy link

netlify bot commented Oct 21, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit c3b3e7c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/671669e490b2dc0008e8b836
😎 Deploy Preview https://deploy-preview-48467--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

@jpbetz, we should consider setting the dev-1.32 branch as the target branch rather than the main branch for this pull request. Since the change is related to the feature targeting alpha in 1.32.

@chanieljdan
Copy link
Contributor

chanieljdan commented Oct 23, 2024

Link to KEP: kubernetes/enhancements#3962

@sftim
Copy link
Contributor

sftim commented Oct 27, 2024

Hi. Please rebase this against dev-1.32, squashing to a small number of commits, and set the base branch for this PR to dev-1.32.

The main branch is our live documentation.

@sftim
Copy link
Contributor

sftim commented Oct 27, 2024

/milestone 1.32

@k8s-ci-robot k8s-ci-robot added this to the 1.32 milestone Oct 27, 2024
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. If this is not yet ready for review, you are welcome to mark it as draft so we can be sure that you're still working on it.


{{< feature-state state="alpha" for_k8s_version="v1.32" >}}

This page provides an overview of Mutating Admission Policy.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This page provides an overview of Mutating Admission Policy.
This page provides an overview of _MutatingAdmissionPolicies_ in Kubernetes.

Extra credit: update the ValidatingAdmissionPolicies page to align that one with this (and, more importantly, align both with our style guide).


<!-- overview -->

{{< feature-state state="alpha" for_k8s_version="v1.32" >}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please refer to a feature gate by name. Also see https://kubernetes.io/docs/contribute/new-content/new-features/#ready-for-review-feature-gates for how to add the associated feature gate description and metadata.

{{< feature-state feature_gate_name="ExampleFeatureGate" >}}

something like this.


<!-- body -->

## What is Mutating Admission Policy?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## What is Mutating Admission Policy?
## What are MutatingAdmissionPolicies?


## What is Mutating Admission Policy?

Mutating admission policies offer a declarative, in-process alternative to mutating admission webhooks.
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than compare them to another feature, at beta and beyond these docs should explain what MutatingAdmissionPolicies are and do. The docs we write should make sense even if we were to deprecate or even remove admission webhooks (we won't, but please use that thought experiment as a guide).


Mutating admission policies use the Common Expression Language (CEL) to declare mutations to resources.
Mutations can be defined either with an *apply configuration* that is merged using the
[server side apply merge strategy](https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy)
Copy link
Contributor

Choose a reason for hiding this comment

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

Per the style guide, use site relative hyperlinks.

Mutating admission policies are highly configurable, enabling policy authors to define policies
that can be parameterized and scoped to resources as needed by cluster administrators.

## What Resources Make a Policy
Copy link
Contributor

Choose a reason for hiding this comment

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

Per the style guide, write headings in sentence case.

Comment on lines +37 to +39
- A `MutatingAdmissionPolicyBinding` links the above resources together and provides scoping.
If you only want to set an `owner` label for `Pods`, the binding is where you would
specify this mutation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Per the style guide, drop the backticks on MutatingAdmissionPolicyBinding and Pods.

specify this mutation.

- A parameter resource provides information to a `MutatingAdmissionPolicy` to make it a concrete
statement (think "set the `owner` label to something that ends in `.company.com`").
Copy link
Contributor

Choose a reason for hiding this comment

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

Use an example domain, such as company.example.


## Getting Started with Mutating Admission Policy

TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

Write this. You can also shift this part to a post-release blog article.

Comment on lines +2 to +7
reviewers:
- deads2k
- sttts
- cici37
title: Mutating Admission Policy
content_type: concept
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally (will have to happen post release) we also add the metadata to place API reference links here. Have a look at the concept page for Deployment to get an idea of what I mean (both source code and the rendered page).

Nice to have for alpha, but not required until beta.

@jpbetz jpbetz changed the base branch from main to dev-1.32 November 5, 2024 16:28
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 5, 2024
@Jefftree
Copy link
Member

Jefftree commented Nov 5, 2024

superseded by #48646. Will address @sftim's comments in that PR

/close

@k8s-ci-robot
Copy link
Contributor

@Jefftree: Closed this PR.

In response to this:

superseded by #48646. Will address @sftim's comments in that PR

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants