Skip to content

Commit

Permalink
chore: fix markdown linter errors (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
mowies authored Feb 13, 2023
1 parent 82351f4 commit 5df8789
Show file tree
Hide file tree
Showing 37 changed files with 831 additions and 551 deletions.
43 changes: 24 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
# Contributing to the Keptn Lifecycle Toolkit

We are thrilled to have you join us as a contributor! The Keptn Lifecycle Toolkit is a community-driven project and we greatly value collaboration. There are various ways to contribute to the Lifecycle Toolkit, and all contributions are highly valued. Please, explore the options below to learn more about how you can contribute.
We are thrilled to have you join us as a contributor!
The Keptn Lifecycle Toolkit is a community-driven project and we greatly value collaboration.
There are various ways to contribute to the Lifecycle Toolkit, and all contributions are highly valued.
Please, explore the options below to learn more about how you can contribute.

# How to Contribute
## Prerequisites

## Linters

This project uses a set of linters to ensure good code quality.
In order to make proper use of those linters inside an IDE, the following configuration is required.

Further information can also be found in the [`golangci-lint` documentation](https://golangci-lint.run/usage/integrations/).
Further information can also be found in
the [`golangci-lint` documentation](https://golangci-lint.run/usage/integrations/).

### Visual Studio Code

In Visual Studio Code the [Golang](https://marketplace.visualstudio.com/items?itemName=aldijav.golangwithdidi) extension is required.
In Visual Studio Code the [Golang](https://marketplace.visualstudio.com/items?itemName=aldijav.golangwithdidi)
extension is required.

Adding the following lines to the `Golang` extension configuration file will enable all linters used in this project.

```
```json
"go.lintTool": {
"type": "string",
"default": "golangci-lint",
"description": "GolangGCI Linter",
"scope": "resource",
"enum": [
"golangci-lint",
]
"type": "string",
"default": "golangci-lint",
"description": "GolangGCI Linter",
"scope": "resource",
"enum": [
"golangci-lint",
]
},
"go.lintFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": ["--fast", "--fix"],
"description": "Flags to pass to GCI Linter",
"scope": "resource"
"type": "array",
"items": {
"type": "string"
},
"default": ["--fast", "--fix"],
"description": "Flags to pass to GCI Linter",
"scope": "resource"
},
```

Expand Down
207 changes: 129 additions & 78 deletions README.md

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions assets/logo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ This directory contains the Keptn Lifecycle Controller logos in different format

## Logos

| Name | Logo | Format |
| ------------------------------------------ | -------------------------------------------------------------------- | ------ |
| `keptn_lifecycle_controller_logo.png` | <img src="./keptn_lifecycle_controller_logo.png" width="160"> | PNG |

| Name | Logo | Format |
| ------------------------------------------ |----------------------------------------------------| ------ |
| `keptn_lifecycle_controller_logo.png` | ![KLT Logo](./keptn_lifecycle_controller_logo.png) | PNG |
16 changes: 11 additions & 5 deletions dashboards/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@
This folder contains the Grafana dashboards for the Keptn Lifecycle Toolkit.

## Installing the dashboards
It is assumed, that there is a Grafana Instance available. In our provided examples, the dashboards are automatically provisioned. If you want to install the dashboards manually, you can use the following steps:

```sh
It is assumed, that there is a Grafana Instance available. In our provided examples, the dashboards are automatically
provisioned. If you want to install the dashboards manually, you can use the following steps:

```shell
# This defaults to http://localhost:3000, but can be changed by setting the GRAFANA_SCHEME, GRAFANA_URL and GRAFANA_PORT environment variable
# The default credentials are admin:admin, but can be changed by setting the GRAFANA_USERNAME and GRAFANA_PASSWORD environment variable
make install
```

## Changing the dashboards
The dashboards can be changed in the Grafana UI. To export dashboards, export them using the share button and replace them in this folder.

The dashboards can be changed in the Grafana UI. To export dashboards, export them using the share button and replace
them in this folder.

## Exporting the dashboards for the Examples

You can prepare the dashboards for the examples and import using the following command:

```sh
```shell
make generate
```

<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=858843d8-8da2-4ce5-a325-e5321c770a78" />
<!-- markdownlint-disable-next-line MD033 MD013 -->
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=858843d8-8da2-4ce5-a325-e5321c770a78" />
9 changes: 4 additions & 5 deletions dashboards/grafana/configmap/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## Autogenerated Files - Do not change
# Autogenerated Files - Do not change

# Grafana Dashboards - ConfigMaps
## Grafana Dashboards - ConfigMaps

This files can be used to autoprovision Grafana dashboards in Kubernetes.

More information: https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards
These files can be used to autoprovision Grafana dashboards in Kubernetes.

More information: <https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards>
6 changes: 3 additions & 3 deletions dashboards/grafana/import/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Autogenerated Files - Do not change
# Autogenerated Files - Do not change

# Grafana Dashboards - Import
## Grafana Dashboards - Import

These dashboards can be imported into Grafana using the API.

To import them, use `make import` in the makefile of the `dashboards` directory.
To import them, use `make import` in the makefile of the `dashboards` directory.
17 changes: 10 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
## Choosing where to add documentation
# Choosing where to add documentation

If the change to the docs needs to reflect the next version of KLT, please edit them here, following the instructions below.
For already existing documentation versions directly edit them from https://github.com/keptn-sandbox/lifecycle-toolkit-docs or from https://lifecycle.keptn.sh/.
If the change to the docs needs to reflect the next version of KLT, please edit them here, following the instructions
below.
For already existing documentation versions directly edit them
from <https://github.com/keptn-sandbox/lifecycle-toolkit-docs> or from <https://lifecycle.keptn.sh/>.

## Adding documentation to the dev repo

To verify your changes to the dev documentations you can use the makefile:

```
```shell
cd lifecycle-toolkit/docs

make clone
make build
make server
```

After the server is running on http://localhost:1314/docs-dev.
After the server is running on <http://localhost:1314/docs-dev>.
Any modification in the docs folder will be reflected on the server under the dev revision.
You can modify the content in realtime to verify the correct behaviour of links and such.

### Markdown linting

To check your markdown files for linter errors, run the following from the repo root:

```
```shell
make markdownlint
```

To use the auto-fix option, run:

```
```shell
make markdownlint-fix
```
28 changes: 16 additions & 12 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ title = "Home"

+++

{{< blocks/cover title="Welcome to the Keptn Lifecycle Toolkit Documentation" image_anchor="top" height="half" color="primary" >}}
<!-- markdownlint-disable MD033 -->

{{< blocks/cover title="Welcome to the Keptn Lifecycle Toolkit Documentation" image_anchor="top" height="half" color="
primary" >}}
<div class="mx-auto">
<a class="btn btn-lg btn-primary mr-3 mb-4" href="{{< relref "/docs" >}}">
Docs <i class="fas fa-arrow-alt-circle-right ml-2"></i>
</a>
<a class="btn btn-lg btn-primary mr-3 mb-4" href="{{< relref "/docs" >}}">
Docs <i class="fas fa-arrow-alt-circle-right ml-2"></i>
</a>
<a class="btn btn-lg btn-primary mr-3 mb-4" href="https://github.com/keptn/lifecycle-toolkit/releases">
Releases <i class="fab fa-github ml-2 "></i>
</a>
Releases <i class="fab fa-github ml-2 "></i>
</a>
</div>
{{< /blocks/cover >}}


{{% blocks/lead color="white" %}}
[![Keptn Lifecycle Toolkit in a Nutshell](https://img.youtube.com/vi/K-cvnZ8EtGc/0.jpg)](https://www.youtube.com/watch?v=K-cvnZ8EtGc)
{{% /blocks/lead %}}
Expand All @@ -24,14 +26,16 @@ title = "Home"
See Keptn [in Action](https://youtube.com/playlist?list=PL6i801Rjt9DbikPPILz38U1TLMrEjppzZ)
{{% /blocks/feature %}}


{{% blocks/feature icon="fab fa-github" title="Contributions welcome!" url="https://github.com/keptn/lifecycle-toolkit" %}}
We do a [Pull Request](https://github.com/keptn/lifecycle-toolkit/pulls) contributions workflow on **GitHub**. New users are always welcome!
{{% blocks/feature icon="fab fa-github" title="Contributions welcome!" url="https://github.com/keptn/lifecycle-toolkit"
%}}
We do a [Pull Request](https://github.com/keptn/lifecycle-toolkit/pulls) contributions workflow on **GitHub**. New users
are always welcome!
{{% /blocks/feature %}}


{{% blocks/feature icon="fab fa-twitter" title="Follow us on Twitter!" url="https://twitter.com/keptnProject" %}}
For announcement of latest features etc.
{{% /blocks/feature %}}

{{< /blocks/section >}}
{{< /blocks/section >}}

<!-- markdownlint-enable MD033 -->
32 changes: 18 additions & 14 deletions docs/content/en/docs/concepts/apps/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@ hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html
---

An App contains information about all workloads and checks associated with an application.
It will use the following structure for the specification of the pre/post deployment and pre/post evaluations checks that should be executed at app level:
It will use the following structure for the specification of the pre/post deployment and pre/post evaluations checks
that should be executed at app level:

```
```yaml
apiVersion: lifecycle.keptn.sh/v1alpha2
kind: KeptnApp
metadata:
name: podtato-head
namespace: podtato-kubectl
name: podtato-head
namespace: podtato-kubectl
spec:
version: "1.3"
workloads:
- name: podtato-head-left-arm
version: 0.1.0
- name: podtato-head-left-leg
postDeploymentTasks:
- post-deployment-hello
preDeploymentEvaluations:
- my-prometheus-definition
version: "1.3"
workloads:
- name: podtato-head-left-arm
version: 0.1.0
- name: podtato-head-left-leg
version: 1.2.3
postDeploymentTasks:
- post-deployment-hello
preDeploymentEvaluations:
- my-prometheus-definition
```
While changes in the workload version will affect only workload checks, a change in the app version will also cause a new execution of app level checks.
While changes in the workload version will affect only workload checks, a change in the app version will also cause a
new execution of app level checks.
5 changes: 3 additions & 2 deletions docs/content/en/docs/concepts/evaluations/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html


### Keptn Evaluation Definition

A `KeptnEvaluationDefinition` is a CRD used to define evaluation tasks that can be run by the Keptn Lifecycle Toolkit
as part of pre- and post-analysis phases of a workload or application.

Expand All @@ -30,8 +31,8 @@ spec:
evaluationTarget: >4
```
### Keptn Evaluation Provider
A `KeptnEvaluationProvider` is a CRD used to define evaluation provider, which will provide data for the
pre- and post-analysis phases of a workload or application.

Expand All @@ -45,4 +46,4 @@ metadata:
spec:
targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090"
secretName: prometheusLoginCredentials
```
```
51 changes: 29 additions & 22 deletions docs/content/en/docs/concepts/metrics/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html
---

### Keptn Metric
A `KeptnMetric` is a CRD representing a metric. The metric will be collected from the provider specified in the specs.provider.name field. The query is a string in the provider-specific query language, used to obtain a metric. Providing the metrics as CRD into a K8s cluster will facilitate the reusability of this data across multiple components. Furthermore, this allows using multiple observability platforms for different metrics. Please note, there is a limitation that `KeptnMetric` resource needs to be created only in `keptn-lifecycle-toolkit-system` namespace.

A `KeptnMetric` is a CRD representing a metric. The metric will be collected from the provider specified in the
specs.provider.name field. The query is a string in the provider-specific query language, used to obtain a metric.
Providing the metrics as CRD into a K8s cluster will facilitate the reusability of this data across multiple components.
Furthermore, this allows using multiple observability platforms for different metrics. Please note, there is a
limitation that `KeptnMetric` resource needs to be created only in `keptn-lifecycle-toolkit-system` namespace.

A `KeptnMetric` looks like the following:

Expand All @@ -25,23 +30,24 @@ spec:
fetchIntervalSeconds: 5
```
Keptn metrics can be exposed as OTel metrics via port `9999` of the KLT operator. To expose them, the env variable `EXPOSE_KEPTN_METRICS` in the operator manifest needs to be set to `true`. The default value of this variable is `true`. To access the metrics, use the following command:
Keptn metrics can be exposed as OTel metrics via port `9999` of the KLT operator. To expose them, the env
variable `EXPOSE_KEPTN_METRICS` in the operator manifest needs to be set to `true`. The default value of this variable
is `true`. To access the metrics, use the following command:

```
```shell
kubectl port-forward deployment/klc-controller-manager 9999 -n keptn-lifecycle-toolkit-system
```

and access the metrics via your browser with:

```
http://localhost:9999/metrics
```
```http://localhost:9999/metrics```

#### Accessing Metrics via the Kubernetes Custom Metrics API

`KeptnMetrics` that are located in the `keptn-lifecycle-toolkit-system` namespace can also be retrieved via the Kubernetes Custom Metrics API.
This makes it possible to refer to these metrics via the Kubernetes *HorizontalPodAutoscaler*, as in the following example:
`KeptnMetrics` that are located in the `keptn-lifecycle-toolkit-system` namespace can also be retrieved via the
Kubernetes Custom Metrics API.
This makes it possible to refer to these metrics via the Kubernetes *HorizontalPodAutoscaler*, as in the following
example:

```yaml
apiVersion: autoscaling/v2
Expand All @@ -57,17 +63,17 @@ spec:
minReplicas: 1
maxReplicas: 10
metrics:
- type: Object
object:
metric:
name: keptnmetric-sample
describedObject:
apiVersion: metrics.keptn.sh/v1alpha1
kind: KeptnMetric
name: keptnmetric-sample
target:
type: Value
value: "10"
- type: Object
object:
metric:
name: keptnmetric-sample
describedObject:
apiVersion: metrics.keptn.sh/v1alpha1
kind: KeptnMetric
name: keptnmetric-sample
target:
type: Value
value: "10"
```

You can also use the `kubectl raw` command to retrieve the values of a `KeptnMetric`, as in the following example:
Expand Down Expand Up @@ -102,7 +108,8 @@ $ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kube
}
```

You can also filter based on matching labels. So to e.g. retrieve all metrics that are labelled with `app=frontend`, you can use the following command:
You can also filter based on matching labels. So to e.g. retrieve all metrics that are labelled with `app=frontend`, you
can use the following command:

```shell
$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kubectl/keptnmetrics.metrics.sh/*/*?labelSelector=app%3Dfrontend" | jq .
Expand Down Expand Up @@ -132,4 +139,4 @@ $ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kube
}
]
}
```
```
Loading

0 comments on commit 5df8789

Please sign in to comment.