https://github.com/louis70109/kubernetes-line-echo-bot
A practice for Kubernetes
https://github.com/louis70109/kubernetes-line-echo-bot
echo-bot k3d kubernetes line
Last synced: 2 months ago
JSON representation
A practice for Kubernetes
- Host: GitHub
- URL: https://github.com/louis70109/kubernetes-line-echo-bot
- Owner: louis70109
- License: mit
- Created: 2021-02-07T10:27:47.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-16T17:29:22.000Z (over 3 years ago)
- Last Synced: 2025-01-31T22:11:24.799Z (4 months ago)
- Topics: echo-bot, k3d, kubernetes, line
- Language: Python
- Homepage:
- Size: 182 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes practice 1 - LINE echo bot

My environment is MacOS, so it depends on [k3d](https://github.com/rancher/k3d) for local testing.
- Create cluster
- `k3d cluster create mycluster --agents 1 -p '8082:30080@agent[0]'`
- Use NodePort to forward the k3d container.- Input your LINE Chatbot key in `bot_service.yml` environment property.
- Create service: `kubectl apply -f bot_service.yml`
- Forward and let k3d service know the service.
- `kubectl apply -f forward.yml`
First, you can access `localhost:8082/`(GET), you would see a `World` string.
For LINE bot testing, you can use `ngrok` to create a temporary url and input in [LINE Developer Console](https://developers.line.biz/console/) endpoint column, then send requests for your chatbot, it would echo you same words 🗣.
# Note
- Kubernetes’ default NodePort range is **30000-32767**.
- [Reference](https://k3d.io/usage/guides/exposing_services/)# LICENSE
MIT