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.
Automatic public HTTPS endpoints
Auto-scaling, including scale to zero
No public IP charges
Canary deployments and other advanced deployment strategies
helloworld-ksvc.yamlapiVersion: serving.knative.dev/v1 # Current version of Knativekind: Servicemetadata:name: helloworld # The name of the appannotations:autoscaling.knative.dev/minScale: "0" # Allow scale to Zeroautoscaling.knative.dev/maxScale: "10" # Maximum number of Pods allowed to auto-scale tospec:template:spec:containerConcurrency: 10 # Container can handle 10 concurrent requestscontainers:- image: gcr.io/knative-samples/helloworld-go # The URL to the image of the appresources:limits:cpu: 2memory: 4Gienv:- name: TARGET # The environment variable printed out by the sample appvalue: "Go Sample v1"
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.
$ kubectl get ksvcNAME URL LATESTCREATED LATESTREADY READY REASONhelloworld https://helloworld.default.knative.chi.coreweave.com helloworld-ngzsn helloworld-ngzsn True
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.