Installing Openshift Origin natively on an AWS Lightsail VM powered by Ubuntu 16.04

Uncategorized

  • Setup a LightSail VM with at least 4Gb of RAM.
  • Go to the Networking tab, and set all ports to open in the Firewall section on AWS
  • Get the latest Openshift release from their Github
  • Extract everything to an openshift folder.

tar -xvzf openshift openshift-origin-server*

  • Move all binaries from the openshift folder to /usr/bin

rm -rf openshift*/README.md
rm -rf openshift*/LICENSE
mv openshift*/* /usr/bin

  • Generate the master node’s configuration
  • Assign a static IP to your Lightsail instance from the AWS Lightsail’s network tab.
  • Replace XXX.XXX.XXX.XXX with your static IP below

export EXTERNAL_IP="XXX.XXX.XXX.XXX"
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

  • Setup Hostname

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

  • Start up the cluster

oc cluster up --use-existing-config --public-hostname="${EXTERNAL_IP}"

  • Update password on the developer account

htpasswd -c /var/lib/origin/openshift.local.config/master/users.htpasswd developer

  • Replace the existing identityProviders section in the file /var/lib/origin/openshift.local.config/master/master-config.yaml with the following

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

  • Saving the start cluster command for easier access or to run at Start ups. Replace XXX.XXX.XXX.XXX with your IP.

/usr/bin/oc cluster up --use-existing-config --public-hostname="XXX.XXX.XXX.XXX" --host-data-dir=/etcd

Inspired from : https://medium.com/@james_devcomb/openshift-origin-on-vps-like-scaleways-2197294cf4fe


Written by on August 3, 2018

More from the blog


GateSentry updates

Found some free time this weekend, decided to put it to use with some long needed updates to Read More


GateSentry Raspberry Pi : Updating the expired certificate

If you're using GateSentry's Raspberry Pi image, you might be seeing some certificate expiry Read More


Building a simple serverless CRUD app powered by Lambda and DynamoDB

Amazon web services has a very comprehensive set of documentation when it comes to cloud Read More