How Do You Connect to a Particular Docker Repository or Registry to Run a “docker push” Command?

Problem scenario
You want to use the “docker push” command. But you do not know how your Docker host is configured. You want to know what repository your Docker host is configured to use. How do you determine which repository your “docker push” commands will be destined to?

Solution
Docker push involves a destination Docker registry — not a repository. A registry is a collection of Docker repositories (things that hold versions of Docker images).

How Do You Troubleshoot the Message “ModuleNotFoundError: No module named ‘awscli'”?

Problem scenario
You try to run an AWS CLI command. But you receive this error:

‘ File “/bin/aws-cli-1.16.226/bin/aws”, line 19, in
import awscli.clidriver
ModuleNotFoundError: No module named ‘awscli’

Solution
Did you run sudo python3 setup.py install ? If you only ran the build step, this could happen.

How Do You Troubleshoot “/usr/bin/env: ‘python’: No such file or directory”?

Problem scenario
You try to run an AWS CLI command but you receive this error:
/usr/bin/env: ‘python’: No such file or directory

What should you do?

Possible Solution #1
If Python 3 is not installed, install it. You may want to see these postings:
How Do You Upgrade to Python 3.x on Ubuntu 16?
How Do You Upgrade Python 2.x to Python 3.7 in Debian or Ubuntu Linux?

How Do You Create Your Own kubeconfig File?

Problem scenario
You want to create a kubeconfig file automatically. But you do not know how. What should you do?

Prerequisites
If kubelet, kubeadm and kubectl are installed, skip the prerequisites to go to step #1 in the procedures. Otherwise, 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

curl -Lo kubeadm https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubeadm && …

How Do You Install Molecule on an Ubuntu 18.x Linux Server?

Problem scenario
You want to use Molecule to test Ansible roles. How do you install Molecule on Ubuntu 18.x with Python 3?

Solution
Prerequisites
i. You must have Docker installed. If you need assistance see this posting.
ii. You must have pip3 installed on the Docker host. sudo apt-get install -y python3-pip

Procedures
1.

How Do You Troubleshoot the Error “kubelet service is not enabled” or How Do You Write Your Own .service File in Linux?

Problem scenario
You try to run a kubeadm command. You get an error about kubelet

” [WARNING Service-Kubelet]: kubelet service is not enabled, please run ‘systemctl enable kubelet.service'”

How do you get “sudo systemctl start kubelet” or “sudo systemctl enable kubelet” to work? How do you create your own kubelet.service file?

Solution

  1. Create this file: /etc/systemd/system/kubelet.service
  2. The content should be as follows (but you may need to double check that the kubelet file is there;

How Do You Troubleshoot Computer Speakers Not Working with Your Windows 10 Computer?

Problem scenario
You have some older speakers plugged into your laptop that was recently reformatted (Windows 10 was recently installed). You know the laptop’s audio works via its built-in speakers. You know the speakers work from your a second laptop. But one laptop seems not compatible with one pair of head phones or one set of external speakers. There is a 3.5 mm jack that you connect the speakers to your laptop.

How Do You Get an Ansible Variable to Not Add Single Quotes or Brackets when the Variable Is Substituted?

Problem scenario
You are using an Ansible-supported method of a variable in a playbook. This variable will substitute a string or line number that the playbook is run on with the IP address of the host. You notice that this substitution includes an opening-and-closing single quote mark “‘” and a pair of opening-and-closing brackets “[]”. That is, single quotes and brackets are being introduced into the string you want to build with the Ansible playbook.

How Do You Get sonar-scanner to Work When You Seem to Have No Quality Profiles and Your Server Has No Internet Access?

Problem scenario
You run sonar-scanner, but it fails with an error such as this: “No quality profiles have been found, you probably don’t have any language plugin installed.”

You run sonar-scanner with the “-X” and see a Java stack trace like this: “Error during SonarQube Scanner execution java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.report.MetadataPublisher”

You log into the SonarQube web UI. You go to “Quality Profiles” but you see no profiles and no button or option to create one.