How Do You Troubleshoot the Error “Unable to connect to the server: dial tcp: lookup … eks.amazonaws.com on x.x.x.x:53: no such host” when Running kubectl Commands?

Problem scenario
kubectl commands are failing with an error message like this: “Unable to connect to the server: dial tcp: lookup ABCD123EFG.gr7.us-west-1.eks.amazonaws.com on x.x.x.x:53: no such host”

How do you get kubectl commands to work?

Possible Solution #1
If you are using EKS and you have the name of the cluster (e.g., “foobar”), run a command like this:

aws eks update-kubeconfig –name foobar

Possible Solution #2

  1. Find what VPC your EC-2 instance is in.

How Do You Troubleshoot the Kubernetes Error “no nodes available to schedule pods”?

Problem scenario
You run a kubectl command, but you receive one of the following error messages:

Warning FailedScheduling default-scheduler no nodes available to schedule pods
No resources found

What should you do?

Possible Solution #1
Did the control plane lose connectivity with the worker nodes? An intermediate network device such as a firewall may have been implemented.

How Do You Create an IAM Role in AWS to Allow for Nodegroups to Be Created in EKS?

Problem scenario
In the AWS Management Console, you cannot add a Node to an EKS cluster. The “Node IAM Role” never has any option. You click the “refresh” arrow, but all you see is “No roles found. Follow the link above to create a new role.” What should you do?

Solution

1. Install and configure the AWS CLI. If you need assistance with this,

How Do You Back Up Many Emails from a Web-based Email Quickly?

Problem scenario
You want to back up many different emails from a web-based email. You cannot select several and print them all at once. What should you do?

Solution
Prerequisite

This assumes your web-based email can be configured to work with a desktop email client (such as Outlook).

Procedures
Install and configure Thunderbird,

How Do You Get Kubernetes Nodes to Be Ready?

Problem scenario
Your Kubernetes cluster is not working. The nodes are not ready. You see your Kubernetes nodes are not ready (with kubectl get nodes). You also see this error from a kubectl describe node foobar command:

runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

What should you do?

(If you get a different error,

How Do You Find out What CNI Plugin Has Been Installed in Your Kubernetes Cluster?

Problem scenario
You want to know what CNI plugin your Kubernetes cluster is using (e.g., Flannel, Calico, Weave Net, Romana or another one). What do you do?

Possible solution
“You can install only one Pod network per cluster.” taken from Kubernetes.io.

Go to a worker node and run these commands and look at the output:

ls -lh /etc/cni/net.d

ls -lh /opt/cni/bin | grep -i flannel

ls -lh /opt/cni/bin | grep -i calico

Use the sudo find / -name command to search for Romana or Weavenet vestiges.

How Do You Tell If the .yaml File for a kubectl Command Will Work?

Problem scenario
You want to do some pre-testing on the .yaml file(s) you will use with kubectl. How do you validate a .yaml file has correct syntax for Kubernetes?

Possible Solution #1
Try this command:
kubectl apply –validate=true –dry-run=true –filename=nameofyourfile.yaml

Possible Solution #2
Try this website:
https://www.kubeyaml.com/

Possible Solution #3
Try kubeval: https://www.kubeval.com/

Possible Solution #4
Use Copper: http://copper.sh/

How Do You Create a .kube/config File with a “aws eks” Command?

One of the following apply:

Problem scenario #1
You are using EKS and you have no config file in the .kube directory. You want to run some kubectl commands.

Problem scenario #2
You are using EKS and run a kubectl command, but you get this error: “The connection to the server localhost:8080 was refused – did you specify the right host or port?”

Solution
Run a command like this (but replace “us-west-1” with your region and replace “foobar” with the cluster_name):

aws eks –region us-west-1 update-kubeconfig –name foobar

How Do You Troubleshoot the Error ‘”/usr/share/collectd/types.db” no such file or directory’?

Problem scenario
You are running an aws ssm command. You receive a message about an error when parsing amazon-cloudwatch-agent.toml that also says ‘”/usr/share/collectd/types.db” no such file or directory’. What do you do?

Solution
Install collectd. If you are using a RedHat derivative of Linux (e.g., Fedora or CentOS), run this: sudo yum -y install collectd