CoreWeave
Search…
Serverless
Deploying applications as serverless services is a good alternative to a regular Deployment / Service model when the applications purpose is to serve HTTP or gRPC requests, either internal or from the Internet. CoreWeave uses the KNative runtime to support deploying a serverless application with a single manifest. No installation necessary.

Serverless Benefits

  • Automatic public HTTPS endpoints
  • Auto-scaling, including scale to zero
  • No public IP charges
  • Canary deployments and other advanced deployment strategies

One Step Example

helloworld-ksvc.yaml
1
apiVersion: serving.knative.dev/v1 # Current version of Knative
2
kind: Service
3
metadata:
4
name: helloworld # The name of the app
5
spec:
6
template:
7
metadata:
8
annotations:
9
autoscaling.knative.dev/minScale: "0" # Allow scale to Zero
10
autoscaling.knative.dev/maxScale: "10" # Maximum number of Pods allowed to auto-scale to
11
spec:
12
# The container concurrency defines how many active requests are sent to a single
13
# backend pod at a time. This configuration is important as it effects how well requests
14
# are load balanced over Pods. For a standard, non-blocking web applocation this can usually
15
# be rather high, ie 100. For GPU Inference however, this should usually be set to 1.
16
# GPU Inference only processes one request at a time, and one wants to avoid a queue being
17
# built up in the local pod instead of centrally in the Load Balancer.
18
containerConcurrency: 10
19
containers:
20
- image: gcr.io/knative-samples/helloworld-go # The URL to the image of the app
21
resources:
22
limits:
23
cpu: 2
24
memory: 4Gi
25
env:
26
- name: TARGET # The environment variable printed out by the sample app
27
value: "Go Sample v1"
28
Copied!
After applying the manifest, get the public URL of the service. The service will be scaled up and down based on demand, and scaled to zero consuming no resources and incurring no billable charges when idle.
1
$ kubectl get ksvc
2
NAME URL LATESTCREATED LATESTREADY READY REASON
3
helloworld https://helloworld.default.knative.chi.coreweave.com helloworld-ngzsn helloworld-ngzsn True
Copied!

Monitoring

Managed Grafana provides monitoring of requests, success rates, response times and auto-scaling metrics transparently. No metrics specific code needs to be added to the serverless application.
Copy link
Contents
Monitoring