diff --git a/Grafana-Dashboard-ID-16734 b/Grafana-Dashboard-ID-16734 new file mode 100644 index 0000000..ffc3081 --- /dev/null +++ b/Grafana-Dashboard-ID-16734 @@ -0,0 +1,7 @@ +Use this VIdeo Tutorial Link for easy installation +https://www.youtube.com/watch?v=EeiYpnBHnhY&t=2147s + +Reminder: While installing these tools use a separate Namespace called Monitoring + +Use the below Dashboard ID to get a better visualization +16734 - Detailed metrics of each and every namespace and node and pod in the Aks cluster diff --git a/Installation/prometheus-setup-notice b/Installation/prometheus-setup-notice new file mode 100644 index 0000000..5b7fb40 --- /dev/null +++ b/Installation/prometheus-setup-notice @@ -0,0 +1,86 @@ +NAME: prometheus +LAST DEPLOYED: Thu Jul 4 12:24:58 2024 +NAMESPACE: monitoring +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster: +prometheus-server.monitoring.svc.cluster.local + + +Get the Prometheus server URL by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 9090 + + +The Prometheus alertmanager can be accessed via port 9093 on the following DNS name from within your cluster: +prometheus-alertmanager.monitoring.svc.cluster.local + + +Get the Alertmanager URL by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=alertmanager,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 9093 +################################################################################# +###### WARNING: Pod Security Policy has been disabled by default since ##### +###### it deprecated after k8s 1.25+. use ##### +###### (index .Values "prometheus-node-exporter" "rbac" ##### +###### . "pspEnabled") with (index .Values ##### +###### "prometheus-node-exporter" "rbac" "pspAnnotations") ##### +###### in case you still need it. ##### +################################################################################# + + +The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster: +prometheus-prometheus-pushgateway.monitoring.svc.cluster.local + + +Get the PushGateway URL by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus-pushgateway,component=pushgateway" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 9091 + +For more information on running Prometheus, visit: +https://prometheus.io/ + + + + + + + + + + + +NAME: grafana +URL : http://4.213.220.38:32381/login +User Name : pcsnsdluser +Password : PCSprograf@013 +Password: IgXI4F6UyGz0TUV73a86MxkAzV8gPq8NuJ4k96my +password retrieve command: kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo +Grafana bringup command: kubectl port-forward svc/grafana 3000:80 -n monitoring +To change the paswword: Use this command after entering into the grafana POD > grafana-cli admin reset-admin-password PCSprograf@013 + +LAST DEPLOYED: Thu Jul 4 12:42:03 2024 +NAMESPACE: monitoring +STATUS: deployed +REVISION: 1 +NOTES: +1. Get your 'admin' user password by running: + + kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo + + +2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster: + + grafana.monitoring.svc.cluster.local + + Get the Grafana URL to visit by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 3000 + +3. Login with the password from step 1 and the username: admin +################################################################################# +###### WARNING: Persistence is disabled!!! You will lose your data when ##### +###### the Grafana pod is terminated. ##### +################################################################################# diff --git a/Prometheus, Geafana Setup Notice b/Prometheus, Geafana Setup Notice new file mode 100644 index 0000000..5b7fb40 --- /dev/null +++ b/Prometheus, Geafana Setup Notice @@ -0,0 +1,86 @@ +NAME: prometheus +LAST DEPLOYED: Thu Jul 4 12:24:58 2024 +NAMESPACE: monitoring +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster: +prometheus-server.monitoring.svc.cluster.local + + +Get the Prometheus server URL by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 9090 + + +The Prometheus alertmanager can be accessed via port 9093 on the following DNS name from within your cluster: +prometheus-alertmanager.monitoring.svc.cluster.local + + +Get the Alertmanager URL by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=alertmanager,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 9093 +################################################################################# +###### WARNING: Pod Security Policy has been disabled by default since ##### +###### it deprecated after k8s 1.25+. use ##### +###### (index .Values "prometheus-node-exporter" "rbac" ##### +###### . "pspEnabled") with (index .Values ##### +###### "prometheus-node-exporter" "rbac" "pspAnnotations") ##### +###### in case you still need it. ##### +################################################################################# + + +The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster: +prometheus-prometheus-pushgateway.monitoring.svc.cluster.local + + +Get the PushGateway URL by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus-pushgateway,component=pushgateway" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 9091 + +For more information on running Prometheus, visit: +https://prometheus.io/ + + + + + + + + + + + +NAME: grafana +URL : http://4.213.220.38:32381/login +User Name : pcsnsdluser +Password : PCSprograf@013 +Password: IgXI4F6UyGz0TUV73a86MxkAzV8gPq8NuJ4k96my +password retrieve command: kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo +Grafana bringup command: kubectl port-forward svc/grafana 3000:80 -n monitoring +To change the paswword: Use this command after entering into the grafana POD > grafana-cli admin reset-admin-password PCSprograf@013 + +LAST DEPLOYED: Thu Jul 4 12:42:03 2024 +NAMESPACE: monitoring +STATUS: deployed +REVISION: 1 +NOTES: +1. Get your 'admin' user password by running: + + kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo + + +2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster: + + grafana.monitoring.svc.cluster.local + + Get the Grafana URL to visit by running these commands in the same shell: + export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace monitoring port-forward $POD_NAME 3000 + +3. Login with the password from step 1 and the username: admin +################################################################################# +###### WARNING: Persistence is disabled!!! You will lose your data when ##### +###### the Grafana pod is terminated. ##### +################################################################################# diff --git a/Rollbinding for Prometheus&Grafana b/Rollbinding for Prometheus&Grafana new file mode 100644 index 0000000..2eaf6fd --- /dev/null +++ b/Rollbinding for Prometheus&Grafana @@ -0,0 +1,33 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: prometheus-server +rules: +- apiGroups: [""] + resources: + - nodes + - nodes/proxy + - services + - endpoints + - pods + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: + - configmaps + verbs: ["get"] +- nonResourceURLs: ["/metrics"] + verbs: ["get"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: prometheus-server +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: prometheus-server +subjects: +- kind: ServiceAccount + name: prometheus-server + namespace: monitoring