Skip to content

Commit 7e94f21

Browse files
committed
Add mdox link checking and formatting
Signed-off-by: Saswata Mukherjee <[email protected]>
1 parent 13cfbe3 commit 7e94f21

19 files changed

+146
-135
lines changed

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ You will need a Kubernetes cluster, that's it! By default it is assumed, that th
8080

8181
This means the kubelet configuration must contain these flags:
8282

83-
* `--authentication-token-webhook=true` This flag enables, that a `ServiceAccount` token can be used to authenticate against the kubelet(s). This can also be enabled by setting the kubelet configuration value `authentication.webhook.enabled` to `true`.
84-
* `--authorization-mode=Webhook` This flag enables, that the kubelet will perform an RBAC request with the API to determine, whether the requesting entity (Prometheus in this case) is allowed to access a resource, in specific for this project the `/metrics` endpoint. This can also be enabled by setting the kubelet configuration value `authorization.mode` to `Webhook`.
83+
* `--authentication-token-webhook=true` This flag enables, that a `ServiceAccount` token can be used to authenticate against the kubelet(s). This can also be enabled by setting the kubelet configuration value `authentication.webhook.enabled` to `true`.
84+
* `--authorization-mode=Webhook` This flag enables, that the kubelet will perform an RBAC request with the API to determine, whether the requesting entity (Prometheus in this case) is allowed to access a resource, in specific for this project the `/metrics` endpoint. This can also be enabled by setting the kubelet configuration value `authorization.mode` to `Webhook`.
8585

