• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DigitalOcean Kubernetes Cluster Monitoring Quickstart

DigitalOcean Kubernetes Cluster Monitoring Quickstart

This repository accompanies the How to Set Up a Prometheus, Grafana and Alertmanager Monitoring Stack on DigitalOcean Kubernetes Community tutorial. To learn more about the stack components, their Kubernetes manifests, and how to configure them, consult the accompanying tutorial.

About this Repo

The DigitalOcean Kubernetes Cluster Monitoring Quickstart repository contains Kubernetes manifests and setup instructions for a preconfigured DigitalOcean Kubernetes cluster monitoring stack. The stack consists of the following monitoring, scraping, and visualization components:

Deploying the Monitoring Stack

Before you begin, you'll need the following tools installed in your local development environment:

  • The kubectl command-line interface installed on your local machine and configured to connect to your cluster. You can read more about installing and configuring kubectl in its official documentation.
  • The git version control system installed on your local machine. To learn how to install git on Ubuntu 18.04, consult How To Install Git on Ubuntu 18.04
  • The Coreutils base64 tool installed on your local machine. If you're using a Linux machine, this will most likely already be installed. If you're using OS X, you can use openssl base64, which comes installed by default.

To start, clone this repo on your local machine:

git clone [email protected]:do-community/doks-monitoring.git

Next, move into the cloned repository:

cd doks-monitoring

Set the APP_INSTANCE_NAME and NAMESPACE environment variables, which will be used to configure a unique name for the stack's components and configure the Namespace into which the stack will be deployed:

export APP_INSTANCE_NAME=sammy-cluster-monitoring
export NAMESPACE=default

Use the base64 command to base64-encode a secure Grafana password of your choosing:

export GRAFANA_GENERATED_PASSWORD="$(echo -n 'your_grafana_password' | base64)"

If you're using OS X, you can use the openssl base64 command which comes installed by default.

If you'd like to deploy the stack into a Namespace other thandefault, run the following command to create a new Namespace:

kubectl create namespace "$NAMESPACE"

Now, use awk and envsubst to fill in the APP_INSTANCE_NAME, NAMESPACE, and GRAFANA_GENERATED_PASSWORD variables in the repo's manifest files. After substituting in the variable values, the files will be combined into a master manifest file called $APP_INSTANCE_NAME_manifest.yaml.

