Skip to content

Instantly share code, notes, and snippets.

@edwardcallahan
Created January 28, 2020 01:05
Show Gist options
  • Save edwardcallahan/d817e9f75f82b6fe30a64f966e9b34a7 to your computer and use it in GitHub Desktop.
Save edwardcallahan/d817e9f75f82b6fe30a64f966e9b34a7 to your computer and use it in GitHub Desktop.
Postgres StatefulService and VirtualService
apiVersion: cloudstate.io/v1alpha1
kind: StatefulStore
metadata:
namespace: cloudstate
name: postgres-sstore
spec:
type: Postgres
deployment: Unmanaged
config:
service: x.x.x.x
credentials: # use a secret instead
database: shopping_cart
username: postgres
password: ###########
---
apiVersion: cloudstate.io/v1alpha1
kind: StatefulService
metadata:
name: pgs-cart-ssvc
namespace: cloudstate
labels:
app: pgs-cart
spec:
datastore:
name: postgres-sstore
containers:
- image: calncal/js-shopping-cart:latest
---
# HTTP routes will be applied to platform service ports named ‘http-’/‘http2-’/‘grpc-*’, gateway ports with protocol HTTP/HTTP2/GRPC/ TLS-terminated-HTTPS and service entry ports using HTTP/HTTP2/GRPC protocols. https://istio.io/docs/reference/config/networking/virtual-servi
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: grpc-pgs-cart-gateway
namespace: cloudstate
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: GRPC
protocol: GRPC
hosts:
- "pgsshopping.cloudstate.io"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: pgs-cart-vs
namespace: cloudstate
spec:
hosts:
- "pgsshopping.cloudstate.io"
gateways:
- grpc-pgs-cart-gateway
http:
- match:
- uri:
prefix: /cart
- uri:
prefix: /carts
route:
- destination:
host: pgs-cart-ssvc
port:
number: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment