You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-13Lines changed: 25 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,8 @@ You will need a Kubernetes cluster, that's it! By default it is assumed, that th
80
80
81
81
This means the kubelet configuration must contain these flags:
82
82
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`.
85
85
86
86
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/).
87
87
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
116
116
117
117
## Quickstart
118
118
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.
120
120
121
121
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).
122
122
123
123
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:
125
125
126
126
```shell
127
127
# 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
135
135
`kubectl create -f manifests/setup -f manifests`, but it may be necessary to run the command multiple times for all components to
@@ -173,14 +174,15 @@ Then access via [http://localhost:9093](http://localhost:9093)
173
174
## Customizing Kube-Prometheus
174
175
175
176
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.
178
179
179
180
### Installing
180
181
181
182
The content of this project consists of a set of [jsonnet](http://jsonnet.org/) files making up a library to be consumed.
182
183
183
184
Install this library in your own project with [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler#install) (the jsonnet package manager):
185
+
184
186
```shell
185
187
$ mkdir my-kube-prometheus;cd my-kube-prometheus
186
188
$ jb init # Creates the initial/empty `jsonnetfile.json`
> An e.g. of how to install a given version of this library: `jb install github.com/prometheus-operator/kube-prometheus/jsonnet/[email protected]`
197
199
198
200
In order to update the kube-prometheus dependency, simply use the jsonnet-bundler update functionality:
201
+
199
202
```shell
200
203
$ jb update
201
204
```
@@ -280,6 +283,7 @@ rm -f kustomization
280
283
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.
281
284
282
285
### Apply the kube-prometheus stack
286
+
283
287
The previous steps (compilation) has created a bunch of manifest files in the manifest/ folder.
284
288
Now simply use `kubectl` to install Prometheus and Grafana as per your configuration:
285
289
@@ -288,6 +292,7 @@ Now simply use `kubectl` to install Prometheus and Grafana as per your configura
288
292
$ kubectl apply -f manifests/setup
289
293
$ kubectl apply -f manifests/
290
294
```
295
+
291
296
Alternatively, the resources in both folders can be applied with a single command
292
297
`kubectl apply -Rf manifests`, but it may be necessary to run the command multiple times for all components to
293
298
be created successfullly.
@@ -297,30 +302,35 @@ Check the monitoring namespace (or the namespace you have specific in `namespace
297
302
### Containerized Installing and Compiling
298
303
299
304
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:
You may wish to fetch changes made on this project so they are available to you.
307
314
308
315
### Update jb
316
+
309
317
`jb` may have been updated so it's a good idea to get the latest version of this binary:
310
318
311
319
```shell
312
320
$ go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
313
321
```
314
322
315
323
### Update kube-prometheus
324
+
316
325
The command below will sync with upstream project:
326
+
317
327
```shell
318
328
$ jb update
319
329
```
320
330
321
331
### 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.
323
332
333
+
Once updated, just follow the instructions under "Compiling" and "Apply the kube-prometheus stack" to apply the changes to your cluster.
324
334
325
335
## Configuration
326
336
@@ -342,6 +352,7 @@ Configuration is mainly done in the `values` map. You can see this being used in
342
352
```
343
353
344
354
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:
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.
local kp = (import 'kube-prometheus/main.libsonnet') +
@@ -749,7 +760,7 @@ kube-state-metrics resource allocation is managed by
749
760
You can control it's parameters by setting variables in the
750
761
config. They default to:
751
762
752
-
```jsonnet
763
+
```jsonnet
753
764
kubeStateMetrics+:: {
754
765
baseCPU: '100m',
755
766
cpuPerNode: '2m',
@@ -759,11 +770,12 @@ config. They default to:
759
770
```
760
771
761
772
### Error retrieving kube-proxy metrics
773
+
762
774
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:
763
775
764
776
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
765
777
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
@@ -53,19 +53,19 @@ failed or because the main branch was already up-to-date.
53
53
The main branch of kube-prometheus should support the last 2 versions of
54
54
Kubernetes. We need to make sure that the CI on the main branch is testing the
55
55
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
57
57
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
59
59
the README should also be updated to reflect the CI changes.
60
60
61
61
## Create pull request to cut the release
62
62
63
63
### Pin Jsonnet dependencies
64
64
65
65
Pin jsonnet dependencies in
66
-
[jsonnetfile.json](/jsonnet/kube-prometheus/jsonnetfile.json). Each dependency
66
+
[jsonnetfile.json](jsonnet/kube-prometheus/jsonnetfile.json). Each dependency
67
67
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.
69
69
70
70
### Start with a fresh environment
71
71
@@ -87,14 +87,14 @@ make generate
87
87
88
88
### Update the compatibility matrix
89
89
90
-
Update the [compatibility matrix](/README.md#kubernetes-compatibility-matrix) in
90
+
Update the [compatibility matrix](README.md#kubernetes-compatibility-matrix) in
91
91
the README, by adding the new release based on the `main` branch compatibility
92
92
and removing the oldest release branch to only keep the latest 5 branches in the
93
93
matrix.
94
94
95
95
### Update changelog
96
96
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).
98
98
99
99
## Create release branch
100
100
@@ -111,10 +111,10 @@ the main branch to be in sync with the latest changes of its dependencies.
111
111
112
112
### Update CI workflow
113
113
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.
115
115
116
116
### Update Kubernetes versions used by kubeconform
117
117
118
118
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
Copy file name to clipboardExpand all lines: developer-workspace/README.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ After your workspace start, you can deploy a kube-prometheus inside a Kind clust
20
20
21
21
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.
22
22
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`.
24
24
25
25
## Gitpod
26
26
@@ -31,4 +31,3 @@ You can use the same workflow as mentioned in the [Codespaces](#codespaces) sect
31
31
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`
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).
6
6
7
-
You can monitor the `awscni` using kube-promethus with :
7
+
You can monitor the `awscni` using kube-promethus with :
0 commit comments