• 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<br /> rm -rf openshift*/LICENSE<br /> 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"<br /> mkdir -p /var/lib/origin/<br /> cd /var/lib/origin/<br /> openshift start master \<br /> --master="https://${EXTERNAL_IP}:8443" \<br /> --dns="https://0.0.0.0:8053" \<br /> --write-config="/var/lib/origin/openshift.local.config/master"<br /> sed -i "s/router.default.svc.cluster.local/${EXTERNAL_IP}.nip.io/" \<br /> 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<br /> oc adm create-node-config \<br /> --dns-ip='172.30.0.1' \<br /> --node-dir=/var/lib/origin/openshift.local.config/node-localhost \<br /> --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:<br /> - name: my_htpasswd_provider<br /> challenge: true<br /> login: true<br /> mappingMethod: add<br /> provider:<br /> apiVersion: v1<br /> kind: HTPasswdPasswordIdentityProvider<br /> 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

comments powered by Disqus