Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This repository contains the assets for the tutorial on how to collect metrics from your Kubernetes cluster.

NotificationsYou must be signed in to change notification settings

isItObservable/Episode1---Kubernetes-Prometheus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This repository is here to guide you through the GitHub tutorial that goes hand-in-hand with a video available on YouTube and a detailed blog post on my website.Together, these resources are designed to give you a complete understanding of the topic.

Here are the links to the related assets:

Feel free to explore the materials, star the repository, and follow along at your own pace.

K8s and Prometheus

Prometheus Logo

This repository showcases the usage of Prometheus by using GKE with the HipsterShop

Prerequisite

The following tools need to be installed on your machine :

  • jq
  • kubectl
  • git
  • gcloud (if you're using GKE)
  • Helm

1.Create a Google Cloud Platform Project

PROJECT_ID="<your-project-id>"gcloud services enable container.googleapis.com --project ${PROJECT_ID}gcloud services enable monitoring.googleapis.com \cloudtrace.googleapis.com \clouddebugger.googleapis.com \cloudprofiler.googleapis.com \--project ${PROJECT_ID}

2.Create a GKE cluster

ZONE=us-central1-bgcloud containr clusters create isitobservable \--project=${PROJECT_ID} --zone=${ZONE} \--machine-type=e2-standard-2 --num-nodes=4

3.Clone Github repo

git clone https://github.com/isItObservable/Episode1---Kubernetes-Prometheuscd Episode1---Kubernetes-Prometheus

4. Deploy Prometheus

HipsterShop

cd hipstershop./setup.sh

Prometheus

helm install prometheus stable/prometheus-operator

Expose Grafana

kubectl get svckubectl edit svc prometheus-grafana

change to type NodePort

apiVersion:v1kind:Servicemetadata:annotations:meta.helm.sh/release-name:prometheusmeta.helm.sh/release-namespace:defaultlabels:app.kubernetes.io/instance:prometheusapp.kubernetes.io/managed-by:Helmapp.kubernetes.io/name:grafanaapp.kubernetes.io/version:7.0.3helm.sh/chart:grafana-5.3.0name:prometheus-grafananamespace:defaultresourceVersion:"89873265"selfLink:/api/v1/namespaces/default/services/prometheus-grafanaspec:clusterIP:IPADRESSSexternalTrafficPolicy:Clusterports:  -name:servicenodePort:30806port:80protocol:TCPtargetPort:3000selector:app.kubernetes.io/instance:prometheusapp.kubernetes.io/name:grafanasessionAffinity:Nonetype:NodePortstatus:loadBalancer:{}

Deploy the ingress by making sure to replace the service name of your Grafana

cd ..\grafanakubectl apply -f ingress.yaml

Get the login user and password of Grafana

  • For the password :
kubectl get secret --namespace default prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 --decode
  • For the login user:
kubectl get secret --namespace default prometheus-grafana -o jsonpath="{.data.admin-user}" | base64 --decode

About

This repository contains the assets for the tutorial on how to collect metrics from your Kubernetes cluster.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp