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 Get a Docker Container to Run That Was Made for Graylog?

Problem scenario
You are trying to follow the directions for installing Graylog from Docker hub.  You run these commands:

docker pull graylog2/server

docker run –name contint-mongo -d mongo:2

docker run –name contint-elasticsearch -d elasticsearch:2 elasticsearch -Des.cluster.name=”graylog”

docker run –link contint-mongo:mongo –link contint-elasticsearch:elasticsearch -p 9000:9000 -e GRAYLOG_WEB_ENDPOINT_URI=”http://127.0.0.1:9000/api” -d graylog2/server

The first two containers (for MongoDB and ElasticSearch) work and run.  The third for Graylog will not start. 

How Do You Troubleshoot “curl: (52) Empty reply from server”?

Problem scenario
You are running a curl command.  But you get this error “curl: (52) Empty reply from server.”  What is the problem?

Possible solution #1
You are using curl with a port assignment in the URL (e.g., http://coolname.com:5077).  Try a different port.

Possible solution #2  (This solution is only relevant if the URL endpoint is supported by a Docker container.)
The docker-compose.yml file could be configured incorrectly.  It may refer to files with incorrect paths.  You may need to change the docker-compose.yml file to refer to correct paths.  An alternative solution would be to create the necessary files that the docker-compose.yml file needs and the related subdirectories that the file is looking for.  Your “docker-compose up” command may work with no errors.  But the references to the URL path may produce the “Empty reply from server” if the docker-compose.yml file refers to directory paths (e.g., for nginx listening on a specific port) in subdirectories that do not exist.

[Sassy_Social_Share]

How Do You Deploy the WildFly Application Server in Docker?

Problem scenario
You want to prepare for WildFly Swarm to run Java EE programs.  You want to deploy Red Hat’s WildFly application server in a Docker container.  You are running a Linux server.  What do you do?

Solution
Background
The regular JBoss Application server was renamed to Wildfly.  Do not confuse the JBoss application server with the JBoss web server.