Skip to content

Commit

Permalink
added instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
onedeveloper committed Nov 2, 2023
1 parent 4a9bda7 commit eeeb977
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Requiremnets:
- kind
- helm
- docker

# initializing the project:

## create the cluster
```console
kind create cluster --config cluster.yaml
```

## build the backend image
```console
docker build -t ormuco-backend:1.2 .
```

## ensure the image is available to the cluster
```console
kind load docker-image ormuco-backend:1.2
docker exec -it $(kind get clusters | head -1)-control-plane crictl images
```

# deploying the application

```console
helm install ormuco-database ./charts/ormuco-database
helm install ormuco-backend ./charts/ormuco-backend
```

# testing the application
```console
kubectl get pods
kubectl get services
kubectl port-forward service/ormuco-backend 8000:80
```

# running the tests
```console
# write to the database
curl -X 'POST' \
'http://localhost:8000/items/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "pencil",
"price": 1.0,
"count": 100
}'

# get a list of items
curl -X 'GET' \
'http://localhost:8000/items/' \
-H 'accept: application/json'
```

you can also reach the api documentation via:
http://localhost:8000/docs

0 comments on commit eeeb977

Please sign in to comment.