louis70109 / kubernetes-line-echo-bot

A practice for Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A practice for Kubernetes

License:MIT License


Languages

Language:Python 85.3%Language:Dockerfile 12.3%Language:Shell 2.4%