How Do You Solve the Kubernetes Error “networkPlugin cni failed to set up pod network: open /run/flannel/subnet.env: no such file or directory”?

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.

How Do You Troubleshoot Two WordPress Websites when You Expect There to Be Only One?

Problem scenario
You seem to have two versions of a website being hosted. When you log into WordPress and make changes, they aren’t taking effect. You notice that the website you have is duplicated with one older version and one newer version. Both are hosted. You use a VPN or proxy tunnel website and find differences in your website. You want to consolidate these. How do you find out what is going on?

How Do You Respond to a Vagrant Prompt for which Interface the Network Should Bridge to?

Problem scenario
You are running Vagrant to create a VM on Oracle VirtualBox. You are given a prompt after your “vagrant up” command:
“Which interface should the network bridge to?”
No option seems to work. You have used a variety of different names, GUIDs, syntaxes, etc. What should you do?

Solution
Use “1)” or “2)” or any of the integer values listed above the question.

How Do You Troubleshoot “ssh connect to host x.x.x.x port 22: Connection refused”?

Problem scenario
You get “ssh connect to host x.x.x.x port 22: Connection refused” when trying to SSH. What do you do?

Possible solution #1
Do you have the correct IP address? Can you copy and paste the IP address? Can you run “ip addr show” on different servers? Is the IP addressed used multiple times in different subnets? It could refer to different servers.

How Do You Get EC-2 Instances to Get IP Addresses by Default?

Problem scenario
In AWS when you try to create an EC-2 instance, on step #3 to “Configure Instance Details”, you are not getting an auto-assigned public IP address. You see this message:

“No default subnet found
Please choose another subnet in your default VPC, or choose another VPC.”

What should you do?

Solution
As of November 2020,

How Do You Run a Bolt Command from a Linux Server to a Windows Server?

Problem scenario
You want to run a PowerShell script or run an interactive command on a Windows server. You have Puppet Bolt installed on a Linux server. You do not need to use SSL. What do you do?

Solution
Run a command like this (but substitute x.x.x.x with the IP address of the Windows server, jdoe with the username and coolpassword with jdoe’s password):

bolt command run “Get-Process” –Targets winrm://x.x.x.x –no-ssl –user jdoe –password coolpassword

To run a script called “cool.ps1”,

How Do You Troubleshoot the InsufficientFreeAddressSpaceInVpc Error?

Problem scenario
You run an AWS CLI command. But you get this message:

An error occurred (InsufficientFreeAddressSpaceInVpc) when calling the CreateDefaultSubnet operation: The VPC ‘vpc-123abcd’ does not have enough free address space to allocate an additional /20 subnet.

How do you troubleshoot this AWS CLI error?

Solution
Go to the VPC section of AWS. Find the VPC in the error and click on it.