Rackspace Kubernetes

Objective


Learn how to set up a machine on Rackspace to deploy a SOAJS cloud on it.


Steps


  1. Create an account on Rackspace
  2. Create a machine
    1. Specify which image to use and which flavor
    2. Save the provided password
  3. Connect to the Machine using the saved password 
  4. Download the pre-requisites, the installer & run the Installer pre script on the machine
    1. Copy the Kubernetes Token



Step 1: Create an account on Rackspace


  • Begin by Creating a Rackspace account →  Click Here.
    • Follow the steps of Rackspace wizard



Step 2: Create a machine


  • Click on Servers → Create Resources → Cloud servers
  • Specify the machine image type, OS and version: Linux - Ubuntu - 16.04 LTS(Xenial Xerus)
  • Specify the flavor: 7.5 GB Compute v1
  • Click Create Server
  • Save the password to use it for establishing the connection
  • Wait till the server gets ready
  • Use the ssh to log into your server
Create the machine

Running machine



Step 3: Connect to the Machine on your Local Machine


Connect to the Machine
# connect to the machine using the IP address and the saved password
> ssh root@machine-Ip-address



Step 4: Download the pre-requisites, the installer & run the Installer pre script on Rackspace Machine


Once you SSH to the machine, you can download and run the installer pre installation script to get all the dependencies so that cloud deployment works.

Prepare the machine

Download & Run SOAJS Installer pre scripts
# download update apt-get, npm and zip
> sudo su
> apt-get update && apt-get -y upgrade
> apt-get install npm

# download the latest version of nodejs
> curl -sL https://deb.nodesource.com/setup_6.x | bash && apt-get install -y nodejs
Run the installer
# download installer 
> mkdir -p /opt/soajs/node_modules 
> cd /opt/soajs/node_modules 
> sudo npm install soajs.installer 

# run installer pre script 
> cd soajs.installer/scripts/pre 
> sudo /opt/soajs/node_modules/soajs.installer/scripts/pre/kubernetes-linux.sh <%YOUR_CUSTOM_DOMAIN%>

# By default, your cluster will not schedule pods on the master for security reasons. 
# If you want to be able to schedule pods on the master, e.g. for a single-machine Kubernetes cluster for development, run
> kubectl taint nodes --all node-role.kubernetes.io/master:NoSchedule-

Grab the kubernetes Secret

Grab the kubernetes secret token by running the below command

Grab the Kubernetes Secret Token
# get kubernetes secrets
> kubectl describe secrets

# output
Name:		default-token-jc5fg
Namespace:	default
Labels:		<none>
Annotations:	kubernetes.io/service-account.name=default
		kubernetes.io/service-account.uid=50edbe21-8288-11e7-b935-bc764e2011e4

Type:	kubernetes.io/service-account-token

Data
====
ca.crt:		1025 bytes
namespace:	7 bytes
token:		eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tamM1ZmciLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjUwZWRiZTIxLTgyODgtMTFlNy1iOTM1LWJjNzY0ZTIwMTFlNCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.0FtEvs9YLo9EZkVE9rYewEM6DdD4HWZMeuMBwznFEV6ZEjRSIv-yb21iCRSJTvUiSs1aiOQKl501Z7oVEq3RRbc2E3obR9CuvoUlYbzKTRwTT3ZeSNDJ--2ahlPCpE1WS0S_sfxMnS_eiafdY37wSzydD4baamQxX7ZgFy-kCyKc72ipXamXnH3ev2yxvSIjEuXeCT5XVDOyyghRp5OJAgcIzsKDPkkeDDnrvkSFGMYaW1Rrez7IV0VbwZCTccaQuyjhQbR8-zSMsJboRSud8BZOxrVAGKkiuWStL7isvp83zlqqI7yMj5SDjZiXcvCR4ijH0-j8FbI3e4LQipdb5w

Do not forget to secure your machine using ufw or iptables or something similar.