Openshift on VPS like Scaleways with Hostname(Updated 5/2/18)

James Drummond PE
Sep 19, 2017 · 4 min read
#Run on Linux OpenShift Origin master node/machine
export EXTERNAL_IP=$(curl )
#Copy to clipboard
echo ${EXTERNAL_IP_HOST_RESOLVE} >> /etc/hosts
#Local Browser Machine - Windows 10
#Change %USERNAME% to admin username
#You can also right click notepad and do run as user then open file.
runas /env /user:%USERDOMAIN%\%USERNAME% "notepad %SYSTEMROOT%\System32\Drivers\etc\hosts"
#Local Browser Machine - Linux
echo "<Paste EXTERNAL_IP_HOST_RESOLVE>" >> /etc/hosts
# Install docker if you don't have it already.yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engineyum install -y yum-utils \
device-mapper-persistent-data \
yum-config-manager --add-repo install -y docker-cesed -i "s|ExecStart=/usr/bin/dockerd|ExecStart=/usr/bin/dockerd --insecure-registry --exec-opt native.cgroupdriver=systemd|" \
systemctl daemon-reload
systemctl restart docker
# Download the latest OpenShift Origin binaries from currently 3.9.0. Extract files and copy file to folder included in PATH environment variable such as /usr/bin directory.export OPENSHIFT_VERSION=3.9.0-191fece
tar -xzf openshift-origin-server-v${OPENSHIFT_VERSION}-linux-64bit.tar.gz
rm -f openshift-origin-server-v${OPENSHIFT_VERSION}-linux-64bit/LICENSE openshift-origin-server-v${OPENSHIFT_VERSION}-linux-64bit/
cp openshift-origin-server-v${OPENSHIFT_VERSION}-linux-64bit/* /usr/bin/
#Only needed if OpenShift is already running
#from ipaddress article mentioned before
oc cluster down
mkdir /var/lib/origin
cd /var/lib/origin/
#Updated 02/28/2018
openshift start master --master="https://$(hostname):8443" \
--dns="" \
export OPENSHIFT_HOSTNAMES=kubernetes.default.svc.cluster.local,localhost,openshift.default.svc.cluster.local,,,,,,,,$(hostname)
oc adm create-node-config \
--node-dir=/var/lib/origin/openshift.local.config/node-localhost \
--node=localhost --hostnames=$OPENSHIFT_HOSTNAMES --master="https://$(hostname):8443" --dns-ip=''
sed -i "s/router.default.svc.cluster.local/$(hostname)/" \
#Authentication mention at the end of article can be done before
#starting the cluster with the following.
rm -Rf ~/.kube
oc cluster up --use-existing-config --public-hostname=$(hostname)
yum install -y httpd-tools
htpasswd -c /var/lib/origin/openshift.local.config/master/users.htpasswd developer
perl -0777 -i.original -pe 's|- challenge: true\n    login: true\n    mappingMethod: claim\n    name: anypassword\n    provider:\n      apiVersion: v1\n      kind: AllowAllPasswordIdentityProvider|- name: my_htpasswd_provider\n    challenge: true\n    login: true\n    mappingMethod: add\n    provider:\n      apiVersion: v1\n      kind: HTPasswdPasswordIdentityProvider\n      file: /var/lib/origin/openshift.local.config/master/users.htpasswd|igs' /var/lib/origin/openshift.local.config/master/master-config.yaml#Updated 1/4/18
perl -0777 -i.original -pe 's|accessTokenMaxAgeSeconds: 86400|accessTokenMaxAgeSeconds: 8640000|igs' /var/lib/origin/openshift.local.config/master/master-config.yaml

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade