OpenShift Origin on VPS like Scaleways(Updated 5/2/18)

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 \
lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repoyum install -y docker-cesed -i "s|ExecStart=/usr/bin/dockerd|ExecStart=/usr/bin/dockerd --insecure-registry 172.30.0.0/16 --exec-opt native.cgroupdriver=systemd|" \
/usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker

Run OpenShift Origin Natively:

# Download the latest OpenShift Origin binaries from https://github.com/openshift/origin/releases 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
export OPENSHIFT_VERSION_BASE=3.9.0
yum install -y wget
wget https://github.com/openshift/origin/releases/download/v${OPENSHIFT_VERSION_BASE}/openshift-origin-server-v${OPENSHIFT_VERSION}-linux-64bit.tar.gz
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/README.md
cp openshift-origin-server-v${OPENSHIFT_VERSION}-linux-64bit/* /usr/bin/
export EXTERNAL_IP=$(curl -s https://ipinfo.io/ip/)mkdir -p /var/lib/origin/
cd /var/lib/origin/
openshift start master \
--master="https://${EXTERNAL_IP}:8443" \
--dns="https://0.0.0.0:8053" \
--write-config="/var/lib/origin/openshift.local.config/master"
sed -i "s/router.default.svc.cluster.local/${EXTERNAL_IP}.nip.io/" \
openshift.local.config/master/master-config.yaml

export OPENSHIFT_HOSTNAMES=kubernetes.default.svc.cluster.local,localhost,openshift.default.svc.cluster.local,127.0.0.1,172.17.0.1,172.18.0.1,172.19.0.1,172.30.0.1,192.168.122.1,192.168.42.1,$HOSTNAME,$EXTERNAL_IP
oc adm create-node-config \
--dns-ip='172.30.0.1' \
--node-dir=/var/lib/origin/openshift.local.config/node-localhost \
--node=localhost --hostnames=$OPENSHIFT_HOSTNAMES
#Should setup authentication before running the following
#but for a quick demonstration you can. Shut it down quickly though.
rm -Rf ~/.kube
oc cluster up --use-existing-config --public-hostname="${EXTERNAL_IP}"
yum install -y httpd-tools
htpasswd -c /var/lib/origin/openshift.local.config/master/users.htpasswd developer
identityProviders:
- name: my_htpasswd_provider
challenge: true
login: true
mappingMethod: add
provider:
apiVersion: v1
kind: HTPasswdPasswordIdentityProvider
file: /var/lib/origin/openshift.local.config/master/users.htpasswd
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
export EXTERNAL_IP=$(curl -s https://ipinfo.io/ip/)
oc cluster down
oc cluster up --use-existing-config --public-hostname="${EXTERNAL_IP}"

Run OpenShift inside a Docker Container:

export EXTERNAL_IP=$(curl -s https://ipinfo.io/ip/)docker run -ti --rm --name "origin" \
--privileged --pid=host --net=host \
-v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-v /var/lib/docker:/var/lib/docker:rw \
-v /opt/origin/openshift.local.config:/var/lib/origin/openshift.local.config \
-v /opt/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes:rslave \
openshift/origin start master \
--master="https://${EXTERNAL_IP}:8443" \
--dns="https://${EXTERNAL_IP}:8053" \
--write-config='/var/lib/origin/openshift.local.config/master'
docker run -ti --rm --name "origin" \
--entrypoint=/usr/bin/sed \
-v /opt/origin/openshift.local.config:/var/lib/origin/openshift.local.config \
openshift/origin -i \
"s/router.default.svc.cluster.local/${EXTERNAL_IP}.nip.io/" \
/var/lib/origin/openshift.local.config/master/master-config.yaml
export OPENSHIFT_HOSTNAMES=kubernetes.default.svc.cluster.local,localhost,openshift.default.svc.cluster.local,127.0.0.1,172.17.0.1,172.18.0.1,172.19.0.1,172.30.0.1,192.168.122.1,192.168.42.1,$HOSTNAME,$EXTERNAL_IP
docker run -ti --rm --name "origin" \
--entrypoint=/usr/bin/oc adm \
-v /opt/origin/openshift.local.config:/var/lib/origin/openshift.local.config \
openshift/origin create-node-config \
--node-dir=openshift.local.config/node-localhost \
--node=localhost --hostnames=$OPENSHIFT_HOSTNAMES
docker run -ti --rm -v /var/lib/origin/openshift.local.config/master/users.htpasswd:/var/lib/origin/openshift.local.config/master/users.htpasswd --entrypoint=/bin/bash --net=host openshift/origin
yum install -y httpd-tools
htpasswd -c /var/lib/origin/openshift.local.config/master/users.htpasswd developer
exit
identityProviders:
- name: my_htpasswd_provider
challenge: true
login: true
mappingMethod: add
provider:
apiVersion: v1
kind: HTPasswdPasswordIdentityProvider
file: /var/lib/origin/openshift.local.config/master/users.htpasswd
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
docker run -d --name "origin" \
--privileged --pid=host --net=host \
-v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-v /var/lib/docker:/var/lib/docker:rw \
-v /opt/origin/openshift.local.config:/var/lib/origin/openshift.local.config \
-v /opt/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes:rslave \
openshift/origin start \
--master-config='/var/lib/origin/openshift.local.config/master/master-config.yaml' \
--node-config='/var/lib/origin/openshift.local.config/node-localhost/node-config.yaml'

Openshift on VPS like Scaleways with Hostname (Added 9/20/17):

Additional Resources/References:

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store