This repository was archived by the owner on Jun 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathdemo-script.sh
More file actions
76 lines (48 loc) · 1.76 KB
/
Copy pathdemo-script.sh
File metadata and controls
76 lines (48 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# script for minikube demo
# install xhyve driver - less resource overhead for the vm
# https://github.com/kubernetes/minikube/blob/master/DRIVERS.md#xhyve-driver
brew install docker-machine-driver-xhyve
# install minikube
# https://github.com/kubernetes/minikube/releases
# create a cluster. driver is important!
minikube start --vm-driver=xhyve
# install kubectl
brew install kubectl
# check that cluster is working
kubectl config set-context minikube
kubectl get componentstatus
kubectl cluster-info
# deploy an application and a service
# describe a namespace, deployment, and a service
kubectl create -f monitoring-namespace.yaml
kubectl create -f prometheus-config.yaml
kubectl create -f prometheus-deployment.yaml
kubectl create -f prometheus-service.yaml
# view via CLI:
kubectl get services --namespace=monitoring
kubectl get deployments --namespace=monitoring
# show the dashboard
minikube dashboard
# show node ports under services for prometheus. exposes
# show prometheus service
minikube service --namespace=monitoring prometheus
# click around
# show /targets
# show graph and query of container_memory_usage_bytes{kubernetes_namespace="monitoring"}
# deploy grafana
kubectl create -f grafana-deployment.yaml
kubectl create -f grafana-service.yaml
# show grafana
minikube service --namespace=monitoring grafana
# add datasource. make sure type is prometheus http://prometheus:8080
# describe kubernetes DNS
# create a graph:
# container_memory_usage_bytes{kubernetes_namespace="monitoring"}
# {{kubernetes_pod_name}
# lets add node metrics
# deploy node exporter. explain daemonser
kubectl create -f node-exporter-daemonset.yml
# show new target in prometheus. explain it autodiscovering the pods
# now create a graph
# node_load1
# {{kubernetes_pod_node_name}}