Echo
is a simple echo server written with elio
library.
Go
on WSLCovers Go
settings on WSL.
elio
Before start, set up elio
project:
git clone https://github.com/cppis/elio && cd elio
go mod vendor
export ELIO_ROOT=$(pwd)
Now, $ELIO_ROOT is the project root path.
Docker
on WSLCovers Docker
settings on WSL.
Kubernetes
on WSLCovers Kind
+Skaffold
settings on WSL for continuous developing a Kubernetes-native app.
go run
To run echo
service, run the following command:
ECHO_IN_URL="0.0.0.0:7001" go run ./app/echo
You can change the listening url of service echo
by changing
environment variable ECHO_IN_URL
.
If the kubernetes cluster does not exist, Follow the next step Create a Kind cluster
.
If you have, Follow the next step ‘Using Skaffold
’.
To create a kind, run the following command:
kind create cluster --config app/assets.k8s/kind.cluster.yaml --name elio
To check if the kind cluster is up and running, run the following command:
kubectl config current-context kind-elio
Skaffold
To run echo
using Skaffold
,
run the following command:
skaffold -f app/echo/assets.k8s/skaffold.yaml dev -p dev
To debugging
Skaffold
, use option-vdebug
.
Or, skaffold debug
acts like skaffold dev
, but it configures containers in pods
for debugging as required for each container’s runtime technology.
skaffold -f app/echo/assets.k8s/skaffold.yaml debug -p debug
You can test echo easily by using telnet.
telnet localhost 7001
Echo echoes plain text, and When receives the next one character,
executes the command:
q
: quit server?
: quit current sessionAfter running skaffold run
or skaffold deploy
and deploying your app to a cluster, running skaffold delete
will remove all the resources you deployed. Cleanup is enabled by default, it can be turned off by --cleanup=false
When running skaffold dev
or skaffold debug
, pressing Ctrl+C
(SIGINT signal) will kick off the cleanup process which will mimic the behavior of skaffold delete
. If for some reason the Skaffold process was unable to catch the SIGINT signal, skaffold delete
can always be run later to clean up the deployed Kubernetes resources.
To enable image pruning, you can run Skaffold with both --no-prune=false
and --cache-artifacts=false
:
skaffold dev --no-prune=false --cache-artifacts=false
Kind
clusterTo delete a Kind
cluster, run the following command:
kind delete cluster --name elio