Coder Social home page Coder Social logo

website's Introduction

The Kyverno Website

Source for: https://kyverno.io

Accessing Earlier Documentation

The Kyverno website follows the same support policy as Kyverno, an N-2 policy. Documentation will be made available for the current release and the two previous minor releases. While this extends to the version list on the website, users may still access earlier versions of the documentation by navigating to a specific version by URL.

Documentation for each version is published at a URL like https://release-X-Y-0.kyverno.io/ where X is the major version and Y is the minor version. To access the documentation for version 1.9.0, navigate to the URL https://release-1-9-0.kyverno.io/.

Contributors

Made with contributors-img.

Contributing

This site makes use of the Docsy theme and Hugo Extended is required to render it.

To contribute changes, use the fork & pull approach.

1. First create a fork of the Kyverno website repository to your GitHub account. By default, the forked repository will be named website but can be changed in the settings for your repository if desired. You will later created a PR (pull request) using this fork.

2. Next, create a local clone using the command:

git clone https://github.com/{YOUR-GITHUB-ID}/website kyverno-website/

3. Then navigate to the local folder and build the website for local viewing of changes:

cd kyverno-website
hugo server

Note For Windows Users: When running the hugo server command, make sure to execute it with administrator privileges in your terminal. This is necessary to ensure proper access and functionality during the server execution.

By default, Hugo runs the website at: http://localhost:1313 and will re-build the site on changes.

Update Docsy theme

The project uses Hugo Modules to manage the theme:

Run hugo mod get -u ./... from project root.

To clean the module cache use hugo mod clean.

Rendering Policies to Markdown

Policies found at https://kyverno.io/policies/ are generated in Markdown from the source repository at kyverno/policies. For any changes to appear on https://kyverno.io/policies/, edits must be made to the upstream policy YAML files at kyverno/policies, and the render tool run from this repository to generate the respective Markdown. See render README for more details.

Style and typographical conventions

The Kyverno website has established several writing conventions in the interest of consistency and accuracy.

Voice

Active voice is preferred in most writing examples. Ex., "this ClusterPolicy mutates incoming Pods..." and not "incoming Pods are mutated by this ClusterPolicy".

Code styling

  • Kubernetes resource kinds are considered proper nouns and are distinguished from other nouns by the initial letter capitalization. Ex., "a Kubernetes Pod will be annotated".
  • Anything intended to be proper code or typed at a CLI is formatting using Markdown code syntax with backticks or in blocks (surrounded by three backticks).
  • Code represented in blocks should prefer a syntax declaration for this theme's highlighting ability. Ex., when displaying YAML notate the code block with three backticks and "yaml".

Grammar

  • We standardize on use of the Oxford comma.

Links

In order to ensure that broken link detection works optimally as well as providing a way for users to find linked content when viewing the raw Markdown files on GitHub, links should be made using relative paths to files and not relative rendered paths. Following this method ensures not only pages can be found but anchor links are still valid.

This is a good link:

