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
description: "One page summary of how to start a new Doks project."
4
-
lead: "One page summary of how to start a new Doks project."
3
+
description: "One page summary of how to start with the Prometheus Operator and kube-prometheus."
4
+
lead: "One page summary of how to start with the Prometheus Operator and kube-prometheus."
5
5
date: 2020-11-16T13:59:39+01:00
6
-
lastmod: 2020-11-16T13:59:39+01:00
7
6
draft: false
8
7
images: []
9
8
menu:
@@ -15,42 +14,90 @@ toc: true
15
14
16
15
## Requirements
17
16
18
-
Doks uses npm to install dependencies and run commands. Installing npm is pretty simple. Download and install [Node.js](https://nodejs.org/) (it includes npm) for your platform.
17
+
The easiest way of starting with the Prometheus Operator is by deploying it as part of kube-prometheus.
18
+
kube-prometheus deploys the Prometheus Operator and already schedules a Prometheus called `prometheus-k8s` with alerts and rules by default.
19
19
20
-
## Start a new Doks project
20
+
All you need is access to a **Kubernetes cluster with kubectl!**
21
21
22
-
Create a new site, change directories, install dependencies, and start development server.
22
+
<!-- TODO: Reference the deploy kube-prometheus to kind tutorial once available -->
23
23
24
-
### Create a new site
24
+
> Note: For versions before Kubernetes v1.20.z refer to the [Kubernetes compatibility matrix](https://github.com/prometheus-operator/kube-prometheus#kubernetes-compatibility-matrix) in order to choose a compatible branch.
For a quick start we are going to deploy a cmopiled version of the Kubernetes [manifests](https://github.com/prometheus-operator/kube-prometheus/tree/main/manifests).
29
+
30
+
You can either clone the kube-prometheus from GitHub
Once you have the files on your machine change into the project's root directory.
35
41
36
-
```bash
37
-
cd my-doks-site
42
+
## Deploy kube-prometheus
43
+
44
+
```shell
45
+
# Create the namespace and CRDs, and then wait for them to be availble before creating the remaining resources
46
+
kubectl create -f manifests/setup
47
+
until kubectl get servicemonitors --all-namespaces ;do date; sleep 1;echo"";done
48
+
kubectl create -f manifests/
38
49
```
39
50
40
-
### Install dependencies
51
+
We create the namespace and CustomResourceDefinitions first to avoid race conditions when deploying the monitoring components.
52
+
Alternatively, the resources in both folders can be applied with a single command `kubectl create -f manifests/setup -f manifests`,
53
+
but it may be necessary to run the command multiple times for all components to be created successfullly.
54
+
55
+
## Access Prometheus
41
56
42
-
{{< btn-copy text="npm install" >}}
57
+
Prometheus, Alertmanager, and Grafana dashboards can be accessed quickly using `kubectl port-forward` after running the quickstart via the commands below.
43
58
44
-
```bash
45
-
npm install
59
+
You can also learn how to [expose via an Ingress →]({{< ref "docs/exposing-prometheus-alertmanager-grafana-ingress" >}})
0 commit comments