Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy using Knative #62

Merged
merged 4 commits into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/deployment-operations/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Otherwise, some recommended approaches are detailed below:

| Infrastructure | Approach |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------|
| Knative | Use Knative for autoscaling, scale to zero and the integrated L7 load balancing |
| Istio / LinkerD | Ensure sidecar is injected into Restate pod and all service pods |
| Cilium | Ensure Cilium is installed with `loadBalancer.l7.backend=envoy`, and annotate service pods with `service.cilium.io/lb-l7=enabled` |
| Minikube | For local development it's likely not worth worrying about; see below |
Expand Down Expand Up @@ -175,6 +176,35 @@ spec:

L7 load balancing is not needed when there is only one pod, so it's acceptable to use a normal ClusterIP Service.

### Knative

Restate supports Knative services. Knative allows scaling to zero when there are no in-flight invocations and automatically configures an L7 load balancer. There are no special requirements to deploy a service endpoint container with Knative:

```shell
$ kn service create service-name --port h2c:8080 --image path.to/yourrepo:yourtag
```

Or using the YAML manifest:

```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: service-name
spec:
template:
spec:
containers:
- image: path.to/yourrepo:yourtag
ports:
- name: h2c
containerPort: 8080
```

The service will be accessible at `http://<service-name>.<namespace>.svc`.

By default Knative exposes the service through the Ingress. This is not required by Restate, and you can disable this behavior adding the argument `--cluster-local` to the aforementioned creation command.

### Simple L7 load balancing with an envoy sidecar

A simple approach to L7 load balancing is to set up an Envoy sidecar in the Restate pod which acts as a transparent HTTP proxy
Expand Down