How Do You Install Helm on Any Type of Linux?

Problem scenario
You want to use Helm to manage Kubernetes applications. Helm helps you with packages for changes to Kubernetes (in ways that are similar to yum or apt). Helm uses what are called Charts (.yaml files) that enable you to do more with Kubernetes with less trouble. Helm consists of these two things: a CLI tool and a server component that runs as a pod in a Kubernetes cluster (page 531 of Kubernetes in Action by Luksa).

What is Calico?

Question
In the context of container orchestration, you have read or seen “Calico.” What is it?

Answer
“Calico provides a highly scalable networking and network policy solution for connecting Kubernetes pods based on the same IP networking principles as the internet. … Calico also provides fine-grained, intent based network security policy for Kubernetes pods via its distributed firewall.” Taken from https://kubernetes.io/docs/concepts/cluster-administration/networking/

“Calico provides secure network connectivity for containers and virtual machine workloads.

What is Flannel?

Question
You have heard about flannel in the context of container orchestration. What is flannel?

Answer
“Flannel is a simple and easy way to configure a layer 3 network fabric designed for Kubernetes.” Taken from https://github.com/coreos/flannel

“Flannel is a networking technology used to connect Linux Containers. It is distributed and maintained by CoreOS, the producer of the stripped-down CoreOS Linux operating system for containers,

How Do You Troubleshoot the Kubernetes Problem “connection to the server localhost:8080 was refused”?

One of the following applies (with #1 being related to Kubernetes anywhere and #2 only being relevant to running Kubernetes in GCP).

Problem scenario #1 (any Kubernetes)
You run a command like this: kubectl get svc

You get an error like this: The connection to the server localhost:8080 was refused – did you specify the right host or port?

What should you do?

How Do You Troubleshoot a kubectl Command That Returns “The connection to the server localhost:8080 was refused – did you specify the right host or port?” when using AWS and EKS?

One of the following problems pertains to you.

Problem scenario #1
You have a kubectl server. You created some new EKS clusters. How do you get the kubectl server to interface, control or manage the new EKS clusters.

or

Problem scenario #2
You are running EKS. You run this command:

kubectl get cluster-info

But you receive this message: “The connection to the server localhost:8080 was refused – did you specify the right host or port?”

What should you do?

What Are The Advantages of a Service over an Ingress in Kubernetes?

Problem scenario
You have read that Ingresses have benefits compared to Services. You know the two are different for routing external traffic to reach a Kubernetes pod. When would you want to use a Service instead of an Ingress?

Possible Answers

  1. When you want to direct traffic to Pods based on a selector and not an IP address. Ingresses use IP addresses*,

How Do You Find What Context Your Kubernetes Configuration Is Using?

Problem scenario
You are trying to fix a Kubernetes problem. You read that you need to check the context to solve your problem. How do you determine what context you are using?

Solution
Run this command:
kubectl config current-context

Or try this command:
kubectl config get-contexts

Another command that may be interesting is this one:
kubectl config view | grep -i context

How Do You Troubleshoot the kubectl Error “Unable to connect to the server: dial tcp: lookup ,,, no such host”?

Problem scenario

You run this command:
kubectl get cluster-info

You receive this error message:
“Unable to connect to the server: dial tcp: lookup ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789.yl4.FQDN.com on 172.55.44.33: no such host”

Solution

Possible solution #1
Ask yourself these three questions:

  1. Have you recently destroyed a Kubernetes cluster?
  2. Is the intended Kubernetes cluster running?

How Do You Troubleshoot a Kubernetes Dashboard Message about a 403 Forbidden Error?

Problem scenario
You created an EKS cluster. But when you open a web browser and go to the API endpoint, you get a 403 forbidden error.

The web browser shows something like this:

kind “Status”
apiVersion “v1”
metadata {}
status “Failure”
message “forbidden: User \”system:anonymous\” cannot get path \”/\””
reason “Forbidden”
details {}
code 403

How do you access the web UI in Kubernetes for the first time?

How Do You Enter a Docker Container That is Currently Running?

Problem scenario
You want to get inside a Docker container that is running.  You are on the Docker host.  What should you do?

Solution
1.  Run this command:  docker ps -a   # Find the container ID in the output
2.  Run this command but substitute abcd1234 with the container ID found above:
docker exec -it abcd1234 bash