This is the first part of a series of stories that shows what kind of software could be deployed in a free tier namespace at K8Spin.cloud.

Telegram Bot

During k8spin beta phase we received feedback from people wanting to deploy a Telegram bot in our platform so we decided to make simple example that you can deploy in our Free Tier.

The code

We created a repository containing the code we use in this story. Download it locally, you will need it later:



$ git clone

Cloning into 'python-telegram-timerbot'...

remote: Enumerating objects: 61, done.

remote: Counting objects: 100% (61/61), done.

remote: Compressing objects: 100% (32/32), done.

remote: Total 61 (delta 28), reused 50 (delta 25)

Unpacking objects: 100% (61/61), done. $ cd $(mktemp -d)$ git clone https://gitlab.com/k8spin-open/examples/python-telegram-timerbot.git Cloning into 'python-telegram-timerbot'...remote: Enumerating objects: 61, done.remote: Counting objects: 100% (61/61), done.remote: Compressing objects: 100% (32/32), done.remote: Total 61 (delta 28), reused 50 (delta 25)Unpacking objects: 100% (61/61), done.

Bot Father

To make this work you need to create a new bot in telegram. If you never has created one, just open a telegram chat with BotFather and type:

/newbot

Follow BotFather instructions. You must end with a t.me url along with a HTTP API token.

K8Spin Namespace

To get into K8Spin you just need to sign with your Google or Github account in the K8Spin console. Then create a namespace:

This namespace costs 3.51€ but it’s free for our free tier users.

K8Spin provides you a free tier namespace with 100m CPU Cores (0,1 Core) and 128Mb of RAM in an unlimited time for free (no credit card required).

Download the kubeconfig file.

Click the green button

Move the timerbot.config (kubeconfig) to the same directory where you have downloaded the code before.

$ pwd

/tmp/tmp.Cfgf73kpF2

$ mv ~/Downloads/timerbot.config .

Let’s deploy it

First, configure the kubectl credentials:

$ export KUBECONFIG=$(pwd)/timerbot.config

Recover the token created before (BotFather gave you) and create a kubernetes secret to store it:

$ kubectl create secret generic timerbot --from-literal=TOKEN=YOUR_TOKEN_GOES_HERE

secret/timerbot created

Now, we are ready to deploy the Bot:

$ kubectl apply -f python-telegram-timerbot/deployment.yml

deployment.apps/timerbot created

$ kubectl get pods

NAME READY STATUS RESTARTS AGE

timerbot-86ccb8b655-l9m24 1/1 Running 0 3s

After a while you should be able to open a telegram client, open the url BotFather gave you and use the bot. Timerbot is a simple timer. You can set a reminder in seconds and Timerbot will notify you (Beep!).

Just use /set command

Deployment resources utilization details

The timerbot deployment runs with 35m (0,035 CPU Cores) and 50Mb of RAM memory.

K8Spin console

Although timerbot works with these amounts of resources, the start up process is slow.

Conclusions

This is just the first example that we want to show you. There will be more like this. We just want to demonstrate how powerfull could be our free tier.

We designed this tier focusing on a personal side projects. The unlocked tier is also a good option to deploy a personal side project, it unlocks the power of using dynamic namespaces. Remeber the story about Ephemeral Kubernetes environments on CI/CD systems.

We would love to hear you about your use cases. Dont forget to join our slack community at slack.k8spin.cloud