Skip to content
This repository was archived by the owner on Mar 16, 2022. It is now read-only.

Commit 23d04b4

Browse files
committed
Updated README
1 parent 16cde65 commit 23d04b4

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,30 @@ The operator should work on any Kubernetes distribution, we have tested on GKE w
1515
### Running on GKE
1616

1717
1. Create a GKE cluster. We recommend at least 6 vCPUs (ie, a node pool of 3 `n1-standard-2` nodes). Also ensure that the current user is a cluster admin. Detailed instructions for creating the GKE cluster can be found in the [Knative documentation](https://github.com/knative/docs/blob/master/docs/install/Knative-with-GKE.md), follow all the steps up to (but not including) installing Knative.
18-
2. Install Cassandra. This can be done from the Google Marketplace, by visiting the [Cassandra Cluster](https://console.cloud.google.com/marketplace/details/google/cassandra), selecting configure, selecting your GCloud project, and then installing it in the Kubernetes cluster you just created. The defaults should be good enough, in our examples we called the app instance name `cassandra`.
18+
2. If using an event sourced entity, install Cassandra. This can be done from the Google Marketplace, by visiting the [Cassandra Cluster](https://console.cloud.google.com/marketplace/details/google/cassandra), selecting configure, selecting your GCloud project, and then installing it in the Kubernetes cluster you just created. The defaults should be good enough, in our examples we called the app instance name `cassandra`. Note there is an option to use an in memory journal if you just want to test it out, of course, as soon as your pods shut down (or if they are rebalanced), your journals will be lost.
1919
3. Install the CloudState operator:
2020

2121
```
22-
kubectl apply -f https://raw.githubusercontent.com/lightbend/stateful-serverless/v0.3/src/operator/stateful-serverless.yaml
22+
kubectl apply -f https://raw.githubusercontent.com/cloudstateio/cloudstate/master/operator/stateful-serverless.yaml
2323
```
2424
2525
You are now ready to install an event sourced function. We have a shopping cart example in the `samples/js-shopping-cart` directory of this project. This can be installed by following these instructions:
2626
2727
1. Configure a Cassandra journal. If you called your Cassandra deployment `cassandra` and deployed it to the default namespace, this can be installed by running:
2828
2929
```
30-
kubectl apply -f https://raw.githubusercontent.com/lightbend/stateful-serverless/v0.3/src/samples/js-shopping-cart/journal.yaml
30+
kubectl apply -f https://raw.githubusercontent.com/cloudstateio/cloudstate/master/samples/js-shopping-cart/cassandra-journal.yaml
3131
```
3232
3333
Otherwise, download the above file and update the `service` parameter to match the first node of your Cassandra stateful set.
3434
3535
2. Install the shopping cart, this can be done by running:
3636
3737
```
38-
kubectl apply -f https://raw.githubusercontent.com/lightbend/stateful-serverless/v0.3/src/samples/js-shopping-cart/eventsourced.yaml
38+
kubectl apply -f https://raw.githubusercontent.com/cloudstateio/cloudstate/master/samples/js-shopping-cart/js-shopping-cart.yaml
3939
```
4040
41-
3. The operator will install a service that will expose this on an external IP address, watch the service to find out what the IP address is (it may take a minute or so to provision):
42-
43-
```
44-
kubectl get svc shopping-cart -w
45-
```
46-
47-
4. To test, instantiate a gRPC client in your favourite language for [this descriptor](https://raw.githubusercontent.com/lightbend/stateful-serverless/v0.3/src/samples/js-shopping-cart/proto/shoppingcart.proto). You may need to also download the [`lightbend/serverless/entitykey.proto`](https://raw.githubusercontent.com/lightbend/stateful-serverless/v0.3/src/backend/core/src/main/proto/lightbend/serverless/entitykey.proto) and [`google/protobuf/empty.proto`](https://raw.githubusercontent.com/lightbend/stateful-serverless/v0.3/src/samples/js-shopping-cart/proto/google/protobuf/empty.proto) descriptors to compile it in your language. The shopping cart descriptor is deployed with debug on, so try getting the logs of the `shopping-cart` container in each of the deployed pods to see what's happening when commands are sent.
41+
The operator will install a service, you can then create an ingress for that service. To test, instantiate a gRPC client in your favourite language for [this descriptor](https://raw.githubusercontent.com/cloudstateio/cloudstate/master/examples/shoppingcart/shoppingcart.proto). You may need to also download the [`cloudstate/entitykey.proto`](https://raw.githubusercontent.com/cloudstateio/cloudstate/master/protols/frontend/cloudstate/entity.proto) and [`google/protobuf/empty.proto`](https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/empty.proto) descriptors to compile it in your language. The shopping cart descriptor is deployed with debug on, so try getting the logs of the `shopping-cart` container in each of the deployed pods to see what's happening when commands are sent.
4842
4943
### Points of interest
5044
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Deployment spec for a journal. A journal is a logical abstraction over a database
2+
# deployment, and captures how to deploy and connect to that database. Multiple
3+
# StatefulServices's would use a single journal.
4+
apiVersion: cloudstate.io/v1alpha1
5+
kind: Journal
6+
metadata:
7+
name: cassandra
8+
spec:
9+
10+
# The type of Journal - valid values would come from an enum of supported databases.
11+
type: Cassandra
12+
13+
# The deployment type, ie, how this Journal is deployed. Valid values would depend on
14+
# the Journal type, but all types would support "Unmanaged", which indicates that the
15+
# operator doesn't manage/deploy the database itself, ie, the user has to deploy
16+
# the database themselves. For Cassandra, future supported values might include
17+
# "GoogleCloudMarketplace", which would deploy Cassandra using Google's Application
18+
# CRD, or "InstaclustrOperator", which would deploy Cassandra using Instaclustr's
19+
# Cassandra operator.
20+
deployment: Unmanaged
21+
22+
# Type and deployment specific configuration for the journal.
23+
config:
24+
25+
# The name of the unmanaged Cassandra service to connect to.
26+
service: cassandra-cassandra-0.cassandra-cassandra-svc.cassandra.svc.cluster.local
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Deployment spec for a journal. A journal is a logical abstraction over a database
22
# deployment, and captures how to deploy and connect to that database. Multiple
3-
# EventSourcedFunction's would use a single journal.
3+
# StatefulService's would use a single journal.
44
apiVersion: cloudstate.io/v1alpha1
55
kind: Journal
66
metadata:
77
name: inmemory
88
spec:
99

1010
# The type of Journal - valid values would come from an enum of supported databases.
11-
# Currently, Cassandra is the only supported database.
11+
# This is the InMemory journal, which obviously should not be used in production.
1212
type: InMemory
1313

samples/js-shopping-cart/eventsourced.yaml renamed to samples/js-shopping-cart/js-shopping-cart.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ spec:
88
# Journal configuration
99
journal:
1010

11-
# Name of a deployed EventSourcedJournal to use.
12-
name: inmemory
11+
# Name of a deployed Journal to use.
12+
name: cassandra
13+
14+
# Journal specific configuration
15+
config:
16+
17+
# Since the journal is a Cassandra journal, we need to specify the keyspace to use.
18+
keyspace: shoppingcart
1319

1420
containers:
1521
- image: cloudstateio/js-shopping-cart:latest

0 commit comments

Comments
 (0)