How Do You Pronounce quay.io?

Problem scenario
You are interested in the quay.io to store Docker images. You do not know how to say the term “quay” as in “quay.io.” How should it be pronounced?

Answer
The word “quay” is pronounced “kway” (rhymes with stray). (The pronunciation “key” may be acceptable too.) If you want to see the source, click on this external page:
https://developers.redhat.com/blog/2019/06/26/using-quay-io-to-find-vulnerabilities-in-your-container-images/

How Do You Troubleshoot the Kubernetes Error “Metrics not available or pod default/kubia-xxx-bmb”?

Problem scenario
You run “kubectl top pod” but you receive an error such as this:

‘Metrics not available or pod default/kubia-xxx-bmb, age: 1hr10m…   error: Metrics not available for pod default/kubia-xxx-bmb, age: 1hr10m”‘

What should you do?

Updated on 9/2/19.

Solution
Wait five minutes.  Then re-run this command: kubectl top pod

The source of this question and answer were taken from page 432 of Kubernetes in Action by Marko Luksa published in 2018 by Manning. 

What Is the Difference between a Node and a Pod in Kubernetes?

Question
You are using Kubernetes.  You read about Nodes and Pods.  What is the difference?

Answer
A Pod is a collection of one or more containers (e.g., Docker or rkt containers).  A node is a server that is the home of one or more Pods.

“A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine…” (taken from 

How Do You Find the Number of Active Connections That an Nginx HTTP Load Balancer Has?

Problem scenario
You have an Nginx instance configured to be an HTTP load balancer (aka invisible landing page, pass-through distributor or reverse proxy).  You want to analyze the inbound web traffic that your Nginx server is currently receiving.  How do you find out how many active connections there are through the load balancer?

Solution
1.  Modify the /etc/nginx/conf.d/default.conf file in the Nginx HTTP load balancer. 

How Do You Install kubectl on Any Type of Linux?

Problem scenario
You want a quick, generic way to install kubectl on any type of Linux.  What should you do?

Solution
Run these commands:

cd /tmp

curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl

sudo mv kubectl /usr/local/bin/

Test it by running this command: kubectl version

(If you would prefer to use apt commands, because you are using a Debian/Ubuntu distribution of Linux,

How Do You Create a Dockerfile and Build a Docker Image?

Problem scenario
You know how to use Docker containers.  You know how to use Docker images if they are already built.  Now you want to use a Dockerfile to understand how to build images.  How do you use Dockerfile and how do you create your own image?

Solution

Prerequisites
This assumes you have installed Docker on your Linux server.  If you have not,

How Do You Access the Networking Port of a Docker Container When There Appears to Be No Port Mapping, Just a Single Port Exposed by Itself?

Problem scenario
You run “docker ps -a” and see values in the PORTS column.  You see values such as these for two separate containers:

Container 1 has this:  0.0.0.0:32775->5000/tcp

Container 2 has this:  5731/tcp

You cannot reach the containers that have no “->” symbol in them via web browsers or other network connectivity tools.  You can reach those containers with the “->” symbol in the PORTS value. 

How Do You Install Docker on Debian 9 in GCP?

Problem scenario
You are running Debian 9 in GCP.  You want to install Docker on this server.  What should you do?

Solution
1.  Create a script in /tmp/ call installer.sh with the following lines of content:

#!/bin/bash
apt-get -y update
apt-get install -y apt-transport-https ca-certificates wget software-properties-common
wget https://download.docker.com/linux/debian/gpg
apt-key add gpg
echo “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable” | sudo tee -a /etc/apt/sources.list.d/docker.list
apt-get -y update
apt-cache policy docker-ce
apt-get -y install docker-ce

2.