Skip to content

louis70109/kubernetes-line-echo-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes practice 1 - LINE echo bot

My environment is MacOS, so it depends on 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 endpoint column, then send requests for your chatbot, it would echo you same words 🗣.

Note

  • Kubernetes’ default NodePort range is 30000-32767.

LICENSE

MIT