[some link text](foo.md#my-anchor)

This is a bad link:

[some link text](/docs/foo/#my-anchor)

Documentation Versioning

The Kyverno website now uses releases to organize documentation by the specified release making it easier for users to find the information that pertains to their version. Releases are defined by branches of kyverno/website and a combination of exposing them in the website configuration and modifying hosting parameters.

Managing Release Versions

Here are the rules for managing release versions:

  1. All fixes and feature changes go to the main branch (we may in a few rare cases make fixes to prior versions of the documentation.) The main branch can be accessed at https://main.kyverno.io.

  2. When a new release is ready for GA, a new release branch is created (see steps below). Release branches are named release-{major}-{minor}-{patch} for example release-1-4-2. The release branch can be accessed using the {branch}.kyverno.io and the latest release is available at kyverno.io.

Creating a release branch

To create a new release branch:

  1. Create and push the branch using git checkout -b release-{major}-{minor}-{patch} or via GitHub.

  2. Update Netlify to point production to the new release branch.

  3. Also in Netlify, go into the Domain management settings of the site and add a new subdomain for the branch representing the previous version. For example, if the release to be cut is 1.8.0, there will not be a release-1-7-0.kyverno.io record which exists. One must be created for release-1-7-0.kyverno.io.

In the main branch:

  1. Update the versions list in params.toml to add the next release.

  2. Update version_menu and version in params.toml for the next release.

  3. Create a PR.

  4. Clear the Netlify cache!

In the current release branch:

  1. Update params.toml so that version_menu and version reflect the version of that release branch, NOT main. This is so when users navigate to the version of the docs represented in that version it shows the correct number.

Submitting a PR to multiple release branches

Ideally all changes will go to main and then be promoted to a release branch. However, occasionally we will need to fix documentation issues for already released versions. Rendered policies will always go to all branches because the policy samples themselves declare minimum capable versions via the policies.kyverno.io/minversion annotation.

Use the cherry pick bot to request a PR be cherry picked to a target branch. Call for the bot with a comment on the desired PR with /cherry-pick release-1-12-0 to cherry pick this PR to the release-1-12-0 branch. A new PR will be opened with release-1-12-0 as the target branch.

There are several ways to create multiple PRs, but here is one easy flow:

  1. Create a PR for the main branch, as usual.
  2. For each additional branch, checkout the branch (git checkout <branch>), and then cherry pick the commit(s) to that branch using git --cherry-pick <commit>. If using GitHub Desktop, a commit can be cherry picked by setting the source branch where the PR was merged, accessing the History tab, and dragging-and-dropping that commit to the destination branch.
  3. Submit PRs for each release branch.

Customize other settings

Edit the .toml files inside the config/_default directory.

If needing to create a new page under the Policies heading that adopts the same CSS styling, assign type = "policies" to the page.

website's People

Contributors

1shubham7 avatar 4molybdenum2 avatar anita-ihuman avatar anushkamittal20 avatar averagemarcus avatar blakyaks avatar chipzoller avatar dependabot[bot] avatar eddycharly avatar emmanuel-ferdman avatar jimbugwadia avatar khaledemaradev avatar kumar-mallikarjuna avatar mariamfahmy98 avatar noskillgirl avatar onweru avatar prateekpandey14 avatar realshuting avatar rinkiyakedad avatar samj1912 avatar sftim avatar shubhampalriwala avatar treydock avatar vedratan avatar vishal-chdhry avatar viveksahu26 avatar vyankd avatar vyankygh avatar yashvardhan-kukreja avatar yindia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

website's Issues

Update docs on Helm chart

The Kyverno helm chart now bundles policies for pod security standards:

kyverno/kyverno#1493

We should mention this in the docs and provide pointers for more details.

For the YAML install, would be good to reference the command line option to install the same policies.

Require Labels

The policy description does not match the purpose of 'require-labels' rule but instead, it matches the 'Disallow-latest-tag' policy.

Clarify requirement of external kustomize

kustomize files in policy repos are built for kustomize v3 whereas kubectl contains kustomize v2 and lags behind significantly. Clarify that external kustomize is required in all instances.

Document how to test policies and validate policy execution results

Its not clear how policy execution can be verified, and what the intent of status and events in a policy resource should do.

Reported on the Kyverno slack channel:

I have had some hard time debugging issues from my policies, it seems the policies have a status section and an event section but did not find many information about their meaning on the documentations. Apparently other resources may have policies related event (see pod above). This is not all clear to me where to look for information when testing policies.

We also need to improve documentation on the CLI and how it can be used for testing policies.

Upgrade procedure needed

There's nothing in the docs about an upgrade procedure, how that works, what happens to resources, etc. Even if it's just as simple as "apply the new manifest" there should be a procedure. Glad to contribute that, but need a discussion on the appropriate steps and impacts to ensure UX isn't negatively impacted.

Policy precedence

One really important topic I'm not finding in the documentation (please tell me if I missed it) is how policy precedence order works in Kyverno. For example, in a multi-tenant-style environment where there are cluster administrators responsible for high-level cluster operation and compliance, and namespace administrators where control for their namespace is delegated to another individual or team of individuals, how policy conflicts or unions are reconciled.

If a cluster administrator designates a ClusterPolicy which states that images must not come from Docker Hub, and a namespace administrator designates a Policy which states that images must come from Docker Hub, which policy takes precedence?

And as an example of a policy union, using the example above, the namespace administrator writes a policy for that namespace which designates an additional registry (ex, quay.io) from which images must not come, is the effective policy for deployments to that namespace prohibiting pulls from two registries or just one defined in the ClusterPolicy?

Variables and External Data Sources

Here you say that ConfigMap values can be referenced like {{ <name>.<data>.<key> }} but in your one and only example here, it's referenced like "{{ \"roles-dictionary\".data.\"allowed-roles\" }}" and so this is confusing.

render enhancements

From: kyverno/policies#7 (comment)

Might be good to make this process more "go newbie" friendly such as:
Add step to chmod +x the render binary after go build process.
May need to change the output of the build process to be something other than render if executed in the root of the website dir since render already exists as a directory.
Link to instructions on how to install go(?)
When I run render on the current state of the policies repo, it's generating title and linkTitle with dashes and not with spaces (as the MD files currently have). weight is also different. Haven't checked the code.

Update theme to display code block as full width

The current / default theme does not use the full panel width for code blocks. Would be good to allow it to take more space and avoid a horizontal scroll.

image

Also, not sure if the RHS side panel is always useful. Would be nice to remove for policy samples.

Add troubleshooting steps for webhooks

A common user error seems to be that the webhook does not work. Typically the issue is related to the cluster setup / CNI, etc.

Would be helpful to expand the troubleshooting section of the installation guide to include how to check each aspect of the webhook configuration and API server connectivity.

Some related details in:

kyverno/kyverno#1456

Search is returning stale pages

Haven't looked into how the docsy theme handles search results, but it's returning page links which aren't valid. As an example, do a search for "preconditions" and click the top link. Seems like it's not updating its cache of pages when the site gets updated.

Copy button for code blocks

You all have spent a lot of time writing some neat policies in the docs. It would be great if users could, with a simple button, copy the whole code block to the clipboard. Not sure what is being used for the site itself, else I would suggest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.