awk 'FNR==1 {print "---"}{print}' manifest/* \
 | envsubst '$APP_INSTANCE_NAME $NAMESPACE $GRAFANA_GENERATED_PASSWORD' \
 > "${APP_INSTANCE_NAME}_manifest.yaml"

Now, use kubectl apply -f to apply the manifest and create the stack in the Namespace you configured:

kubectl apply -f "${APP_INSTANCE_NAME}_manifest.yaml" --namespace "${NAMESPACE}"

You can use kubectl get all to monitor deployment status.

Viewing the Grafana Dashboards

Once the stack is up and running, you can access Grafana by either patching the Grafana ClusterIP Service to create a DigitalOcean Load Balancer, or by forwarding a local port.

Exposing the Grafana Service using a Load Balancer

To create a LoadBalancer Service for Grafana, use kubectl patch to update the existing Grafana Service in-place:

kubectl patch svc "$APP_INSTANCE_NAME-grafana" \
  --namespace "$NAMESPACE" \
  -p '{"spec": {"type": "LoadBalancer"}}'

Once the DigitalOcean Load Balancer has been created and assigned an external IP address, you can fetch this external IP using the following commands:

SERVICE_IP=$(kubectl get svc $APP_INSTANCE_NAME-grafana \
  --namespace $NAMESPACE \
  --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "http://${SERVICE_IP}/"

Forwarding a Local Port to Access the Grafana Service

If you don't want to expose the Grafana Service externally, you can also forward local port 3000 into the cluster using kubectl port-forward. To learn more about forwarding ports into a Kubernetes cluster, consult Use Port Forwarding to Access Applications in a Cluster.

kubectl port-forward --namespace ${NAMESPACE} ${APP_INSTANCE_NAME}-grafana-0 3000

You can now access the Grafana UI locally at http://localhost:3000/.

At this point, you should be able to access the Grafana UI. To log in, use the default username admin (if you haven't modified the admin-user parameter), and password you configured above.

Attribution

The manifests in this repo are heavily based on and modified from Google Cloud Platform's click-to-deploy Prometheus solution. A manifest of modifications (changes.md) is included in this repo.

More Repositories

1

ansible-playbooks

Playbooks for automating server procedures based on our Community guides
513
star
2

cloud_haiku

Community-made poetry about infrastructure
HTML
218
star
3

travellist-laravel-demo

Laravel Demo Application
PHP
170
star
4

example-doctl-action

GitHub Actions for DigitalOcean Example Workflow
HTML
168
star
5

terraform-sample-digitalocean-architectures

Deployable Production Cloud Architectures for use on DigitalOcean via Terraform
HCL
160
star
6

automated-setups

Automated versions of common server setups
Shell
146
star
7

do-article-templates

Markdown templates for DO Community Authors
144
star
8

django-todo-react

JavaScript
119
star
9

dns-tool

A set of browser-based DNS tools for DigitalOcean Community.
Vue
97
star
10

ansible-laravel-demo

Ansible + Laravel Demo
PHP
79
star
11

terraform-ansible-demo

Use Terraform and Ansible to launch and configure demo infrastructure on DigitalOcean
HCL
59
star
12

ubuntu-1604-mysql-backup

This repository contains a few scripts for automating backups with Percona Xtrabackup and Innobackupex
Shell
56
star
13

python-doctl

A Python wrapper for the Digital Ocean CLI utility — doctl.
Python
49
star
14

functions-resources

Resources for using DigitalOcean Cloud Functions
47
star
15

react-hooks-timer

Finished and updated code for the Countdown Timer with React Hooks tutorial.
JavaScript
45
star
16

rss-reader-api

RSS Reader API written in Django Rest
Python
43
star
17

dolphin

PHP-based CLI tool for managing DO servers
PHP
43
star
18

do-ansible-inventory

📗 a tool to generate Ansible inventories of DigitalOcean Droplets
Go
42
star
19

django-polls

Django Tutorial Polls App
Python
40
star
20

kubernetes-challenge

A repository of projects from the 2021 DigitalOcean Kubernetes Challenge
36
star
21

hacktoberfest-repo-topic-apply

Cmd line tool to add a topic to your github repo, defaults to hacktoberfest
Go
36
star
22

css-parallax-scrolling-chrome

Code example for Pure-CSS Parallax Scrolling Effect in Chrome
CSS
35
star
23

building-a-tabs-component-react

Source code for the "Building a Tabs Component with React" article.
JavaScript
33
star
24

ansible-practice

Playbook examples to demonstrate basic concepts when writing Ansible playbooks.
HTML
31
star
25

landing-laravel

A demo Laravel 8 + Docker Compose application
PHP
31
star
26

developer-glossary

A community-built glossary of technical terms.
HTML
26
star
27

k8s-intro-meetup-kit

"Getting Started with Containers and Kubernetes" Meetup Kit Demo Code
Python
25
star
28

ejs-demo

Demo of ejs templates for node apps, covered here: https://www.digitalocean.com/community/tutorials/how-to-use-ejs-to-template-your-node-application
HTML
25
star
29

glob-tool

A tool to test globs against sets of test strings quickly and easily for the DigitalOcean Community.
Vue
23
star
30

minify-tool

A web tool for the DigitalOcean Community to quickly minify JavaScript files
Vue
19
star
31

rss-reader-frontend

JavaScript
18
star
32

blog-strapi

JavaScript
16
star
33

creatorlinks

An open source, self-hosted links landing page
PHP
16
star
34

mongodb-resources

Resources for using MongoDB on DigitalOcean
16
star
35

bandwidth-tool

A tool to help calculate and explain bandwidth allowances for Droplets on DigitalOcean.
Vue
16
star
36

do-bulma

Customized Bulma styling for DigitalOcean Community tools.
SCSS
15
star
37

python3_web_api_tutorial

Python
12
star
38

diagram-tool

🚧 A tool to design infrastructure diagrams.
JavaScript
12
star
39

hub-for-good-list

A collection of projects making an impact with Hollie's Hub for Good.
Vue
12
star
40

kubernetes-tool

🚧 A tool to explain Kubernetes files and Helm charts for the DigitalOcean Community.
TypeScript
10
star
41

laravel-tailwind-starter

A demo Laravel application with Tailwind CSS
PHP
10
star
42

html_demo_site

A demo site for the How To Build a Website With HTML tutorial series
HTML
9
star
43

do-blueprint-cachet

Blueprint for setting up the Cachet status page app w/ MySQL database
HCL
9
star
44

MySocialNetwork

Tutorial code for "How To Use Routing with React Navigation in React Native" and "Introduction to Using Redux in a React Native App".
Java
8
star
45

sample-yarn-lerna-monorepo

JavaScript
8
star
46

do-blueprint-nodeapp

Blueprint for node.js application
Python
8
star
47

kubectl-doweb

a kubectl plugin for opening the control panel page of DigitalOcean resources directly in your web browser
Go
7
star
48

ansible-role-mysql

Ansible role to set up MySQL group replication
SQLPL
7
star
49

OSS-2022-Getting-Started-With-Kubernetes

A repo for the OSS 2022 Tutorial Getting Started with Kubernetes
Python
7
star
50

url-shortener-api

An API for creating quick links
Python
6
star
51

python-ots-api

A One Time Secret API implemented using Flask and Redis
Python
6
star
52

do-vue

Custom Vue templates & resources for DigitalOcean Community tools.
JavaScript
6
star
53

available-images

A simple list of all images available on DigitalOcean.
Vue
6
star
54

sysadminday

Microsite for sysadminday.digitalocean.com (and sysadmin.love)
JavaScript
6
star
55

hacktober-board

Hacktoberfest Board
PHP
6
star
56

do-disposable

Allows you to create a disposable droplet with a simple CLI interface.
Go
5
star
57

example-k8s-workloads

Example workloads to practice deploying to Kubernetes
Go
5
star
58

ansible-role-proxysql

Ansible role to set up ProxySQL for MySQL group replication hosts
5
star
59

do-blueprint-mysqlgrouprepl

Blueprint for setting up MySQL group replication with ProxySQL to route queries
HCL
5
star
60

learning-labs

LearningLabs is a Shark-a-Hack 2021-Q1 Project
CSS
5
star
61

do-moderator-toolbox

A useful set of moderator tools for the DO Community team.
Vue
5
star
62

node-express-api

JavaScript
4
star
63

docker-bp-commands

Dockerfile for running Terraform, Ansible, and doctl
4
star
64

rss-reader-app-platform-spec

The spec file and deployment instructions for the RSS Reader App
4
star
65

ansible-role-cachet

Ansible role to set up the Cachet open source status page app
PHP
4
star
66

sample-yarn-workspaces-monorepo

JavaScript
4
star
67

suggestkit

SuggestKit is a high performance suggestion engine which can scale without losing too much performance.
TypeScript
3
star
68

suggestkit-react

An implementation of SuggestKit in React.
JavaScript
3
star
69

blog-next

JavaScript
3
star
70

do-function-openai

JavaScript
3
star
71

hapi-example

Hapi.js Example for tutorial
JavaScript
3
star
72

summer-of-kubernetes

Step-by-step instructions for the 2021 Summer of Kubernetes session with Ambassador Labs
3
star
73

demo-app

HCL
3
star
74

freebsd-do-kernel

A custom DigitalOcean FreeBSD kernel configuration.
2
star
75

deploy-to-do-button-generator

JavaScript
2
star
76

dns-tool-embed

A portable, embeddable version of the DO Community DNS Lookup tool.
JavaScript
2
star
77

do_api_proxy

A Node.JS proxy for making requests to the DigitalOcean API from client-side apps so you don't expose your API key.
JavaScript
2
star
78

jamstack-blog-strapi

JavaScript
1
star
79

glob-tool-embed

A portable, embeddable version of the DO Community Glob tool.
JavaScript
1
star
80

suggestkit-vue

An implementation of SuggestKit in Vue.
Vue
1
star
81

project-archipelago-go-backend

Go
1
star
82

osiboard

Open Source Issues Board
1
star
83

jamstack-blog-nextjs

JavaScript
1
star
84

pulumi-kubernetes

TypeScript
1
star
85

one-time-secret-frontend

Created with CodeSandbox
JavaScript
1
star
86

k8s-iac-security-workshop

Mustache
1
star