Production zones enable serving from various locations, with a CI/CD pipeline for safe deployments. This guide goes through the minimal steps for a production deployment - in short:
The sample application used in getting started is a good basis for these steps, see source files.
There are alternative ways of deploying at the end of this guide, too.
Add deployment.xml to the application package root (next to services.xml):
Modify services.xml - minimal example:
The key here is the
nodes-section per container and content cluster,
where you specify resources:
Give the deployment a name and log in:
$ vespa config set target cloud $ vespa config set application mytenant.myapp $ vespa auth login
The tenant name is found in the console, the application is something unique within your organization - see tenants, applications and instances.
Just as in the getting started guide, the application package needs the public key in the security directory. You might already have a pair, if not generate it:
$ vespa auth cert -f Success: Certificate written to security/clients.pem Success: Certificate written to /Users/me/.vespa/mytenant.myapp.default/data-plane-public-cert.pem Success: Private key written to /Users/me/.vespa/mytenant.myapp.default/data-plane-private-key.pem
Observe that the files are put in $HOME/.vespa. The content from data-plane-public-cert.pem is copied to security/clients.pem. More details on data-plane access control permissions.
Package the application and deploy it to a production zone:
$ vespa prod deploy
Find alternative deployment procedures in the next sections.
See Automating with GitHub Actions for an example of how to automate deployments.
Instead of using the Vespa CLI, one can build an application package for production deployment using zip only:
$ zip -r application.zip . \ -x application.zip "ext/*" README.md .gitignore ".idea/*"
Deploying an application with Components is a little different from above:
See Getting started java for prerequisites. Procedure:
$ mvn vespa:compileVersion \ -Dtenant=mytenant \ -Dapplication=myapp
$ mvn -U package -Dvespa.compile.version="$(cat target/vespa.compile.version)"
Experiment with the Vespa CLI to auto-generate some of the steps above:
$ vespa prod init