Skip to content

Commit

Permalink
fixing indentation and typos
Browse files Browse the repository at this point in the history
Signed-off-by: Anita-ihuman <charlesanita403@gmail.com>
  • Loading branch information
Anita-ihuman committed Oct 9, 2021
1 parent f94941e commit f36e05b
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 71 deletions.
115 changes: 57 additions & 58 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,84 @@
# How to Contribute
We welcome all contributions, suggestions, and feedback, so please do not hesitate to reach out!
We welcome all contributions, suggestions, and feedback, so please do not hesitate to reach out!


We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests.

## Community Guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
This project follows[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).

## Code of conduct
Before you contribute, please review and agree to abide by our community [Code of Conduct](/CODE_OF_CONDUCT.md).

## Ways You Can Contribute
- [Report Issues](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#report-issues)
- [Submit Pull Requests](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#submit-pull-requests)
- [Fix or Improve Documentation](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#fix-or-improve-documentation)
- [Join Our Community Meetings](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#join-our-community-meetings)
### Report issues
- Report potential bugs
- Request a feature
- Request a sample policy

### Submit Pull Requests
#### Setup local development environments
- Please refer to [README](https://github.com/kyverno/website#readme) for local setup.
#### Submit a PR for [open issues](https://github.com/kyverno/kyverno/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)

### Fix or Improve Documentation
- [Kyverno Docs](https://github.com/kyverno/website)
#### Get started
If you wish to contribute to this project, follow these steps below:
- Step 1: [Report Issues](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#step-1-report-issues)
- Step 2: [Submit a Pull Request](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#step-2-submit-pull-requests)
- Step 3: [Fix or Improve Documentation](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#step-3-fix-or-improve-documentation)
- Step 4: [Join Our Community Meetings](https://github.com/kyverno/website/blob/main/CONTRIBUTING.md#step-4-join-our-community-meetings)

Head over to project repository on github and click the **"Fork"** button. With the forked copy, you can try new ideas and implement changes to the project.
### Step 1: Report issues
If you see a bug or want to add new features please create an [issue](https://github.com/kyverno/kyverno/issues/new/choose).
- Report potential bugs
- Request a feature
- Request a sample policy

1. **Clone the repository to your device:**
### Step 2: Submit a Pull Request

To clone this repository, copy the link of below, paste it in your device terminal and replace the *YOUR-GITHUB-ID* with your Github ID.
Find an [open issues](https://github.com/kyverno/kyverno/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and indicate interest.
1. **Fork the Kyverno repo:**

```
$ git clone https://github.com/{YOUR-GITHUB-ID}/website kyverno-website/ --recurse-submodules
Head over to project repository on github and click the **"Fork"** button. With the forked copy, you can try new ideas and implement changes to the project.

```
2. **Clone the repository to your device:**

2. Then navigate to the local folder and build the website for local viewing of changes using this command:
To clone this repository, copy the link of below, paste it in your device terminal and replace the *YOUR-GITHUB-ID* with your Github ID.

```
cd kyverno-website
```
$ git clone https://github.com/{YOUR-GITHUB-ID}/website kyverno-website/ --recurse-submodules
hugo server -v
```
3. **Create a branch:**
```
3. **Create a branch:**

Create a new brach and navigate to the branch using this command.
Create a new brach and navigate to the branch using this command.

```
$ git checkout -b <new-branch>
```
```
$ git checkout -b <new-branch>
```

Great, it's time to start hacking. You can now go ahead to make all the changes you want.

4. **Setup local development environments**

Then navigate to the local folder and build the website for local viewing of changes using this command:

Great, its time to start hacking, You can now go ahead to make all the changes you want.
```sh

cd kyverno-website

4. **Stage, Commit and Push changes:**

Now that we have implemented the required changes, use the command below to stage the changes and commit them.
hugo server -v

```
5. **Stage, Commit and Push changes:**

Now that we have implemented the required changes, use the command below to stage the changes and commit them.

```
$ git add .
Expand All @@ -96,13 +95,13 @@ hugo server -v
```
$ git push
```

### Step 3: Fix or Improve Documentation
- [Kyverno Docs](https://github.com/kyverno/website)


Before you contribute, please review and agree to abide by our community [Code of Conduct](/CODE_OF_CONDUCT.md).


### Join Our Community Meetings
The easiest way to reach us is on the [Kubernetes slack #kyverno channel](https://app.slack.com/client/T09NY5SBT/CLGR9BJU9).
### Step 4: Join Our Community Meetings
The easiest way to reach us is on the [Kubernetes slack #kyverno channel](https://slack.k8s.io/#kyverno).

## Developer Certificate of Origin (DCO) Sign off

Expand Down
35 changes: 22 additions & 13 deletions content/en/docs/High Availability/_index.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
---
title: "High Availability"
linkTitle: "High Availability"
weight: 170
weight: 120
description: >
Learn how to configure High Availability in Kyverno
---

## Configure Kyverno in HA mode
To install Kyverno in HA using Helm Chart.

To install Kyverno in HA using Helm Chart.

**NOTE:** Due to some complexities accompanied with running 2 replicas, the recommended replica counts for HA is at least 3.

```sh
helm install kyverno kyverno/kyverno --create-namespace --set=replicaCount=3
```
## How HA works in Kyverno
This section provides details on how Kyverno handles HA scenarios.
```sh
helm install kyverno kyverno/kyverno --create-namespace --set=replicaCount=3
```
### How HA works in Kyverno

This section provides details on how Kyverno handles HA scenarios.

**Module - Webhook Server**
Webhook server is where Kyverno receives and processes admission requests. This controller does not require a leader-election. When Kyverno runs multiple instances, the Service will distribute the admission requests across different instances.

For `mutate` and `validate` enforce policies, Kyverno returns the decision along with the admission response; it is a synchronous request-response process. However, for `generate` and “validate” audit policies, Kyverno pushes these requests to a queue, and returns the response immediately, and then starts processing the data asynchronously. The queue in the validate audit handler is used to generate policy reports. Since the report will be reconciled when Kyverno restarts, there’s no need to drain this queue on shutdown.
Webhook server is where Kyverno receives and processes admission requests. This controller does not require a leader-election. When Kyverno runs multiple instances, the Service will distribute the admission requests across different instances.

If the process is terminated, we need to complete pending requests / drain the queue and then shutdown Kyverno gracefully.
For `mutate` and `validate` enforce policies, Kyverno returns the decision along with the admission response; it is a synchronous request-response process. However, for `generate` and “validate” audit policies, Kyverno pushes these requests to a queue, and returns the response immediately, and then starts processing the data asynchronously. The queue in the validate audit handler is used to generate policy reports.

Since the report will be reconciled when Kyverno restarts, there’s no need to drain this queue on shutdown. If the process is terminated, we need to complete pending requests / drain the queue and then shutdown Kyverno gracefully.


The remaining components (listed below) will need to enable leader election to support HA, we will use this library [client-go/tools/leaderelection](https://pkg.go.dev/k8s.io/client-go/tools/leaderelection) to enable it. The library is used by kube-controller-manager, kube-scheduler, etc. Notice that this library does not guarantee that only one client is acting as a leader (a.k.a. fencing), so we have to design in a way that even if the same process gets executed twice, the results are consistent.
The remaining components (listed below) will need to enable leader election to support HA, we will use this library [client-go/tools/leaderelection](https://pkg.go.dev/k8s.io/client-go/tools/leaderelection) to enable it.
The library is used by kube-controller-manager, kube-scheduler, etc. Notice that this library does not guarantee that only one client is acting as a leader (a.k.a. fencing), so we have to design in a way that even if the same process gets executed twice, the results are consistent.

**Module - Webhook Register / Webhook Monitor / Certificate Renewer**
In v1.3.6-rc1, the webhook register, webhook monitor and certificate renewer are managed in the same package. The minimum requirement is to enable leader election for the webhook register to register the webhook configurations.

V1.4.0-beta1: Both webhook register and certificate renewer have enabled leader election. The webhook monitor runs across all instances as it maintains an internal webhook timestamp to monitor the webhook status. The monitor also recreates the webhook configurations if any are missing. The check is currently performed every 30 seconds..
In v1.3.6, the webhook register, webhook monitor and certificate renewer are managed in the same package. The minimum requirement is to enable leader election for the webhook register to register the webhook configurations.

V1.4.0: Both webhook register and certificate renewer have enabled leader election. The webhook monitor runs across all instances as it maintains an internal webhook timestamp to monitor the webhook status. The monitor also recreates the webhook configurations if any are missing. The check is currently performed every 30 seconds.


**Module - Generate Controller**

A generate policy is processed in two phases:

1. The webhook server receives the source (triggering) resource and creates a GenerateRequest object based on the admission request;
Expand All @@ -42,6 +50,7 @@ This section provides details on how Kyverno handles HA scenarios.
That is to say, there will only be one instance processing the GR if Kyverno is configured with multiple replicas.

**Module - Policy Controller**

The policy controller does two things:

1. Updates GenerateRequests on generate policy updates.
Expand Down

0 comments on commit f36e05b

Please sign in to comment.