-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.txt
More file actions
94 lines (69 loc) · 2.67 KB
/
Copy pathinstall.txt
File metadata and controls
94 lines (69 loc) · 2.67 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
-----------------------------------
-----------------------------------
Docker:
0)Docker install:
just download dmg/tar/exe
1) Build docker image:
docker build -t latest .
2) List docker images
docker images
3) Run docker image:
docker run -dp 8080:8080 {image_id}
4) Docker running processes:
docker ps
5) Kill a specific process:
docker kill {container_id}
-----------------------------------
-----------------------------------
Minikube:
0)Minikube install
brew install minikube
1) Register minikube docker env
eval $(minikube -p minikube docker-env)
2) Create the deployments file (just the first time, then edit the pull policy)
kubectl create deployment worker-push-api-python --image=worker-push-api-python:latest -o yaml --dry-run > deployments.yaml
3) Docker build:
docker build -t latest .
4) Apply the deployments:
kubectl apply -f ./deployments.yaml
5) Port-Forwarding (in alternativa Service e load-balancing)
kubectl port-forward deployment/worker-push-api-python 8080:8080
6) Retrieve pod id:
kubectl get svc,pods -A -o wide
7) Pod logs:
kubectl logs -f {pod_id} (es.: worker-push-api-python-ff56c8b5f-6qgdn)
-----------------------------------
-----------------------------------
Helm:
1) Install Helm
brew install helm
-----------------------------------
-----------------------------------
Prometheus:
1) Add prometheus repo:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
2) Install Prometheus with Values-Prometheus.yaml file (into default namespace)
helm install prometheus prometheus-community/prometheus --namespace default -f ./values-prometheus.yaml
3) Exposing Prometheus web interface:
kubectl port-forward service/prometheus-server 8089:80
-----------------------------------
-----------------------------------
Grafana:
1) Add stable repo:
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
2) Install Grafana(into default namespace)
helm install grafana grafana/grafana
3) Exposing Grafana:
kubectl expose service grafana --type=NodePort --target-port=3000 --name=grafana-np
4) Retrieve Admin password(Grafana is password protected):
kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
5) Exposing Grafana web interface:
minikube service grafana-np
6) Get Grafana url and port forwarding:
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace default port-forward $POD_NAME 3000
&) Access Grafana UI (user "admin" and password retrieved on step 4):
http://127.0.0.1:3000
-----------------------------------