8686
This stack provides [resource metrics](https://github.com/kubernetes/metrics#resource-metrics-api) by deploying the [Prometheus Adapter](https://github.com/DirectXMan12/k8s-prometheus-adapter/).
8787
This adapter is an Extension API Server and Kubernetes needs to be have this feature enabled, otherwise the adapter has no effect, but is still deployed.
@@ -116,12 +116,12 @@ The following versions are supported and work as we test against these versions
116116

117117
## Quickstart
118118

119-
>Note: For versions before Kubernetes v1.21.z refer to the [Kubernetes compatibility matrix](#kubernetes-compatibility-matrix) in order to choose a compatible branch.
119+
> Note: For versions before Kubernetes v1.21.z refer to the [Kubernetes compatibility matrix](#kubernetes-compatibility-matrix) in order to choose a compatible branch.
120120
121121
This project is intended to be used as a library (i.e. the intent is not for you to create your own modified copy of this repository).
122122

123123
Though for a quickstart a compiled version of the Kubernetes [manifests](manifests) generated with this library (specifically with `example.jsonnet`) is checked into this repository in order to try the content out quickly. To try out the stack un-customized run:
124-
* Create the monitoring stack using the config in the `manifests` directory:
124+
* Create the monitoring stack using the config in the `manifests` directory:
125125

126126
```shell
127127
# Create the namespace and CRDs, and then wait for them to be available before creating the remaining resources
@@ -135,7 +135,8 @@ Alternatively, the resources in both folders can be applied with a single comman
135135
`kubectl create -f manifests/setup -f manifests`, but it may be necessary to run the command multiple times for all components to
136136
be created successfullly.
137137

138-
* And to teardown the stack:
138+
* And to teardown the stack:
139+
139140
```shell
140141
kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup
141142
```
@@ -173,14 +174,15 @@ Then access via [http://localhost:9093](http://localhost:9093)
173174
## Customizing Kube-Prometheus
174175

175176
This section:
176-
* describes how to customize the kube-prometheus library via compiling the kube-prometheus manifests yourself (as an alternative to the [Quickstart section](#quickstart)).
177-
* still doesn't require you to make a copy of this entire repository, but rather only a copy of a few select files.
177+
* describes how to customize the kube-prometheus library via compiling the kube-prometheus manifests yourself (as an alternative to the [Quickstart section](#quickstart)).
178+
* still doesn't require you to make a copy of this entire repository, but rather only a copy of a few select files.
178179

179180
### Installing
180181

181182
The content of this project consists of a set of [jsonnet](http://jsonnet.org/) files making up a library to be consumed.
182183

183184
Install this library in your own project with [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler#install) (the jsonnet package manager):
185+
184186
```shell
185187
$ mkdir my-kube-prometheus; cd my-kube-prometheus
186188
$ jb init # Creates the initial/empty `jsonnetfile.json`
@@ -196,6 +198,7 @@ $ wget https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/rel
196198
> An e.g. of how to install a given version of this library: `jb install github.com/prometheus-operator/kube-prometheus/jsonnet/[email protected]`
197199
198200
In order to update the kube-prometheus dependency, simply use the jsonnet-bundler update functionality:
201+
199202
```shell
200203
$ jb update
201204
```
@@ -280,6 +283,7 @@ rm -f kustomization
280283
This script runs the jsonnet code, then reads each key of the generated json and uses that as the file name, and writes the value of that key to that file, and converts each json manifest to yaml.
281284

282285
### Apply the kube-prometheus stack
286+
283287
The previous steps (compilation) has created a bunch of manifest files in the manifest/ folder.
284288
Now simply use `kubectl` to install Prometheus and Grafana as per your configuration:
285289

@@ -288,6 +292,7 @@ Now simply use `kubectl` to install Prometheus and Grafana as per your configura
288292
$ kubectl apply -f manifests/setup
289293
$ kubectl apply -f manifests/
290294
```
295+
291296
Alternatively, the resources in both folders can be applied with a single command
292297
`kubectl apply -Rf manifests`, but it may be necessary to run the command multiple times for all components to
293298
be created successfullly.
@@ -297,30 +302,35 @@ Check the monitoring namespace (or the namespace you have specific in `namespace
297302
### Containerized Installing and Compiling
298303

299304
If you don't care to have `jb` nor `jsonnet` nor `gojsontoyaml` installed, then use `quay.io/coreos/jsonnet-ci` container image. Do the following from this `kube-prometheus` directory:
305+
300306
```shell
301307
$ docker run --rm -v $(pwd):$(pwd) --workdir $(pwd) quay.io/coreos/jsonnet-ci jb update
302308
$ docker run --rm -v $(pwd):$(pwd) --workdir $(pwd) quay.io/coreos/jsonnet-ci ./build.sh example.jsonnet
303309
```
304310

305311
## Update from upstream project
312+
306313
You may wish to fetch changes made on this project so they are available to you.
307314

308315
### Update jb
316+
309317
`jb` may have been updated so it's a good idea to get the latest version of this binary:
310318

311319
```shell
312320
$ go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
313321
```
314322

315323
### Update kube-prometheus
324+
316325
The command below will sync with upstream project:
326+
317327
```shell
318328
$ jb update
319329
```
320330

321331
### Compile the manifests and apply
322-
Once updated, just follow the instructions under "Compiling" and "Apply the kube-prometheus stack" to apply the changes to your cluster.
323332

333+
Once updated, just follow the instructions under "Compiling" and "Apply the kube-prometheus stack" to apply the changes to your cluster.
324334

325335
## Configuration
326336

@@ -342,6 +352,7 @@ Configuration is mainly done in the `values` map. You can see this being used in
342352
```
343353

344354
The grafana definition is located in a different project (https://github.com/brancz/kubernetes-grafana ), but needed configuration can be customized from the same top level `values` field. For example to allow anonymous access to grafana, add the following `values` section:
355+
345356
```
346357
grafana+:: {
347358
config: { // http://docs.grafana.org/installation/configuration/
@@ -588,7 +599,7 @@ local kp = (import 'kube-prometheus/main.libsonnet') + {
588599
589600
### Monitoring all namespaces
590601

591-
In case you want to monitor all namespaces in a cluster, you can add the following mixin. Also, make sure to empty the namespaces defined in prometheus so that roleBindings are not created against them.
602+
In case you want to monitor all namespaces in a cluster, you can add the following mixin. Also, make sure to empty the namespaces defined in prometheus so that roleBindings are not created against them.
592603

593604
```jsonnet mdox-exec="cat examples/all-namespaces.jsonnet"
594605
local kp = (import 'kube-prometheus/main.libsonnet') +
@@ -749,7 +760,7 @@ kube-state-metrics resource allocation is managed by
749760
You can control it's parameters by setting variables in the
750761
config. They default to:
751762

752-
``` jsonnet
763+
```jsonnet
753764
kubeStateMetrics+:: {
754765
baseCPU: '100m',
755766
cpuPerNode: '2m',
@@ -759,11 +770,12 @@ config. They default to:
759770
```
760771

761772
### Error retrieving kube-proxy metrics
773+
762774
By default, kubeadm will configure kube-proxy to listen on 127.0.0.1 for metrics. Because of this prometheus would not be able to scrape these metrics. This would have to be changed to 0.0.0.0 in one of the following two places:
763775

764776
1. Before cluster initialization, the config file passed to kubeadm init should have KubeProxyConfiguration manifest with the field metricsBindAddress set to 0.0.0.0:10249
765777
2. If the k8s cluster is already up and running, we'll have to modify the configmap kube-proxy in the namespace kube-system and set the metricsBindAddress field. After this kube-proxy daemonset would have to be restarted with
766-
`kubectl -n kube-system rollout restart daemonset kube-proxy`
778+
`kubectl -n kube-system rollout restart daemonset kube-proxy`
767779

768780
## Contributing
769781

@@ -775,8 +787,8 @@ the following process:
775787
2. Commit your changes (This is currently necessary due to our vendoring
776788
process. This is likely to change in the future).
777789
3. Update the pinned kube-prometheus dependency in `jsonnetfile.lock.json`: `jb update`
778-
3. Generate dependent `*.yaml` files: `make generate`
779-
4. Commit the generated changes.
790+
4. Generate dependent `*.yaml` files: `make generate`
791+
5. Commit the generated changes.
780792

781793
## License
782794

RELEASE.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Kube-prometheus has a somehow predictable release schedule, releases were
44
historically cut in sync with OpenShift releases as per downstream needs. So
55
far there hasn't been any problem with this schedule since it is also in sync
66
with Kubernetes releases. So for every new Kubernetes release, there is a new
7-
release of kube-prometheus, although it tends to happen later.
7+
release of kube-prometheus, although it tends to happen later.
88

99
# How to cut a new release
1010

1111
> This guide is strongly based on the [prometheus-operator release
12-
instructions](https://github.com/prometheus-operator/prometheus-operator/blob/master/RELEASE.md).
12+
> instructions](https://github.com/prometheus-operator/prometheus-operator/blob/master/RELEASE.md).
1313
1414
## Branch management and versioning strategy
1515

@@ -53,19 +53,19 @@ failed or because the main branch was already up-to-date.
5353
The main branch of kube-prometheus should support the last 2 versions of
5454
Kubernetes. We need to make sure that the CI on the main branch is testing the
5555
kube-prometheus configuration against both of these versions by updating the [CI
56-
worklow](/.github/workflows/ci.yaml) to include the latest kind version and the
56+
worklow](.github/workflows/ci.yaml) to include the latest kind version and the
5757
2 latest images versions that are attached to the kind release. Once that is
58-
done, the [compatibility matrix](/README.md#kubernetes-compatibility-matrix) in
58+
done, the [compatibility matrix](README.md#kubernetes-compatibility-matrix) in
5959
the README should also be updated to reflect the CI changes.
6060

6161
## Create pull request to cut the release
6262

6363
### Pin Jsonnet dependencies
6464

6565
Pin jsonnet dependencies in
66-
[jsonnetfile.json](/jsonnet/kube-prometheus/jsonnetfile.json). Each dependency
66+
[jsonnetfile.json](jsonnet/kube-prometheus/jsonnetfile.json). Each dependency
6767
should be pinned to the latest release branch or if it doesn't have one, pinned
68-
to the latest commit.
68+
to the latest commit.
6969

7070
### Start with a fresh environment
7171

@@ -87,14 +87,14 @@ make generate
8787

8888
### Update the compatibility matrix
8989

90-
Update the [compatibility matrix](/README.md#kubernetes-compatibility-matrix) in
90+
Update the [compatibility matrix](README.md#kubernetes-compatibility-matrix) in
9191
the README, by adding the new release based on the `main` branch compatibility
9292
and removing the oldest release branch to only keep the latest 5 branches in the
9393
matrix.
9494

9595
### Update changelog
9696

97-
Iterate over the PRs that were merged between the latest release of kube-prometheus and the HEAD and add the changelog entries to the [CHANGELOG](/CHANGELOG.md).
97+
Iterate over the PRs that were merged between the latest release of kube-prometheus and the HEAD and add the changelog entries to the [CHANGELOG](CHANGELOG.md).
9898

9999
## Create release branch
100100

@@ -111,10 +111,10 @@ the main branch to be in sync with the latest changes of its dependencies.
111111

112112
### Update CI workflow
113113

114-
Update the [versions workflow](/.github/workflows/versions.yaml) to include the latest release branch and remove the oldest one to reflect the list of supported releases.
114+
Update the [versions workflow](.github/workflows/versions.yaml) to include the latest release branch and remove the oldest one to reflect the list of supported releases.
115115

116116
### Update Kubernetes versions used by kubeconform
117117

118118
Update the versions of Kubernetes used when validating manifests with
119-
kubeconform in the [Makefile](/Makefile) to align with the compatibility
119+
kubeconform in the [Makefile](Makefile) to align with the compatibility
120120
matrix.

code-of-conduct.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ This code of conduct applies both within project spaces and in public spaces
3333
when an individual is representing the project or its community.
3434

3535
Instances of abusive, harassing, or otherwise unacceptable behavior may be
36-
reported by contacting a project maintainer listed in
37-
https://github.com/prometheus-operator/prometheus-operator/blob/master/MAINTAINERS.md.
36+
reported by contacting a project maintainer listed in
37+
https://github.com/prometheus-operator/prometheus-operator/blob/master/MAINTAINERS.md.
3838

3939
This Code of Conduct is adapted from the Contributor Covenant
4040
(http://contributor-covenant.org), version 1.2.0, available at

developer-workspace/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ After your workspace start, you can deploy a kube-prometheus inside a Kind clust
2020

2121
If you are reviewing a PR, you'll have a fully-functional kubernetes cluster, generating real monitoring data that can be used to review if the proposed changes works as described.
2222

23-
If you are working on new features/bug fixes, you can regenerate kube-prometheus's YAML manifests with `make generate` and deploy it again with `make deploy`.
23+
If you are working on new features/bug fixes, you can regenerate kube-prometheus's YAML manifests with `make generate` and deploy it again with `make deploy`.
2424

2525
## Gitpod
2626

@@ -31,4 +31,3 @@ You can use the same workflow as mentioned in the [Codespaces](#codespaces) sect
3131
To open up a workspace with Gitpod, you can install the [Google Chrome extension](https://www.gitpod.io/docs/browser-extension/) to add a new button to Github UI and use it on PRs or from the main page. Or by directly typing in the browser `http://gitpod.io/#https://github.com/prometheus-operator/kube-prometheus/pull/<Pull Request Number>` or just `http://gitpod.io/#https://github.com/prometheus-operator/kube-prometheus`
3232

3333
![image](https://user-images.githubusercontent.com/24193764/135534546-4f6bf0e5-57cd-4e35-ad80-88bd47d64276.png)
34-

docs/EKS-cni-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AWS EKS uses [CNI](https://github.com/aws/amazon-vpc-cni-k8s) networking plugin
44

55
One fatal issue that can occur is that you run out of IP addresses in your eks cluster. (Generally happens due to error configs where pods keep scheduling).
66

7-
You can monitor the `awscni` using kube-promethus with :
7+
You can monitor the `awscni` using kube-promethus with :
88

99
```jsonnet mdox-exec="cat examples/eks-cni-example.jsonnet"
1010
local kp = (import 'kube-prometheus/main.libsonnet') + {

docs/GKE-cadvisor-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authentication. Until it does, Prometheus must use HTTP (not HTTPS)
55
for scraping.
66

77
You can configure this behavior through kube-prometheus with:
8+
89
```
910
local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') +
1011
(import 'kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet') +

docs/blackbox-exporter.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
title: "Blackbox Exporter"
3-
description: "Generated API docs for the Prometheus Operator"
4-
lead: "This Document documents the types introduced by the Prometheus Operator to be consumed by users."
5-
date: 2021-03-08T08:49:31+00:00
6-
lastmod: 2021-03-08T08:49:31+00:00
7-
draft: false
8-
images: []
9-
menu:
10-
docs:
11-
parent: "kube"
122
weight: 630
133
toc: true
4+
title: Blackbox Exporter
5+
menu:
6+
docs:
7+
parent: kube
8+
lead: This Document documents the types introduced by the Prometheus Operator to be consumed by users.
9+
lastmod: "2021-03-08T08:49:31+00:00"
10+
images: []
11+
draft: false
12+
description: Generated API docs for the Prometheus Operator
13+
date: "2021-03-08T08:49:31+00:00"
1414
---
1515

1616
# Setting up a blackbox exporter
@@ -21,6 +21,7 @@ The `prometheus-operator` defines a `Probe` resource type that can be used to de
2121

2222
1. Override blackbox-related configuration parameters as needed.
2323
2. Add the following to the list of renderers to render the blackbox exporter manifests:
24+
2425
```
2526
{ ['blackbox-exporter-' + name]: kp.blackboxExporter[name] for name in std.objectFields(kp.blackboxExporter) }
2627
```

0 commit comments

Comments
 (0)