Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanvolum committed Oct 21, 2019
2 parents 75e8e6e + 2c084fa commit 2d1bc10
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
22 changes: 21 additions & 1 deletion 1.hello-world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ You can do this using `curl` with:
curl -XPOST -d @sample.json http://localhost:3500/v1.0/invoke/mynode/method/neworder
```

You can also do this using the Visual Studio Code [Rest Client Plugin](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)

[sample.http](sample.http)
```http
POST http://localhost:3500/v1.0/invoke/mynode/method/neworder
{
"data": {
"orderId": "42"
}
}
```

Or you can use the Postman GUI

Open Postman and create a POST request against `http://localhost:3500/v1.0/invoke/mynode/method/neworder`
Expand All @@ -131,7 +144,14 @@ Now, let's just make sure that our order was successfully persisted to our state
curl http://localhost:3500/v1.0/invoke/mynode/method/order
```

Or use the Postman GUI
or using the Visual Studio Code [Rest Client Plugin](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)

[sample.http](sample.http)
```http
GET http://localhost:3500/v1.0/invoke/mynode/method/order
```

or use the Postman GUI

![Postman Screenshot 2](./img/postman2.jpg)

Expand Down
7 changes: 7 additions & 0 deletions 1.hello-world/sample.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POST http://localhost:3500/v1.0/invoke/mynode/method/neworder

{ "data": {"orderId":"42"} }

###

GET http://localhost:3500/v1.0/invoke/mynode/method/order
11 changes: 11 additions & 0 deletions 2.hello-kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ This sample requires you to have the following installed on your machine:

The first thing you need is an RBAC enabled Kubernetes cluster. This could be running on your machine using Minikube, or it could be a fully-fledged cluser in Azure using [AKS](https://azure.microsoft.com/en-us/services/kubernetes-service/). Once you have a cluster, follow [these steps](https://github.com/dapr/docs/blob/master/getting-started/environment-setup.md#installing-dapr-on-a-kubernetes-cluster) to deploy Dapr to it.

```
$ dapr init --kubernetes
ℹ️ Note: this installation is recommended for testing purposes. For production environments, please use Helm
⌛ Making the jump to hyperspace...
✅ Deploying the Dapr Operator to your cluster...
✅ Success! Dapr has been installed. To verify, run 'kubectl get pods -w' in your terminal
```

## Step 2 - Create and Configure a State Store

Dapr can use a number of different state stores (Redis, CosmosDB, DynamoDB, Cassandra, etc.) to persist and retrieve state. For this demo, we'll use Redis.
Expand Down Expand Up @@ -116,6 +125,8 @@ Wait until the IP is visible: (may take a few minutes)
kubectl get svc nodeapp
```

> Note: Minikube users cannot see the external IP. Instead, you can use `minikube service [service_name]` to access loadbalancer without external IP.
Once you have an external IP, save it.
You can also export it to a variable:

Expand Down
8 changes: 4 additions & 4 deletions 2.hello-kubernetes/deploy/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
type: state.redis
metadata:
- name: "redisHost"
value: "YOUR_REDIS_HOST_HERE:6379"
- name: "redisPassword"
value: "YOUR_REDIS_KEY_HERE"
- name: redisHost
value: YOUR_REDIS_HOST_HERE:6379
- name: redisPassword
value: YOUR_REDIS_KEY_HERE

0 comments on commit 2d1bc10

Please sign in to comment.