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

Add documentation to install prometheus and grafana #2912

Merged
merged 1 commit into from
Aug 13, 2018

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Aug 8, 2018

No description provided.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 8, 2018
@codecov-io
Copy link

codecov-io commented Aug 8, 2018

Codecov Report

Merging #2912 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2912      +/-   ##
==========================================
+ Coverage   47.57%   47.59%   +0.01%     
==========================================
  Files          77       77              
  Lines        5528     5528              
==========================================
+ Hits         2630     2631       +1     
+ Misses       2559     2557       -2     
- Partials      339      340       +1
Impacted Files Coverage Δ
internal/watch/file_watcher.go 84.61% <0%> (+3.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c141e2b...322dae6. Read the comment docs.

Copy link
Contributor

@antoineco antoineco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly grammar comments

@@ -0,0 +1,161 @@
# Prometheus and Grafana installation

This tutorial will show you how to install [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/) for the metric scraping from the NGINX Ingress controller.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"for scraping the metrics of" sounds better to me


## Before You Begin

Now, deploy the Ingress controller following the instructions [here](../deploy/index.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's a prerequisite I'd change the imperative form "Now, ..." to "The NGINX Ingress controller should already be deployed according to the deployment instructions. See [Deployment] (...)"


Now, deploy the Ingress controller following the instructions [here](../deploy/index.md).

Note that the yaml files that are used in this tutorial, stored in [deploy/monitoring](https://github.com/kubernetes/ingress-nginx/tree/master/deploy/monitoring) folder in GitHub repository [kubernetes/ingress-nginx](https://github.com/kubernetes/ingress-nginx).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

", stored ..." -> "are stored in the ... folder of the GitHub repository"

Note that the yaml files that are used in this tutorial, stored in [deploy/monitoring](https://github.com/kubernetes/ingress-nginx/tree/master/deploy/monitoring) folder in GitHub repository [kubernetes/ingress-nginx](https://github.com/kubernetes/ingress-nginx).

## Deploy and configure Prometheus Server

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is needed to configure so that it can ..." -> "must be configured so that it can discover the Services endpoints."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"running in the cluster"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"no extra configuration is needed"

## Deploy and configure Prometheus Server

The Prometheus server is needed to configure so that it can discover endpoints of services. If a Prometheus server is already running in cluster and if it is configured in a way that it can discover service endpoints, no extra configuration will be needed.
If there is no existing Prometheus server running, rest of this tutorial will create a Prometheus server with appropriate configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the rest of this tutorial will guide you through the step needed to deploy a properly configured Prometheus server."


### Prometheus Dashboard

Now to open prometheus dashboard on Browser:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the Prometheus dashboard in a web browser"

10.192.0.2 10.192.0.3 10.192.0.4
```

Now, open your browser and go to the following URL: _http://{node IP address}:{prometheus-svc-nodeport}_ to visit Prometheus Dashboard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All instructions steps start with "Now, ". It would sound better to me with if sentences simply started with a verb (eg. "Open this", "Obtain that"), but just a personal note.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the Prometheus dashboard"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"visit the following URL"

emptyDir: {}
```

Now, run the following command to deploy prometheus in kubernetes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P rometheus
K ubernetes

Now obtain the IP address of the nodes in the cluster running:

```console
$ kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\"InternalIP\"\)].address}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super fancy 👍 But for a documentation page, which is supposed to be as clear as possible to all kind of users, wouldn't get nodes be sufficient?

grafana NodePort 10.98.233.86 <none> 9090:31086/TCP 10m
```

Now, open your browser and go to the following URL: _http://{node IP address}:{prometheus-svc-nodeport}_ to visit Prometheus Dashboard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"visit the following URL"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Prometheus" -> "Grafana"

@aledbf aledbf force-pushed the prometheus-grafana branch 2 times, most recently from 302e437 to 6a3b7dd Compare August 8, 2018 15:22

## Deploy and configure Prometheus Server

The Prometheus server is needed to configure so that it can discover endpoints of services. If a Prometheus server is already running in the cluster and if it is configured in a way that it can find the ingress controller pods, no extra configuration is needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is needed to configure" -> "must be configured "


The Prometheus server is needed to configure so that it can discover endpoints of services. If a Prometheus server is already running in the cluster and if it is configured in a way that it can find the ingress controller pods, no extra configuration is needed.

If there is no existing Prometheus server running, the rest of this tutorial will guide you through the step needed to deploy a properly configured Prometheus server.
Copy link
Contributor

@antoineco antoineco Aug 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step s
(my fault, missed it in my previous review comment)


The NGINX Ingress controller should already be deployed according to the deployment instructions [here](../deploy/index.md).

Note that the yaml files that are used in this tutorial, are stored in the [deploy/monitoring](https://github.com/kubernetes/ingress-nginx/tree/master/deploy/monitoring) folder of the GitHub repository [kubernetes/ingress-nginx](https://github.com/kubernetes/ingress-nginx).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit pick)

  • "that the yaml files that are used" -> "that the yaml files used"
  • ", are" (left over comma?)


The configuration file is provided by a `ConfigMap`.

```yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a dupe of deploy/monitoring/configuration.yaml, wouldn't it be better to just link it?


The next yaml snippet is used to deploy Prometheus in Kubernetes:

```yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a dupe of deploy/monitoring/prometheus.yaml, wouldn't it be better to just link it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

10.192.0.2 10.192.0.3 10.192.0.4
```

Open your browser and visit the following URL: _http://{node IP address}:{prometheus-svc-nodeport}_ to visit the Prometheus Dashboard.
Copy link
Contributor

@antoineco antoineco Aug 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"visit ... to visit" -> "visit ... to load"


This tutorial will show you how to install [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/) for scraping the metrics of the NGINX Ingress controller.

!!! Important: this example uses `emptyDir` volumes for Prometheus and Grafana. This means once the pod dies you will lose all the data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"dies" -> "gets terminated" ✝️


Open your browser and visit the following URL: _http://{node IP address}:{prometheus-svc-nodeport}_ to visit the Prometheus Dashboard.

According to the above example, this URL will be [http://10.192.0.3:32630](http://10.192.0.3:32630).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) [http://xxx](http://xxx) is the same as just http://xxx in markdown.

grafana NodePort 10.98.233.86 <none> 9090:31086/TCP 10m
```

Open your browser and visit the following URL: _http://{node IP address}:{grafana-svc-nodeport}_ to visit the Grafana Dashboard.
Copy link
Contributor

@antoineco antoineco Aug 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"visit ... to visit" -> "visit ... to load"

```

Open your browser and visit the following URL: _http://{node IP address}:{grafana-svc-nodeport}_ to visit the Grafana Dashboard.
According to the above example, this URL will be [http://10.192.0.3:31086](http://10.192.0.3:31086).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) [http://xxx](http://xxx) is the same as just http://xxx in markdown.

@aledbf aledbf force-pushed the prometheus-grafana branch 2 times, most recently from 4553563 to d23ce34 Compare August 8, 2018 22:42
@aledbf aledbf changed the title WIP: Add documentation to install prometheus and grafana Add documentation to install prometheus and grafana Aug 9, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 9, 2018
@aledbf
Copy link
Member Author

aledbf commented Aug 13, 2018

@antoineco is this ok to merge?

@antoineco
Copy link
Contributor

Oh, sure. Missed the label removal, sorry!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 13, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, antoineco

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 01cc29e into kubernetes:master Aug 13, 2018
@aledbf aledbf deleted the prometheus-grafana branch August 15, 2018 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants