How to setup Kubernetes Dashboard in EKS using NodePort?

How to setup Kubernetes Dashboard in EKS using NodePort?

Step 1: Deploy the Dashboard
# Deploy the Kubernetes dashboard to your cluster:

kubectl apply -f

# Deploy heapster to enable container cluster monitoring and performance analysis on your cluster:

$ kubectl apply -f

# Deploy the influxdb backend for heapster to your cluster:

$ kubectl apply -f

# Create the heapster cluster role binding for the dashboard:

$ kubectl apply -f

Step 2: Create an eks-admin Service Account and Cluster Role Binding
# Create a file called eks-admin-service-account.yaml with the text below:

vi eks-admin-service-account.yaml
apiVersion: v1
kind: ServiceAccount
  name: eks-admin
  namespace: kube-system

$ kubectl apply -f eks-admin-service-account.yaml

vi eks-admin-cluster-role-binding.yaml

kind: ClusterRoleBinding
  name: eks-admin
  kind: ClusterRole
  name: cluster-admin
- kind: ServiceAccount
  name: eks-admin
  namespace: kube-system

$ kubectl apply -f eks-admin-cluster-role-binding.yaml

Step 3: Retrieve an authentication token 
Retrieve an authentication token for the eks-admin service account. Copy the <authentication_token> value from the output. You use this token to connect to the dashboard.

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')

Step 4: Connect to the Dashboard Via Node Port
Retrieve an authentication token for the eks-admin service account. Copy the <authentication_token> value from the output. You use this token to connect to the dashboard.

$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')
$ kubectl get pods --all-namespaces
$ kubectl get pods --namespace=kube-system
$ kubectl get svc --all-namespaces

$ kubectl edit svc/kubernetes-dashboard --namespace=kube-system
$ kubectl -n kube-system edit service kubernetes-dashboard
Just change "type: NodePort" only

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
apiVersion: v1
kind: Service
  creationTimestamp: 2018-07-27T10:22:50Z
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
  resourceVersion: "3288196"
  selfLink: /api/v1/namespaces/kube-system/services/kubernetes-dashboard
  uid: 03f2f747-9187-11e8-9432-02b761c0deac
  externalTrafficPolicy: Cluster
  - nodePort: 30530
    port: 443
    protocol: TCP
    targetPort: 8443
    k8s-app: kubernetes-dashboard
  sessionAffinity: None
  type: NodePort
  loadBalancer: {}

$ kubectl describe pods kubernetes-dashboard-7d5dcdb6d9-mt9b9 --namespace=kube-system 
#Find which node is running and get a Port of SVC

$ kubectl get svc --all-namespaces
$ kubectl get pods --all-namespaces
$ kubectl describe pods kubernetes-dashboard-7d5dcdb6d9-h9dcb --namespace=kube-system

Step 5: Connect to the Dashboard Via ClustorIP and Proxy


IMPORTANT – Kubernetes Dashboard should be HTTPS


Tagged : / / / /

What is Annotations in Kubernetes?

What is Annotations in Kubernetes?

There are two way using you can attach metadata to Kubernetes objects.

  1. labels
  2. annotations

Kubernetes annotations is used to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.

In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels.

Annotations, like labels, are key/value maps:

apiVersion: extensions/v1beta1

kind: Deployment



    kompose.cmd: ./kompose convert

    kompose.version: “”


"metadata": {</p>
<p class="p1"><span class="Apple-converted-space">  </span>"annotations": {</p>
<p class="p1"><span class="Apple-converted-space">    </span>"key1" : "value1",</p>
<p class="p1"><span class="Apple-converted-space">    </span>"key2" : "value2"</p>
<p class="p1"><span class="Apple-converted-space">  </span>}</p>
<p class="p1">}</p>

Here are some examples of information that could be recorded in annotations:

  1. Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.
  2. Pointers to logging, monitoring, analytics, or audit repositories.


Tagged : / /

What is EKS and How EKS can help you?

In simple line, Amazon EKS is generally available, bringing fully-managed Kubernetes to AWS.

Amazon launched Amazon EKS in November at its re:Invent 2017 conference. Till the time this article is written, Amazon EKS is available in the US East (N. Virginia) and US West (Oregon) Regions only.

The cost of running EKS is $0.20 per hour for the EKS Control Plane, apart from EC2, EBS, and Load Balancing prices for resources that run in your account.

How does Amazon EKS work?

Amazon EKS works by provisioning (starting) and managing the Kubernetes control plane for you. At a high level, Kubernetes consists of two major components – a cluster of ‘worker nodes’ that run your containers and the control plane that manages when and where containers are started on your cluster and monitors their status.

Without Amazon EKS, you have to run both the Kubernetes control plane and the cluster of worker nodes yourself. With Amazon EKS, you provision your cluster of worker nodes using the provided Amazon Machine Image (AMI) and AWS CloudFormation script and AWS handles provisioning, scaling, and managing the Kubernetes control plane in a highly available and secure configuration. This removes a significant operational burden for running Kubernetes and allows you to focus on building your application instead of managing AWS infrastructure.

Major Features of Amazon Elastic Container Service for Kubernetes (EKS)
Amazon Elastic Container Service for Kubernetes (EKS) is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane.

  1. Availability and Scalability of Nodes – Amazon EKS automatically manages the availability and scalability of the Kubernetes control plane nodes that are responsible for
    1. Starting and stopping containers,
    2. Scheduling containers on virtual machines,
    3. Storing cluster data, and other tasks.
  2. Health check of Nodes – Amazon EKS Automatically detects and replaces unhealthy control plane nodes for each cluster.
  3. Amazon EKS Integration – Great Integration with AWS networking and security services, such as Application Load Balancers for load distribution, IAM for role based access control, and VPC for pod networking.
  4. Managed Kubernetes Control Plane – Amazon EKS provides a scalable and highly-available control plane that runs across multiple AWS availability zones.
  5. Kubernetes Masters in three Availability Zones – Amazon EKS runs the Kubernetes control plane across three Availability Zones in order to ensure high availability, and it automatically detects and replaces unhealthy masters.
  6. Amazon EKS with IAM Authentication – Amazon EKS integrates Kubernetes RBAC (the native role based access control system for Kubernetes) with IAM authentication through a collaboration with Heptio. You can assign RBAC roles directly to each IAM entity allowing you to granularly control access permissions to your Kubernetes masters.
  7. Amazon EKS with VPC Support
    Your EKS clusters run in an Amazon VPC, allowing you to use your own VPC security groups and network ACLs. No compute resources are shared with other customers. This provides you a high level of isolation and helps you use Amazon EKS to build highly secure and reliable applications.
  8. Container Interface – EKS uses the Amazon VPC CNI to allow Kubernetes pods to receive IP addresses from the VPC means The Container Network Interface for Kubernetes uses Elastic Network Interfaces to provide secondary IP addresses for Kubernetes Pods.
  9. Amazon EKS Logging
    Amazon EKS is integrated with AWS CloudTrail to provide visibility and audit history of your cluster and user activity. You can use CloudTrail to view API calls to the Amazon EKS API.
  10. Amazon EKS with EBS – Kubernetes PersistentVolumes (used for cluster storage) are implemented as Amazon Elastic Block Store (EBS) volumes.
  11. Amazon EKS with Route 53 – The External DNS project allows services in Kubernetes clusters to be accessed via Route 53 DNS records. This simplifies service discovery and supports load balancing.
  12. Amazon EKS Support – Amazon EKS runs up-to-date versions of the open-source Kubernetes software, so you can use all the existing plugins and tooling from the Kubernetes community.

EKS Getting Started Guide
EKS Publication

Tagged : / / / / / /

Understanding the tools sets in kubernetes ecosystem

Kubernetes at Public Cloud

  1. Google Container Engine – Google Kubernetes Engine is a powerful cluster manager and orchestration system for running your Docker containers.
  2. ECS – Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster.
  3. EKS – Amazon Elastic Container Service for Kubernetes (Amazon EKS) makes it easy to deploy, manage, and scale containerized applications using Kubernetes on AWS.

Kubernetes cli tools

  1. kubectl – Main CLI tool for running commands and managing Kubernetes clusters.
  2. JSONPath – Syntax guide for using JSONPath expressions with kubectl.
  3. kubeadm – CLI tool to easily provision a secure Kubernetes cluster.
  4. kubefed – CLI tool to help you administrate your federated clusters.
  5. Minikube – This is the simplest way to get a Kubernetes cluster on your Mac or Windows machine.
  6. Kops – kops helps you create, destroy, upgrade and maintain production-grade, highly available, Kubernetes clusters from the command line. AWS (Amazon Web Services) is currently officially supported, with GCE in beta support , and VMware vSphere in alpha, and other platforms planned.

kubernetes config reference

  1. kubelet – The primary node agent that runs on each node. The kubelet takes a set of PodSpecs and ensures that the described containers are running and healthy.
  2. Container runtime – Container runtime is Docker engine which resides in each node
  3. kube-proxy – Can do simple TCP/UDP stream forwarding or round-robin TCP/UDP forwarding across a set of back-ends.

Cluster control plane (AKA master)

  1. kube-apiserver – REST API that validates and configures data for API objects such as pods, services, replication controllers.
  2. Cluster state store – All persistent cluster state is stored in an instance of etcd. This provides a way to store configuration data reliably.
  3. kube-controller-manager – Daemon that embeds the core control loops shipped with Kubernetes.
  4. kube-scheduler – Scheduler that manages availability, performance, and capacity.
  5. Federation – A single Kubernetes cluster may span multiple availability zones.
  6. federation-apiserver – API server for federated clusters.
  7. federation-controller-manager – Daemon that embeds the core control loops shipped with Kubernetes federation

Kubernetes Add ons

  1. DNS
  2. Ingress controller
  3. Heapster (resource monitoring)
  4. Dashboard (GUI)
Tagged : / / / / / / / / / / / / / / /

Kubernetes minikube errors and Solutions

Error 1 – Error starting host:  Error getting state for host: machine does not exist

&lt;p style="font-weight: 400;"&gt;D:\kubernete&gt;minikube-windows-amd64.exe start --kubernetes-version="v1.8.0" --vm&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;-driver="virtualbox" --alsologtostderr&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;W0110&nbsp;&lt;span data-term="goog_1571914274"&gt;12:16:04.517163&lt;/span&gt;&nbsp;&nbsp; 10504 root.go:148] Error reading config file at C:\Users&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;\panan4\.minikube\config\config.json: open C:\Users\panan4\.minikube\config\conf&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;ig.json: The system cannot find the file specified.&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914275"&gt;12:16:04.528163&lt;/span&gt;&nbsp;&nbsp; 10504 notify.go:109] Checking for updates...&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914276"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717506000&amp;usg=AFQjCNHilUJGRCqAxx0Naa3yTEDGQ9X2Dw"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.minikube\cache\&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;images\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717506000&amp;usg=AFQjCNHwyTmXfOb8jcAGQbTDyIr_DuEirg"&gt;;/a&gt;\k8s-minikube\storage-provisioner_v1.8.0&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914277"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717506000&amp;usg=AFQjCNFAVT9yppX_1usJ2E0YbShOwXUE9A"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.mi&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;nikube\cache\images\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF--H_EnOHq-1gORX9rvCyL0guvAA"&gt;;/a&gt;\google_containers\k8s-dns-dnsmasq-nanny-amd64_1.14.5&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;Starting local Kubernetes v1.8.0 cluster...&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;Starting VM...&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914278"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cluster.go:74] Skipping create...Using existing ma&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;chine configuration&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914279"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNERLC4qpuUBrUqm5OvSjac96pWNKw"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.min&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;ikube\cache\images\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF--H_EnOHq-1gORX9rvCyL0guvAA"&gt;;/a&gt;\google_containers\kubernetes-dashboard-amd64_v1.6.3&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914280"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNFhurp_V-c-NFhO73j_Zjakc4fptw"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.minikub&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;e\cache\images\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF--H_EnOHq-1gORX9rvCyL0guvAA"&gt;;/a&gt;\google_containers\k8s-dns-kube-dns-amd64_1.14.5&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914281"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNEFsklfJPJCpLyEX7qsaLsvUDDRow"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.miniku&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;be\cache\images\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF--H_EnOHq-1gORX9rvCyL0guvAA"&gt;;/a&gt;\google-containers\kube-addon-manager_v6.4-beta.2&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914282"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNEOfewUFCow70i9iSK2lBFDahW47A"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.minikube&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;\cache\images\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF--H_EnOHq-1gORX9rvCyL0guvAA"&gt;;/a&gt;\google_containers\k8s-dns-sidecar-amd64_1.14.5&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914283"&gt;12:16:05.901354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:290] Attempting to cache image: gc&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF2E15ZIwSbjHDnD4zxOcapo39PIQ"&gt;;/a&gt;&nbsp;at C:\Users\panan4\.minikube\cache\images&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;\&lt;a href="" data-saferedirecturl=";q=;source=gmail&amp;ust=1515821717507000&amp;usg=AFQjCNF--H_EnOHq-1gORX9rvCyL0guvAA"&gt;;/a&gt;\google_containers\pause-amd64_3.0&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914284"&gt;12:16:05.911354&lt;/span&gt;&nbsp;&nbsp; 10504 cache_images.go:78] Successfully cached all images&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;.&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;I0110&nbsp;&lt;span data-term="goog_1571914285"&gt;12:16:06.292552&lt;/span&gt;&nbsp;&nbsp; 10504 cluster.go:83] Machine state:&nbsp; Error&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;E0110&nbsp;&lt;span data-term="goog_1571914286"&gt;12:16:06.292552&lt;/span&gt;&nbsp;&nbsp; 10504 start.go:150] Error starting host: Error getting s&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;tate for host: machine does not exist.&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;Retrying.&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;E0110&nbsp;&lt;span data-term="goog_1571914287"&gt;12:16:06.292552&lt;/span&gt;&nbsp;&nbsp; 10504 start.go:156] Error starting host:&nbsp; Error getting&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;state for host: machine does not exist&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;================================================================================&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;An error has occurred. Would you like to opt in to sending anonymized crash&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;information to minikube to help prevent future errors?&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;To opt out of these messages, run the command:&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minikube config set WantReportErrorPrompt false&lt;/p&gt;
&lt;p style="font-weight: 400;"&gt;================================================================================&lt;/p&gt;


Please use/install minikube in the c drive.

Tagged : / / /