How Do You Create a Router in OpenShift When You Get an Error about a User Being Forbidden?

Problem scenario
You are trying to create a virtual router in OpenShift.  When you run the command “oc adm router goodname” you get this error:

“error: router could not be created; could not retrieve list of security constraints to verify service account “router”: securitycontextconstraints.security.openshift.io is forbidden: User “jdoe” cannot list securitycontextconstraints.security.openshift.io at the cluster scope: User “jdoe” cannot list all securitycontextconstraints.security.openshift.io in the cluster”

What should you do?

What Are the Differences between Kubernetes and OpenShift?

Question
What are the differences between Kubernetes and OpenShift?

Answer

  • OpenShift was built by Red Hat.  OpenShift did not originally use Kubernetes (OpenShift blog).  Kubernetes was built at Google.
  • Kubernetes is open source whereas OpenShift usually costs money.  There are different types of OpenShift (e.g., OpenShift Online, OpenShift Enterprise etc.).
  • You use “oc” (OpenShift Client) commands with OpenShift that are often identical to “kubectl” commands in the options that they support. 

How Do Install and Configure OpenShift to Test It Out?

Problem scenario
You want to use OpenShift as opposed to Kubernetes.  How do you deploy OpenShift to try it out?

Solution
1.  Install Docker on Linux.  We recommend you use a RedHat OS.  The hardware requirements are not that high if you are just testing it for development and/or learning purposes.  For directions on how to install Docker on a RedHat distribution of Linux, see this 

How Do You Get the Binaries for kube-proxy, kube-apiserver, kube-controller-manager, and kube-scheduler?

Problem scenario
You want to install kube-proxy, kube-apiserver, kube-controller-manager, and kube-scheduler on a Linux server.  You want to be able to run these commands. How do you do this?

Solution

Prerequisite
This requires the Linux server to have access to the internet.

Procedures
1.  Download the first tar ball.

cd /usr/bin
sudo wget https://github.com/kubernetes/kubernetes/releases/download/v1.8.6/kubernetes.tar.gz
# To get the latest version,

How Do You Install These Kubernetes-Related Commands kubelet, kubeadm, kubectl, and etcd on an Ubuntu Server?

Problem scenario
You want to install kubelet, kubeadm, kubectl, and etcd on an Ubuntu server.  How do you do this?

Solution
1.  Run these five commands:

sudo apt-get -y update
sudo apt -y install docker.io
sudo su –
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add –
exit

2.  Use either Method A or Method B.

How Do You Log into the Kubernetes Dashboard?

Problem scenario
When you completed configuring Kubernetes, you were provided with a URL.  But this web page looks minimalistic with no graphics and a white background.  The web UI is not complete or polished and looks like a YAML file.  How do you get to the regular Kubernetes dashboard that looks like this picture? 

Possible Solution #1
1.  From the command prompt you set up Kubernetes with,

How Do You Create Kubernetes Pods with a .YAML File That Use a Docker Image from a Google Container Registry Instead of Docker Hub?

Problem scenario
You have a .yaml configuration file that works with the kubectl command to create a deployment.  You want to change the source image from the hub.docker.com to a Google container source.  How do you configure the .yaml file to obtain the image from a Google container registry instead of Docker Hub?

Your .yaml file has these four lines (among other lines):

  spec:
     

How Do You Deploy a LAMP Stack Application Powered by Kubernetes?

Problem scenario
You want to deploy your own LAMP stack with the power of Kubernetes.  You do not want to rely on official Docker Hub images for the underlying Docker containers.  How do you do this?

Solution
1.  Deploy Kubernetes to AWS.  If you need help to deploy Kubernetes to AWS, see this link.  If you need assistance installing kubectl on any type of Linux (CentOS/RHEL/Fedora,