Categorygithub.com/Lucifergene/openshift-telegram-bot
repository
0.0.0-20230611193501-be4a1b6748d9
Repository: https://github.com/lucifergene/openshift-telegram-bot.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

Bot logo

Openshift Telegram Bot

Status License


šŸ¤– Deploy your applications on Openshift without any interaction with the Openshift Web Console/CLI ✨
šŸ“® Send your Container Image and get back the šŸš€ Live Application URL! šŸ“”


šŸ’­ How it works

First, it asks the user to enter the Cluster URL. The bot then checks if the URL is valid.
Then asks the user to enter the API Token. To fetch the API Token, the bot generates a link which redirects the user to the Display Token Page of the Openshift Cluster.
The user then has to login with their credentials, copy the token and send it to the bot.

The bot then uses the token to authenticate itself with the Openshift Cluster.

Once authenticated, the bot asks the user to send the Container Image and the PORT of the application to be deployed.

In the background, the bot then creates a new deployment, service and route in the Openshift Cluster and returns the Live Application URL to the user!

The bot uses the telegram-bot-api package to interact with the Telegram Bot API and the kubernetes/client-go package to interact with the Openshift Cluster.

The entire bot is written in Golang 1.20 šŸš€


šŸŽ„ Demo

Will Upload Soon!!!


šŸŽˆ Usage

To start the Bot:

/start

Follow the Instructions to authenticate the bot with your Openshift Cluster.

To deploy a container image on Openshift:

/image <container-image-name> | <PORT>

To change the default namespace and user:
(Default: namespace = "default", user = "kube:admin")

/default <namespace> | <user>

šŸ Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

- You need to have a Telegram Account. 
- Register a new bot with BotFather. 
- Pass the TELEGRAM_BOT_TOKEN received in a .env file in the root directory.

- You would need a Openshift Cluster to test this bot. 
(You can get a free cluster from Developer Sandbox for Red Hat OpenShift!)

Click here to create your free account in Developer Sandbox

Running Locally

go run cmd/main.go

ā›ļø Built Using


āœļø Authors


šŸŽ‰ Acknowledgements

  • @RedHatOfficial for promoting and organizing hackathons as part of the work culture šŸŽ‰
  • Inspired by the popular Telegram Bots I use everyday!