Ditching Portainer. First try with Komodo and auto-stack deployment with Gitea
Off Topic
Yay! First post written across two countries.
Osaka + Kobe = perfect short break destination.
The Glitch Coffee offers great quality coffee with reasonable price.
Back to the topic
Recently I want to ditch Portainer for couple of reasons:
- Why not? It is always fun to tinker.
- 5 instances limit for Portainer CE, which is not that enough for tons of VM.
- Even there is free Portainer BE provided, it is only 3 nodes and requires unnecessary information
- Some core functions are paywalled, e.g. auto-update image, you need watchtower to do that on Portainer CE.
So I check for the FOSS options available, and I found 2 of them
Dockge looks cool and neat but it is not that feature rich.
So I take Komodo a shot and looks good for me.
Why Komodo?
- The feature set is somewhere practical enough for a homelabber (not sure about production environment)
- It is opensource
- It does not require bussiness license to work with
- UI is simple enough for basic operation
- It is automated if you configured well
In the old time, I edited my stack compose file on the Portainer UI locally, which is fine (they are kind of set and forget).
But I tried putting all the newly compose file deployed in Komodo into git repo for easier container re-deployment.
Of course you can edit your compose file on Komodo UI but I chose not to.
Why not Komodo?
So far Komodo does miss some features provided by Portainer:
- Although it claims that supports podman, I can’t get it to work by aliasing
- No UI for container shell access, you need good old
docker exec
to do that- No UI for uploading file to volumes
- No Docker swarm support (which I don’t need at this moment)
Install and Configure Komodo
Please check the installation guide of Komodo, and I chose the MongoDB backend version.
Optionally, you could install Komodo Periphery (Something like the Portainer agent) on the other machine you wish to run those services.
Add your server to the Komodo in the UI, set the server location and enable it.
After adding new server, you could add the stack by filling the info
- Server
- Choose mode as “Git Repo”
- Fill in the account, repo and branch
- You will need to generate an access token for your gitea account, having a read repo permission
- By default, komodo will look for
compose.yaml
on the root folder to deploy
- You can set
Run Directory
if you want to version control all stack in one repo like me, and sort them into different folders.
Auto-update Image should be a core-function, not via watchtower. ☹️
Automatic Deployment by using Webhook
Komodo provides a webhook to deploy the stack when the changes is pushed to the git repo.
Portainer also have this feature but paywalled. (Portainer, seriously?)
To integrate with the Gitea while push:
- (Do it ONCE only) Add your komodo domain to your ALLOWED_HOST_LIST in Gitea app.ini or otherwise it won’t work.
- Go to your stack wanted to be auto deployed
- Enable the webhook
- Set any Webhook secret string, anything will do but do not leave it empty
- Select Auth Style to
Github
and copy the url
- Go to your Gitea project, select
Setting > Webhook
- Add a Gitea webhook
- Target URL = komodo webhook url
- Secret = Webhook secret set on komodo
Have a test by pushing something to the repo and you are good to have an auto-redeploy stack.