/devspace-tutorial

Tutorial for devspace

Primary LanguageGo

devspace-tutorial

This is a simple tutorial to demonstrate how to use DevSpace to deploy a simple Go application to Kubernetes.

Spin up a local cluster

make createCluster

If you are done with the cluster, you can delete it with:

make deleteCluster

Build and deploy the application

devspace build
devspace deploy

Access the application

Port forward the service to access the application:

kubectl port-forward svc/mydemo-service 3333:8080

Listing articles

curl http://localhost:3333/articles

Getting an article

curl http://localhost:3333/article/{id}

Adding articles

curl -X POST http://localhost:3333/article -H "Content-Type: application/json" -d '{
  "Id": "3",
  "Title": "New Article",
  "Desc": "New Article Description",
  "Content": "New Article Content"
}'

Deleting an article

curl -X DELETE http://localhost:3333/article/3

Debugging the application

devspace dev

# in the new terminal
make debug

Now connect to the debugger remotely to localhost:2345 in your IDE.

Docs

Building the slides:

make slides