{"id":13062,"date":"2022-07-11T09:54:01","date_gmt":"2022-07-11T09:54:01","guid":{"rendered":"https:\/\/blog.cloudthat.com\/?p=13062"},"modified":"2024-06-25T10:57:37","modified_gmt":"2024-06-25T10:57:37","slug":"achieve-increased-visibility-of-aws-eks-cluster","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/detailed-guide-to-achieve-increased-visibility-of-aws-eks-cluster","title":{"rendered":"Detailed Guide to Achieve Increased Visibility of AWS EKS Cluster"},"content":{"rendered":"<table border=\"0\">\n<tbody>\n<tr>\n<td>\n<h2><span style=\"color: #000080;\"><strong>TABLE OF CONTENT<\/strong><\/span><\/h2>\n<\/td>\n<\/tr>\n<tr>\n<td><a href=\"#introductionprometheus\">1. Introduction to Prometheus<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#introductiongrafana\">2. Introduction to Grafana<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#toolsandservices\">3. Tools and Services Used<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#setuponaws\">4. Set up on AWS before Installing Prometheus<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#installingmetrics\">5. Installing Metrics Server on EKS<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#installingprometheus\">6. Installing &amp; Setting up Prometheus using Helm<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#installinggrafana\">7. Installing &amp; Setting up Grafana<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#integratingprometheus\">8. Integrating Prometheus with Grafana<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#monitoringandvisualizing\">9. Monitoring &amp; Visualizing using Grafana<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#aboutcloudthat\">10. About CloudThat <\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2 id=\"introductionprometheus\"><strong>Introduction to Prometheus:<\/strong><\/h2>\n<p><span style=\"color: #000000;\">Prometheus is an open-source monitoring and alerting tool used to monitor the resource utilization and health of resources running on-premises and on various cloud platforms. Conceptualized and built at SoundCloud, <a href=\"https:\/\/blog.cloudthat.com\/everything-about-prometheus\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=everything-about-prometheus\" target=\"_blank\" rel=\"noopener\"><strong>Prometheus<\/strong> <\/a>has been in the market since early 2012. Many organizations have integrated Prometheus into their environment due to its ease of use and cost. It is constantly being updated\/upgraded by a robust community of developers and a vast user base. In 2016, Prometheus joined the CNCF community, which also governs Kubernetes.<\/span><\/p>\n<p><span style=\"color: #000000;\">Metrics are essential in understanding the resource utilization by host machines and applications, which help businesses do the right Capacity Planning, reduce user latency, avoid downtime of their applications, and design highly available &amp; load-balanced infrastructure. Time Series metrics allow measuring various resource consumption like CPU, Memory, R\/W, IOPS, and Network in &amp; out traffic over periodic intervals. Numerous applications offer to monitor the \u201cTime Series\u201d data; Prometheus is at the forefront of these applications.<\/span><\/p>\n<h3><strong><span style=\"color: #000000;\">a) Features of Prometheus<\/span><\/strong><\/h3>\n<ul>\n<li><span style=\"color: #000000;\">Prometheus comes with its language called \u201cPromQL\u201d to query the metrics it scrapes from various sources.<\/span><\/li>\n<li><span style=\"color: #000000;\">Metrics collected by Prometheus are name-based or as key-value pairs (labels)<\/span><\/li>\n<li><span style=\"color: #000000;\">Setting up a Prometheus metrics server is very simple; it can be run as a single node or can be run as federated servers.<\/span><\/li>\n<li><span style=\"color: #000000;\">Target endpoints can be added to Prometheus via Service Discovery, using node exporters, through static configuration, or client libraries<\/span><\/li>\n<li><span style=\"color: #000000;\">Once Prometheus has been set up on a server that scrapes data from backend targets, the collected metrics can be visualized on <a href=\"http:\/\/localhost:9090\/graph.\" target=\"_blank\" rel=\"noopener\">\u201cExpression Browser\u201d.<\/a><\/span><\/li>\n<\/ul>\n<h3><strong><span style=\"color: #000000;\">b) Prometheus Architecture<\/span><\/strong><\/h3>\n<p><span style=\"color: #000000;\">Prometheus mostly works through a Pull-based model of gathering data exposed via HTTP endpoints of the targets. A push-based data gathering can be achieved through a Push-gateway setup. Prometheus architecture can be divided into five components.<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">The central <strong>Prometheus Server<\/strong>\u00a0is the heart of the monitoring system.<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Targets:<\/strong> which are the producers of metrics, the metric data on them are exposed to the Prometheus Server via Client Libraries. (To access application code-related metrics available in multiple supported languages. These libraries format the metrics in Prometheus readable form), Exporters (are used when the application source code is not accessible, they live alongside the application. Ex: Database Exporter, Node Exporter for host stats, HaProxy Exporter for storage, messaging &amp; HTTP).<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Service Discovery:<\/strong> a mechanism for discovering services like EC2 instances and K8S on the cloud and scraping data from them.<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Storage:<\/strong> Prometheus persists the data on the local host or in a cloud environment; an external persistent storage volume can be used.<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Alerting &amp; Visualizing:<\/strong> The expression browser is a web-based UI where these metrics can be visualized in a central location. Using the Alertmanager component of Prometheus, alerts can be set and managed.<\/span><\/li>\n<\/ul>\n<h2><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13066\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS1.png\" alt=\"AWS EKS\" width=\"555\" height=\"352\" \/><\/a><\/h2>\n<h2 id=\"introductiongrafana\"><strong>Introduction to Grafana:<\/strong><\/h2>\n<p><span style=\"color: #000000;\">Since its inception in 2014, <a href=\"https:\/\/blog.cloudthat.com\/integration-and-visualization-of-prometheus-metrics-in-grafana\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=\/integration-and-visualization-of-prometheus-metrics-in-grafana\" target=\"_blank\" rel=\"noopener\"><strong>Grafana<\/strong> <\/a>has become the de-facto open-source Alerting and Visualization tool for organizations. The main feature of Grafana that makes it stand out is that the data source for Grafana can reside anywhere and everything can be gathered and visualized on a single dashboard. Grafana offers a wide variety of options for ready templates based on the tools or services being used and the panels on each of the templates are also customizable. These dynamic dashboards can be shared with team members for collaborative visualization and can be securely accessed by an admin user using passwords or security tokens.<\/span><\/p>\n<p><span style=\"color: #000000;\">Grafana can easily integrate with many third-party tools like Graphite, Prometheus, Influx DB, ElasticSearch, MySQL, and PostgreSQL using plugins. Grafana can be accessed on a <a href=\"http:\/\/localhost:3000\" target=\"_blank\" rel=\"noopener\"><strong>web browser<\/strong><\/a>. Grafana provides access to real-time streaming data from various sources and this data can be visualized using charts, bar\/line graphs, histograms, and pie charts. Using the same query language of the source, Grafana collects data sets from the source for visualization.<\/span><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS2.png.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13067\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS2.png.jpg\" alt=\"AWS EKS\" width=\"588\" height=\"367\" \/><\/a><\/p>\n<h2 id=\"toolsandservices\"><strong>Tools &amp; Services Used:<\/strong><\/h2>\n<ol>\n<li><span style=\"color: #000000;\">AWS account with Admin Permissions<\/span><\/li>\n<li><span style=\"color: #000000;\">IAM Roles<\/span><\/li>\n<li><span style=\"color: #000000;\">VPC, Subnets, Security Groups (Egress permissions)<\/span><\/li>\n<li><span style=\"color: #000000;\">EKS Cluster<\/span><\/li>\n<li><span style=\"color: #000000;\">Managed Node Group (Linux)<\/span><\/li>\n<li><span style=\"color: #000000;\">AWS CLI<\/span><\/li>\n<li><span style=\"color: #000000;\">eksctl<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl<\/span><\/li>\n<li><span style=\"color: #000000;\">helm<\/span><\/li>\n<li><span style=\"color: #000000;\">metrics server<\/span><\/li>\n<li><span style=\"color: #000000;\">Prometheus<\/span><\/li>\n<li><span style=\"color: #000000;\">Grafana<\/span><\/li>\n<\/ol>\n<h2 id=\"setuponaws\"><strong>Set-up on AWS before Installing Prometheus:<\/strong><\/h2>\n<p><span style=\"color: #000000;\">On AWS sign-in using non-root account User credentials with <strong>\u201cAdministratorAccess\u201d<\/strong> to create IAM roles &amp; policies for accessing &amp; managing other AWS resources.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong><u>a) IAM Roles to be created: <\/u><\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">On the IAM service page, create the following roles for EKS Cluster and Node groups to access other AWS resources\/services. The \u201cTrusted Entity Type\u201d needs to be \u201cAWS service\u201d. Under \u201cUse Case\u201d, type \u201cEKS\u201d and create the below roles:<\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\"><strong><em>For EKS Cluster<\/em><\/strong>: select \u201cEKS-Cluster\u201d as the \u201cUse Case\u201d. Give a unique name \u201cEksClusterRole\u201d and create the role. The \u201cAmazonEKSClusterPolicy\u201d policy gets attached to this role.<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong><em>For Managed Node Group<\/em><\/strong>: 3 sets of Permissions need to be assigned. Here the \u201cUse Case\u201d is \u201cEC2\u201d.<\/span><\/li>\n<\/ol>\n<ol>\n<li><span style=\"color: #000000;\">AmazonEKSWorkerNodePolicy<\/span><\/li>\n<li><span style=\"color: #000000;\">AmazonEC2ContainerRegistryReadOnly<\/span><\/li>\n<li><span style=\"color: #000000;\">AmazonEKS_CNI_Policy<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000;\">Give the role a unique name: \u201cAmazonEKSNodeRole\u201d and create the role.<\/span><\/p>\n<p><span style=\"color: #000000;\">Apart from the above policies, many other policies get created while creating the Managed Node Group and installing other Tools like Helm, Prometheus &amp; Grafana, which AWS automatically creates for us.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong><u>b) Creating VPC, Subnet &amp; Security Groups: <\/u><\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Default VPC, Subnet, and Security Groups can be used while creating an EKS Cluster. However, as security best practice, it is always good to create custom VPC, Subnet &amp; SG\u2019s with specific IP ranges, Ingress &amp; Egress. With custom VPC, Internet Gateway and Route table need to be created and attached to the VPC<u>.<\/u><\/span><\/p>\n<p><span style=\"color: #000000;\"><strong><u>c) Creating EKS Cluster:<\/u><\/strong><\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\">Give a unique name to cluster, \u201ceks-prometheus-cls\u201d<\/span><\/li>\n<li><span style=\"color: #000000;\">Let the version be set to default 1.22.<\/span><\/li>\n<\/ol>\n<ul>\n<li><span style=\"color: #000000;\">Select the \u201cEksClusterRole\u201d created earlier.<\/span><\/li>\n<\/ul>\n<ol>\n<li><span style=\"color: #000000;\">Leave all other options to default. Tag the resource as per your business use case.<\/span><\/li>\n<li><span style=\"color: #000000;\">Select the default\/custom VPC, Subnet (atleast 2 subnets are needed) and Security Group from the drop-down.<\/span><\/li>\n<li><span style=\"color: #000000;\">Specify IP range for your Kubernetes services (Optional)<\/span><\/li>\n<\/ol>\n<ul>\n<li><span style=\"color: #000000;\">Set the \u201cCluster Endpoint access\u201d to \u201cPublic\u201d<\/span><\/li>\n<li><span style=\"color: #000000;\">Leave the VPC-CNI, CoreDNS &amp; kube-proxy to default versions.<\/span><\/li>\n<\/ul>\n<ol>\n<li><span style=\"color: #000000;\">Leave all the Control-plane logging options turned-off.<\/span><\/li>\n<li><span style=\"color: #000000;\">Review &amp; Create the EKS Cluster.<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000;\"><strong><u>d) Adding Managed Linux Node Group to EKS Cluster:<\/u><\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Once the EKS cluster is created and shows as \u201cActive\u201d, We can now add Managed node groups (worker nodes) to the cluster.<\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\">Under Eks Cluster \u201cCompute\u201d section, Click on \u201cCreate a Node Group\u201d<\/span><\/li>\n<li><span style=\"color: #000000;\">Give a unique name to the node, \u201ceks-prometheus-nodegroup\u201d.<\/span><\/li>\n<\/ol>\n<ul>\n<li><span style=\"color: #000000;\">Select \u201cNode IAM role\u201d that was created earlier \u201cEksNodeRole\u201d<\/span><\/li>\n<\/ul>\n<ol>\n<li><span style=\"color: #000000;\">Leave all the other settings as it is and click next.<\/span><\/li>\n<li><span style=\"color: #000000;\">Under the \u201cNode group compute configuration\u201d, select\u201d<\/span>\n<ol>\n<li><span style=\"color: #000000;\">AMI Type: Amazon Linux 2<\/span><\/li>\n<li><span style=\"color: #000000;\">Capacity: On-demand<\/span><\/li>\n<li><span style=\"color: #000000;\">Instance types: t3.medium<\/span><\/li>\n<li><span style=\"color: #000000;\">Disk size: 20 GiB<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"color: #000000;\">Under the \u201cNode group scaling configuration\u201d:<\/span>\n<ol>\n<li><span style=\"color: #000000;\">Set the minimum, maximum &amp; desired size to 2<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ul>\n<li><span style=\"color: #000000;\">Under the \u201cNode group update configuration\u201d, select:<\/span>\n<ol>\n<li><span style=\"color: #000000;\">Maximum unavailable: Number<\/span><\/li>\n<li><span style=\"color: #000000;\">Value: 1 node<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"color: #000000;\">Select the Subnets where the node will run.<\/span><\/li>\n<\/ul>\n<ol>\n<li><span style=\"color: #000000;\">Configure SSH access to the worker nodes (optional)<\/span><\/li>\n<li><span style=\"color: #000000;\">Review and Create the Managed Node group.<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000;\"><strong><u>e) Installing aws cli:<\/u><\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">curl &#8220;https:\/\/awscli.amazonaws.com\/awscli-exe-linux-x86_64.zip&#8221; -o &#8220;awscliv2.zip&#8221;<\/span><\/li>\n<li><span style=\"color: #000000;\">unzip awscliv2.zip<\/span><\/li>\n<li><span style=\"color: #000000;\">sudo .\/aws\/install<\/span><\/li>\n<li><span style=\"color: #000000;\">.\/aws\/install -i \/usr\/local\/aws-cli -b \/usr\/local\/bin &#8211;update<\/span><\/li>\n<li><span style=\"color: #000000;\">aws &#8211;version<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\"><strong><u>f) Installing kubectl:<\/u><\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">curl -o kubectl https:\/\/s3.us-west-2.amazonaws.com\/amazon-eks\/1.22.6\/2022-03-09\/bin\/linux\/amd64\/kubectlsudo apt-get install unzip<\/span><\/li>\n<li><span style=\"color: #000000;\">openssl sha1 -sha256 kubectl<\/span><\/li>\n<li><span style=\"color: #000000;\">chmod +x .\/kubectl<\/span><\/li>\n<li><span style=\"color: #000000;\">mkdir -p $HOME\/bin &amp;&amp; cp .\/kubectl $HOME\/bin\/kubectl &amp;&amp; export PATH=$PATH:$HOME\/binaws \u2013version<\/span><\/li>\n<li><span style=\"color: #000000;\">echo &#8216;export PATH=$PATH:$HOME\/bin&#8217; &gt;&gt; ~\/.bashrc<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl version &#8211;short &#8211;client<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\"><strong><u>g) Installing helm:<\/u><\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">curl https:\/\/raw.githubusercontent.com\/helm\/helm\/master\/scripts\/get-helm-3 &gt; get_helm.sh<\/span><\/li>\n<li><span style=\"color: #000000;\">chmod 700 get_helm.sh<\/span><\/li>\n<li><span style=\"color: #000000;\">.\/get_helm.sh<\/span><\/li>\n<li><span style=\"color: #000000;\">helm help<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\"><strong><u>h) Connect to AWS, Set Context for EKS, Get svc, nodes, pods:<\/u><\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">aws sts get-caller-identity<\/span><\/li>\n<li><span style=\"color: #000000;\">aws eks update-kubeconfig &#8211;region ap-south-1 &#8211;name eks-prometheus-cls<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get svc<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get nodes -o wide<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get pods -n kube-system<\/span><\/li>\n<\/ul>\n<h2 id=\"installingmetrics\"><strong>Installing Metrics Server on EKS:<\/strong><\/h2>\n<p><span style=\"color: #000000;\">Metrics Server needs to be installed before installing Prometheus. The raw metrics can be accessed at <strong>\/metrics.<\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">kubectl apply -f <a href=\"https:\/\/github.com\/kubernetes-sigs\/metrics-server\/releases\/latest\/download\/components.yaml\">https:\/\/github.com\/kubernetes-sigs\/metrics-server\/releases\/latest\/download\/components.yaml<\/a><\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get deployment metrics-server -n kube-system<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get &#8211;raw \/metrics<\/span><\/li>\n<\/ul>\n<h2 id=\"installingprometheus\"><strong>Installing &amp; Setting up Prometheus using Helm:<\/strong><\/h2>\n<p><span style=\"color: #000000;\">Helm repo needs to be updated and Prometheus needs to be installed in the Prometheus namespace using the below commands.<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">kubectl create namespace prometheus<\/span><\/li>\n<li><span style=\"color: #000000;\">helm repo add prometheus-community <a href=\"https:\/\/prometheus-community.github.io\/helm-charts\">https:\/\/prometheus-community.github.io\/helm-charts<\/a><\/span><\/li>\n<li><span style=\"color: #000000;\">helm upgrade -i prometheus prometheus-community\/prometheus &#8211;namespace prometheus &#8211;set alertmanager.persistentVolume.storageClass=&#8221;gp2&#8243;,server.persistentVolume.storageClass=&#8221;gp2&#8243;<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get pods -n Prometheus<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl &#8211;namespace=prometheus port-forward deploy\/prometheus-server 9090 (this creates port forwarding for Prometheus where the metrices can be accessed on <a href=\"http:\/\/localhost:9090\/graph\">http:\/\/localhost:9090\/graph<\/a><\/span><\/li>\n<li><span style=\"color: #000000;\">There are hundreds of gauges, and counters that can be selected from the drop-down and executed to view the raw metrics being scraped from the Target EKS nodes. The metrics can also be visualized using the \/graph option.<\/span><\/li>\n<li><span style=\"color: #000000;\">Some example metrices are listed below:<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">Ex: node_disk_info<\/span><\/p>\n<p><span style=\"color: #000000;\">node_disk_read_bytes_total<\/span><\/p>\n<p><span style=\"color: #000000;\">node_disk_write_bytes_total<\/span><\/p>\n<p><span style=\"color: #000000;\">kube_pod_status_ready<\/span><\/p>\n<p><span style=\"color: #000000;\">kube_daemonset_created<\/span><\/p>\n<p><span style=\"color: #000000;\">Below are some images from the Prometheus UI dashboard:<\/span><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13068\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS3.png\" alt=\"Prometheus\" width=\"892\" height=\"491\" \/><\/a><\/p>\n<ul>\n<li>The list of metrics for kube and node can be viewed by typing just a few words in the search bar and executing to view the raw metrics.<br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13069\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/EKS4.png\" alt=\"AWS EKS\" width=\"915\" height=\"469\" \/><\/a><br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13070\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks5.png\" alt=\"AWS EKS\" width=\"912\" height=\"432\" \/><\/a><\/li>\n<li>The\u00a0raw metrics or the graphs for the scraped data can be viewed.<br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13071\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks6.png\" alt=\"AWS EKS\" width=\"940\" height=\"424\" \/><\/a><br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks61.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13074\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks61.png\" alt=\"AWS EKS\" width=\"940\" height=\"424\" \/><\/a><\/li>\n<\/ul>\n<h2 id=\"installinggrafana\"><strong>Installing &amp; Setting up Grafana:<\/strong><\/h2>\n<ul>\n<li><span style=\"color: #000000;\">kubectl create namespace Grafana<\/span><\/li>\n<li><span style=\"color: #000000;\">helm repo add <a href=\"https:\/\/grafana.github.io\/helm-charts\" target=\"_blank\" rel=\"noopener\"><strong>grafana<\/strong><\/a><\/span><\/li>\n<li><span style=\"color: #000000;\">helm repo update<\/span><\/li>\n<li><span style=\"color: #000000;\">helm install grafana grafana\/grafana &#8211;namespace grafana &#8211;set persistence.storageClassName=&#8221;gp2&#8243; &#8211;set persistence.enabled=true\u00a0 &#8211;set adminPassword=&#8217;EKS!sAWSome&#8217;\u00a0 &#8211;values ${HOME}\/environment\/grafana\/grafana.yaml\u00a0 &#8211;set service.type=LoadBalancerkubectl get &#8211;raw \/metrics<\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get all -n Grafana<\/span><\/li>\n<li><span style=\"color: #000000;\">export ELB=$(kubectl get svc -n grafana grafana -o jsonpath='{.status.loadBalancer.ingress[0].hostname}&#8217;)<\/span><\/li>\n<li><span style=\"color: #000000;\"><a href=\"http:\/\/$ELB\" target=\"_blank\" rel=\"noopener\"><strong>echo\u00a0<\/strong><\/a><\/span><\/li>\n<li><span style=\"color: #000000;\">kubectl get secret &#8211;namespace grafana grafana -o jsonpath=&#8221;{.data.admin-password}&#8221; | base64 &#8211;decode ; echo<\/span><\/li>\n<li><span style=\"color: #000000;\">The above command gives an output of the Password for logging into the Grafana dashboard.<\/span><\/li>\n<\/ul>\n<h2 id=\"integratingprometheus\"><strong>Integrating Prometheus with Grafana:<\/strong><\/h2>\n<ul>\n<li><span style=\"color: #000000;\">Once Grafana is installed on the EKS cluster, it can be accessed using the AWS classic load balancer is a URL link that comes as output after running the command: <a href=\"http:\/\/$ELB.\" target=\"_blank\" rel=\"noopener\"><strong>echo\u00a0<\/strong><\/a><\/span><\/li>\n<li><span style=\"color: #000000;\">The username is \u201cadmin\u201d and the password is from the earlier kubectl command.<\/span><br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13073\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks7.png\" alt=\"AWS EKS\" width=\"823\" height=\"515\" \/><\/a><\/li>\n<\/ul>\n<h2 id=\"monitoringandvisualizing\"><strong>Monitoring &amp; Visualizing using Grafana:<\/strong><\/h2>\n<ul>\n<li>On the homepage, click on \u201c+\u201d sign to expand the options. Click on \u201cImport\u201d to import the dashboard template for Kubernetes.<br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13072\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks8.png\" alt=\"AWS EKS\" width=\"824\" height=\"579\" \/><\/a><\/li>\n<li>Type \u201c3119\u201d (template number) to load the desired dashboard template with various panels from the Grafana.com website.<\/li>\n<li>Once the dashboard details load up, select Prometheus from the drop-down and click on \u201cImport.\u201d<\/li>\n<li>Once the Import is successful, the Time Series metrics being scraped from the Prometheus endpoints start showing up on the dashboard in Piecharts, line graphs, and bar graphs.<\/li>\n<li>You can select the data source as Prometheus and then the node from which you want to visualize the metrics.<br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13075\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks9.png\" alt=\"AWS EKS\" width=\"853\" height=\"650\" \/><\/a><br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13076\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks10.png\" alt=\"AWS EKS\" width=\"854\" height=\"632\" \/><\/a><br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13077\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks11.png\" alt=\"AWS EKS\" width=\"873\" height=\"482\" \/><\/a><br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13078\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/eks12.png\" alt=\"AWS EKS\" width=\"867\" height=\"548\" \/><\/a><\/li>\n<\/ul>\n<h2 id=\"aboutcloudthat\"><strong>About CloudThat<\/strong><\/h2>\n<p id=\"About CloudThat\"><a href=\"https:\/\/www.cloudthat.com\/\" target=\"_blank\" rel=\"noopener\"><strong>CloudThat<\/strong><\/a><span style=\"color: #000000;\">\u00a0is\u00a0the official AWS (Amazon Web Services) Advanced Consulting Partner, Microsoft Gold Partner, Google Cloud Partner, and Training Partner helping people develop knowledge of the cloud and help their businesses aim for higher goals using best-in-industry cloud computing practices and expertise. We are on a mission to build\u00a0a robust\u00a0cloud computing ecosystem by disseminating\u00a0knowledge on technological intricacies within the cloud space.\u00a0Our blogs, webinars,\u00a0case studies, and white papers\u00a0enable all the stakeholders in the cloud computing sphere.<\/span><\/p>\n<p><span style=\"color: #000000;\">If you have any queries about the AWS EKS cluster, Prometheus and Grafana, or any other services, drop them in the comment section and I will get back to you quickly.<\/span><\/p>\n<p><span style=\"color: #000000;\"><a href=\"https:\/\/www.cloudthat.com\/\" target=\"_blank\" rel=\"noopener\"><strong>CloudThat<\/strong>\u00a0<\/a>is a\u00a0<span class=\"TextRun BCX0 SCXP93070984\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP93070984\">house\u00a0of\u00a0All-Encompassing\u00a0IT\u00a0Services\u00a0on the cloud offering\u00a0<span class=\"TextRun BCX0 SCXP59000031\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP59000031\">Multi-cloud Security &amp; Compliance, Cloud Enablement Services, Cloud-Native Application Development, and System Integration Services.\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXP59000031\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP59000031\"><span class=\"EOP SCXP258354852 BCX0\"><span class=\"EOP SCXP66056781 BCX0\"><span class=\"EOP SCXP242272637 BCX0\"><span class=\"TextRun SCXP239778695 BCX0\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun SCXP239778695 BCX0\">Explore our\u00a0<strong><a href=\"https:\/\/www.cloudthat.com\/consulting\/\" target=\"_blank\" rel=\"noopener\">consulting here<\/a>.<\/strong><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n","protected":false},"author":282,"featured_media":13286,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3606,3607],"user_email":"sarithan@cloudthat.com","published_by":"2","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/13062"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/282"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=13062"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/13062\/revisions"}],"predecessor-version":[{"id":41143,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/13062\/revisions\/41143"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=13062"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=13062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}