Problem scenario
What is a good command to see the overall health of your Kubernetes servers (nodes)?
Solution
Run this command: kubectl describe nodes
…
Continue reading “How Do You Briefly Look at the Conditions of Kubernetes Nodes?”
A Technical I.T./DevOps Blog
Problem scenario
What is a good command to see the overall health of your Kubernetes servers (nodes)?
Solution
Run this command: kubectl describe nodes
…
Continue reading “How Do You Briefly Look at the Conditions of Kubernetes Nodes?”
Problem scenario
You run kubectl describe pods. You see a message in the output that says
networkPlugin cni failed to set up pod network: open /run/flannel/subnet.env: no such file or directory.
How do you fix this?
Possible Solution #1
Log into every worker node. Make sure it has /run/flannel/subnet.env with the following four lines:
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
(This solution was adapted from https://www.programmersought.com/article/7824768991/)
Possible Solution #2
Run this: kubectl get pods.
…
Problem scenario
You are running EKS in AWS. You get this message “Warning FailedScheduling … default-scheduler no nodes available to schedule pods”. How do you troubleshoot it?
Solution
Verify your nodes are healthy with this command: kubectl get nodes
If you are using EKS, you may need to create nodes. Here is a command to do that (but replace “foo” with the name of the EKS cluster that you have,
…
Question
What is the “watch mechanism” in Kubernetes?
Solution
A notification system from the API server to trigger changes in Kubernetes. In Kubernetes there are observable events. The watch mechanism is a system for listening for specific events to respond to. The Kubelet, the Scheduler, the kube-dns pod, and individual controllers are components that use the watch mechanism. The API server is a central component that watching components are aware of.
…
Continue reading “What Is The Watch Mechanism in Kubernetes?”
Problem scenario
You deployment Kubernetes. You used “kubectl create” to deploy some pods. Pods are not getting IP addresses and the status is Pending. What do you do?
Solution
kubectl get all -n foobar
…
Continue reading “How Do You Troubleshoot Kubernetes when the Pods Are Not Working Correctly?”
Problem scenario
You run a kubectl command, but you get this problem: ‘error: unable to recognize “foobar.yaml”: no matches for kind “Deployment” in version “extensions/v1beta1″‘
What should you do?
Solution
Change your yaml file so the apiVersion setting/value works. To learn more about the acceptable values, see this posting.
…
Continue reading “How Do You Troubleshoot the kubectl ‘version “extensions/v1beta1″‘ Error Message?”
Problem scenario
You want to use Terraform and Kubernetes (in EKS). How do you do this in a simple way to test it out?
Solution
Prerequisite
This assumes you have deployed EKS. If you need assistance, see this posting.
This assumes you have installed Terraform. If you need assistance, see this posting.
Procedures
…
Continue reading “How Do You Use Terraform and Kubernetes in a Simple Way (as a Proof of Concept)?”
Problem scenario
You run an AWS CLI command, but you get this error:
An error occurred (InvalidParameterException) when calling the CreateNodegroup operation: Following required service principals [eks.amazonaws.com] were not found in the trust relationships of clusterRole arn:aws:iam::12345678910:role/foobar
How do you fix this?
Solution
Draft a command like this (but replace “12345677810:role/foobar” with the equivalent string in the error,
…
Problem scenario
You run “conjure-up kubernetes”, but on the page “Where would you like to deploy?” you do not see an option for AWS, Azure, or GCP (Google Cloud Platform).
You see options for maas, openstack, and vsphere. But the public cloud options are missing. What should you do?
Solution
With newer versions of conjure-up, you need to first configure a public cloud.
…
Problem scenario
You want to know about some common kubectl commands. What should you do?
Solution
The below was taken from running “kubectl help”. Here are some kubectl commands:
Basic Commands (Beginner):
create Create a resource from a file or from stdin.
expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service
run Run a particular image on the cluster
set Set specific features on objects
Basic Commands (Intermediate):
explain Documentation of resources
get Display one or many resources
edit Edit a resource on the server
delete Delete resources by filenames, …