Category: DevOps

Deploying Stackstorm to a server with Ansible

The information about deploying stackstorm to a server with ansible is in the stackstorm docs.

Importantly the galaxy role can’t really be used like a normal ansible-galaxy role.

You have to clone the repo:


git clone https://github.com/StackStorm/ansible-st2
cd ansible-st2

Then update the inventory, for example in inventory:


st2 ansible_host=10.200.1.76 ansible_user=cent ansible_sudo_pass=pass

Run the playbook:


ansible-playbook -i inventory stackstorm.yml

 

Check your version on the managed host:


st2 --version

Installing Ansible Pack

If you check the stackstorm ansible pack some requirements are required beforehand.

sudo yum install gcc krb5-devel

I then installed python36 and python36-pip.

The pack then installed from the backend.

 

Cheapest VPS in South Africa

What company provides the cheapest VPS in South Africa.

These days we all need the cloud (also known as computers that you don’t own physically) to host our websites, API’s, hold our (or customer) data and run applications.

Recently I needed an elasticsearch application set up to make monitoring and analysing my API gateway easier. I tried to install that on my 1Gb VPS and it complained. Thanks JVM:


There is insufficient memory for the Java Runtime Environment to continue

So I went looking for a cheap Virtual Private Server that is on the Linux platform and based in South Africa (because my clients are in South Africa and latecy will be faster 20 milliseconds as opposed to 200ms when the server is in europe).

I have used either domains.co.za or cloudafrica.net, as they were the cheapest options I had found.

Any included services like backup are disregarded, also services that only provide hard drives like afrihost are also excluded.

But I am going to do a bit more research to try and find a cheaper deal for a virtual private server in South Africa, my finds are below:

CompanyMemory (GB)CPU (Cores)Storage (GB)Price (R/month)
cloudafrica.net4448305
domains.co.za44125498
hostafrica.co.za43100415
vps.co.za42100400
telasera.com4?120399
cloud.co.za42100340
hostking.co.za4250539
web4africa.co.za441501350
web-telecoms.co.za42100399
1-grid.com42100519
paradigmsolutions.co.za42100899

 

If you have found a cheaper deal for servers hosted in South Africa, please let me know.

 

Generate a letencrypt ssl certificate for kong api gateway

So you have installed kong and you are ready for it to go into production. Whoops, nossl certificate yet? It is important that you add it as credentials will be moving between your gateway and credentials could be acquired by any party in between the client and your server.

But the standalone nginx plugin for cerbot does not work from my testing. As it is built on nginx, kong is not nginx.

Easiest Way is to Install Nginx

If Kong is running on port 80 then stop it: sudo systemctl stop kong

Install Nginx:


sudo apt install nginx

Install Certbot for nginx on your operating system

Get your certificates with the cert-only option:

sudo certbot --nginx certonly

When that completes it will tell you where your certificates and keyfile are:


Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/api.fixes.co.za/fullchain.pem
Your key file has been saved at: /etc/letsencrypt/live/api.fixes.co.za/privkey.pem

Add these locations to ssl_cert and ssl_cert_key respectively.
Also make sure ssl = on

Stop Nginx:


sudo systemctl stop nginx
sudo systemctl start kong

Remove nginx:


sudo apt remove nginx