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.

How Do You Deactivate a HipChat User with Only His/Her Email Address Using the REST API?

Problem scenario
You have email addresses of users that you want deactivated. You do not want to use the GUI for HipChat. How do you invoke REST APIs to deactivate a user?

Prerequisite
You need an API token for HipChat. If you have this, start with the Procedures below. Otherwise keep reading this “Prerequisite” section. You need several scopes for the API token authorize you to be able to deactivate a user.

How Do You Install Docker on Debian Linux in GCP?

Problem scneario
In Google Cloud Platform you have a Debian Linux server. You want to install Docker on it. What do you do?

Solution
1. Create a file called dockerinstall.sh in the /tmp/ directory with the following content:

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-get -y install docker-ce

2.

How Do You Create a Dockerfile That Will Use Reserved Words Such as FROM, RUN, COPY, WORKDIR, ADD, and LABEL?

Problem scenario
You want to create your own Dockerfile. You also want to invoke reserved words such as FROM, RUN, COPY, WORKDIR, ADD, and LABEL. You want to then create a Docker image from it. You want to ultimately create a working Docker container from that image. How do you do all of this?

Solution

1. In a given directory,