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

Apply Markdown linting in the Keda Manager repo #376

Merged
merged 10 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is a configuration file for the markdownlint. You can use this file to overwrite the default settings.
# MD013 is set to false by default because many files include lines longer than the conventional 80 character limit
MD013: false
# Disable the Multiple headings with the same content rule
MD024: false
# MD029 is set to false because it generated some issues with longer lists
MD029: false
# MD044 is used to set capitalization for the particular words. You can determine whether it should be used also for code blocks and html elements
MD044:
code_blocks: false
html_elements: false
names:
- Kyma
- Kubernetes
- ConfigMap
- CronJob
- CustomResourceDefinition
- Ingress
- Node
- PodPreset
- Pod
- ProwJob
- Secret
- ServiceBinding
- ServiceClass
- ServiceInstance
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_sidebar.md
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

## Overview
# Overview

To contribute to this project, follow the general [contributing](https://github.com/kyma-project/community/blob/main/docs/contributing/02-contributing.md) guidelines.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Keda Manager

## Status

![GitHub tag checks state](https://img.shields.io/github/checks-status/kyma-project/keda-manager/main?label=keda-operator&link=https%3A%2F%2Fgithub.com%2Fkyma-project%2Fkeda-manager%2Fcommits%2Fmain)
[![REUSE status](https://api.reuse.software/badge/github.com/kyma-project/keda-manager)](https://api.reuse.software/info/github.com/kyma-project/keda-manager)

## Overview
## Overview

Keda Manager is an extension to the Kyma runtime. It allows users to install KEDA. It follows the Kubernetes operator pattern to manage the lifecycle of the KEDA installation based on the existence and the content of the dedicated Keda custom resource (CR).

Expand All @@ -29,7 +30,6 @@ KEDA is a flexible Event Driven Autoscaler for the Kubernetes workloads. It exte

### Procedure


1. To install KEDA, you must install Keda Manager first. Apply the following script:

```bash
Expand All @@ -42,6 +42,7 @@ KEDA is a flexible Event Driven Autoscaler for the Kubernetes workloads. It exte
```bash
kubectl apply -f https://github.com/kyma-project/keda-manager/releases/latest/download/keda-default-cr.yaml
```

You should get a result similar to this example:

```bash
Expand Down
16 changes: 10 additions & 6 deletions docs/contributor/01-10-installation.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Install Keda Manager
# Install Keda Manager

- [Install Keda Manager](#install-keda-manager)
- [Install Keda Manager from the local sources](#install-keda-manager-from-the-local-sources)
- [Install Keda Manager From the Local Sources](#install-keda-manager-from-the-local-sources)
- [Prerequisites](#prerequisites)
- [Procedure](#procedure)
- [Make targets to run Keda Manager locally on k3d](#make-targets-to-run-keda-manager-locally-on-k3d)
- [Make Targets To Run Keda Manager Locally on k3d](#make-targets-to-run-keda-manager-locally-on-k3d)
- [Run Keda Manager](#run-keda-manager)

Learn how to install the Keda module locally (on k3d) or on your remote cluster.

## Install Keda Manager From the Local Sources
## Install Keda Manager From the Local Sources

### Prerequisites

Expand All @@ -35,6 +35,7 @@ Run the following commands to deploy Keda Manager in a target Kubernetes cluster
2. Set the Keda Manager image name.

> NOTE: You can use the local k3d registry or your Docker Hub account to push intermediate images.

```bash
export IMG=<DOCKER_USERNAME>/custom-keda-manager:0.0.2
```
Expand All @@ -44,11 +45,13 @@ Run the following commands to deploy Keda Manager in a target Kubernetes cluster
```bash
make test
```

4. Build and push the image to the registry.

```bash
make module-image
```

5. Create a target namespace.

```bash
Expand All @@ -69,7 +72,7 @@ Run the following commands to deploy Keda Manager in a target Kubernetes cluster

You should get a result similar to this example:

```
```bash
NAME READY UP-TO-DATE AVAILABLE AGE
keda-manager 1/1 1 1 1m
```
Expand All @@ -86,10 +89,11 @@ Thanks to that, you don't need to push the Keda module images to a remote regist
```bash
git clone https://github.com/kyma-project/keda-manager.git && cd keda-manager/
```

2. Build the manager locally and run it in the k3d cluster.

```bash
make -C hack/local run
```
3. If you want to clean up the k3d cluster, use the `make -C hack/local stop` make target.

3. If you want to clean up the k3d cluster, use the `make -C hack/local stop` make target.
2 changes: 1 addition & 1 deletion docs/contributor/01-20-extend-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Keda Manager is not only an API extension to the Kyma runtime. You can also use it to configure a dedicated UI for your CustomResourceDefinition (CRD).
To do that, use the [UI extensibility](https://github.com/kyma-project/busola/tree/main/docs/extensibility) feature of Kyma dashboard.
In the [ui-extensions](../../config/ui-extensions/) folder, you can find configuration for the UI components (for example, the `list`, `form`, or `details` views) that allows you to create a dedicated UI page for your Keda CR - `ScaledObjects`.
This configuration is applied as part of the Keda Manager resources. Thanks to that, it comes and goes depending on whether the Keda module is enabled or disabled.
This configuration is applied as part of the Keda Manager resources. Thanks to that, it comes and goes depending on whether the Keda module is enabled or disabled.
6 changes: 3 additions & 3 deletions docs/contributor/02-10-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Keda Manager reconciles KEDA deployment based on the watched Keda custom resourc
```bash
kubectl delete -f config/samples/keda-default-cr.yaml
```

This uninstalls all KEDA workloads but leaves Keda Manager.

> **NOTE:** Keda Manager uses finalizers to uninstall the Keda module from the cluster. It means that Keda Manager blocks the uninstallation process of KEDA until there are user-created CRs (for example, ScaledObjects).
Expand All @@ -32,8 +33,7 @@ Keda Manager reconciles KEDA deployment based on the watched Keda custom resourc

The [configuration example](../user/01-20-configuration.md) shows how to modify the Keda properties using the `keda.operator.kyma-project.io` CR.


```bash
```bash
cat <<EOF | kubectl apply -f -
apiVersion: operator.kyma-project.io/v1alpha1
kind: Keda
Expand All @@ -59,4 +59,4 @@ Keda Manager reconciles KEDA deployment based on the watched Keda custom resourc
cpu: "300m"
memory: "500Mi"
EOF
```
```
3 changes: 1 addition & 2 deletions docs/contributor/03-10-scripts-not-working.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

# Scripts Don't Work


## Symptom

For MacBook M1, some parts of the scripts may not work.
Expand All @@ -18,4 +17,4 @@ Install [Kyma CLI manually](https://github.com/kyma-project/cli#installation) an

```bash
export KYMA=$(which kyma)
```
```
4 changes: 2 additions & 2 deletions docs/contributor/04-10-ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following CI jobs are part of the development cycle. They verify the functio
|[`pre-keda-manager-operator-build`](https://github.com/kyma-project/test-infra/blob/main/templates/data/keda-manager.yaml#L43)|true|Builds Keda Operator's image and pushes it to the `dev` registry.|
|`pre-keda-manager-presubmit-scanner`|true|Checks if the repository contains any vulnerabilities.|

## Pipelines Running on `main` Branch
## Pipelines Running on `main` Branch

The following CI jobs regenerate Keda Manager’s artifacts and initiate integration tests of Keda Manager to verify the contract with respect to Kyma’s Lifecycle Manager.

Expand All @@ -23,4 +23,4 @@ The following CI jobs regenerate Keda Manager’s artifacts and initiate integra

## CI/CD Jobs Running on a Schedule

- [`Markdown / link-check`](https://github.com/kyma-project/keda-manager/blob/main/.github/workflows/daily-markdown-link-check.yaml) - Runs Markdown link check every day at 05:00 AM.
- [`Markdown / link-check`](https://github.com/kyma-project/keda-manager/blob/main/.github/workflows/daily-markdown-link-check.yaml) - Runs Markdown link check every day at 05:00 AM.
2 changes: 1 addition & 1 deletion docs/contributor/04-20-lifecycle-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ When you enable the Keda module using your Kyma custom resource (CR), the Lifecy
4. Lifecycle Manager applies the default Keda CR from the module template.
5. Keda Manager watches the Keda CR.
6. Keda Manager reconciles the KEDA workloads.
7. User can configure the Keda module by changing the Keda CR **spec**. Keda Manager reconciles the workloads accordingly.
7. User can configure the Keda module by changing the Keda CR **spec**. Keda Manager reconciles the workloads accordingly.
4 changes: 2 additions & 2 deletions docs/contributor/04-30-project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Keda Manager codebase is scaffolded with `kubebuilder`. For more information on `kubebuilder`, visit the [project site](https://github.com/kubernetes-sigs/kubebuilder).

- `config`: A directory containing the [kustomize](https://github.com/kubernetes-sigs/kustomize) YAML definitions of the module. For more information, see [kubebuilder's documentation on launch configuration](https://book.kubebuilder.io/cronjob-tutorial/basic-project.html#launch-configuration).
- `api`: Packages containing Keda CustomResourceDefinitions (CRD).
- `api`: Packages containing Keda CustomResourceDefinitions (CRD).
- `controllers`: Package containing the implementation of the module's reconciliation loop responsible for managing Keda custom resources (CRs).
- `Dockerfile`: The definition of the `keda-manager-module` image.
- `bin`: A directory with binaries that are used to build/run project.
- `config.yaml`: Configuration file to override the module's Helm chart properties.
- `docs`: Contains context documentation for the project.
- `hack`: A directory containing scripts and makefiles that enhance the root `Makefile` capabilities.
- `pkg`: Contains packages used in the project.
- `keda.yaml`: Kubernetes objects that represent `keda module`.
- `keda.yaml`: Kubernetes objects that represent `keda module`.
4 changes: 3 additions & 1 deletion docs/user/01-20-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ See how to configure the **logging.level** or resource consumption.
operator:
level: "debug"
```

- Change the operator and metricServer resource consumption using your preferred values. For example:

```yaml
Expand All @@ -30,4 +31,5 @@ See how to configure the **logging.level** or resource consumption.
cpu: "300m"
memory: "500Mi"
```
For more information about the Keda resources, visit the [Keda concepts](https://keda.sh/docs/latest/concepts/) documentation.

For more information about the Keda resources, visit the [Keda concepts](https://keda.sh/docs/latest/concepts/) documentation.
3 changes: 1 addition & 2 deletions docs/user/04-10-footprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ Similarly to the operators, the `keda-admission-webhooks` workload stays idle mo

The last workload, `keda-operator-metrics-apiserver`, continuously serves metrics for the Kubernetes autoscaling components. Here, the consumption is the highest, but in the case of one or two active KEDA scalers, it stays at 5-7 millicores of CPU time.


| Name | CPU (cores) | Memory (bytes) |
|---------------------------------|-------------|----------------|
| keda-admission-webhooks | 1m | 10Mi |
| keda-manager | 3m | 23Mi |
| keda-operator | 3m | 26Mi |
| keda-operator-metrics-apiserver | 5m | 30Mi |
| keda-operator-metrics-apiserver | 5m | 30Mi |
32 changes: 19 additions & 13 deletions docs/user/04-20-demo-applications.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Demo Applications

## Keda CPU Scaler Example

## Context
### Context

This demo application shows how to scale the Kubernetes workloads using KEDA API based on a simple CPU consumption case.

See the KEDA documentation:
- [API of Scaled Object Custom Resource](https://keda.sh/docs/latest/concepts/scaling-deployments/#scaledobject-spec)
- [Available scalers](https://keda.sh/docs/latest/scalers/)

- [API of the ScaledObject custom resource](https://keda.sh/docs/latest/concepts/scaling-deployments/#scaledobject-spec)
- [Available scalers](https://keda.sh/docs/latest/scalers/)

The KEDA demo application consists of:
- order-service deployment (serving as a scale target)
- busybox deployment (generating trafic)
- scaled object using a simple CPU-based trigger

## Procedure
- order-service deployment (serving as a scale target)
- busybox deployment (generating trafic)
- scaled object using a simple CPU-based trigger

### Procedure

1. Deploy the demo application:

Expand Down Expand Up @@ -44,10 +49,11 @@ To experience how Kyma's Keda module can complement other Kyma components, read

It demonstrates an event-driven approach that allows you to decouple functional parts of an application and apply consumption-based scaling.

It uses:
- Functions to deploy workloads directly from a Git repository ([Kyma Serverless](https://kyma-project.io/#/serverless-manager/user/README)),
- In-cluster Eventing to enable event-driven communication ([Kyma Eventing](https://kyma-project.io/#/eventing-manager/user/README)),
- Prometheus and Istio to deliver metrics essential for scaling decisions,
- [KEDA](https://keda.sh/) to drive the scaling.
It uses:

- Functions to deploy workloads directly from a Git repository ([Kyma Serverless](https://kyma-project.io/#/serverless-manager/user/README)),
- In-cluster Eventing to enable event-driven communication ([Kyma Eventing](https://kyma-project.io/#/eventing-manager/user/README)),
- Prometheus and Istio to deliver metrics essential for scaling decisions,
- [KEDA](https://keda.sh/) to drive the scaling.

![scenario](../assets/scaling-scenario.png "Scenario")
![scenario](../assets/scaling-scenario.png "Scenario")
2 changes: 1 addition & 1 deletion docs/user/05-01-conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ This section describes the possible states of the Keda CR. Two condition types,
| 7 | Error | Installed | false | KedaDuplicated | Only one instance of Keda is allowed |
| 8 | Deleting | Deleted | unknown | Deletion | Deletion in progress |
| 9 | Deleting | Deleted | true | Deleted | Keda module deleted |
| 10 | Error | Deleted | false | DeletionErr | Deletion failed |
| 10 | Error | Deleted | false | DeletionErr | Deletion failed |
7 changes: 5 additions & 2 deletions docs/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ Keda module is an extension to Kyma that allows you to install and manage KEDA o
Keda Manager helps you to install and manage KEDA on your cluster. It manages the lifecycle of KEDA based on the dedicated Keda custom resource (CR).

## Useful Links

- [KEDA configuration](01-20-configuration.md) - provides exemplary configuation of the KEDA components.
- [Keda module footprint](04-10-footprint.md) - describes the footprint generated by the Keda module.
- [KEDA demo applications](04-20-demo-applications.md) - shows how to scale the Kubernetes workloads using KEDA API.
- [Keda CR conditions](05-01-conditions.md) - describes the conditions of Keda CR.

For the developer guides, see:

- [Install Keda Manager](../contributor/01-10-installation.md) - describes the advanced installation options.
- [Extend user interface (UI)](../contributor/01-20-extend-ui.md) - describes how to configure a dedicated UI for your CustomResourceDefinition (CRD) using Kyma dashboard.
- [Extend user interface (UI)](../contributor/01-20-extend-ui.md) - describes how to configure a dedicated UI for your CustomResourceDefinition (CRD) using Kyma dashboard.
- [Use Keda Manager to manage KEDA](../contributor/02-10-management.md) - describes how you can manage your KEDA instance using Keda Manager.

For troubleshooting, see:
- [Scripts don't work](../contributor/03-10-scripts-not-working.md)

- [Scripts don't work](../contributor/03-10-scripts-not-working.md)
Loading
Loading