Kubernetes Deployment
Run PACE on your Kubernetes cluster
PACE includes Kubernetes awareness and support through the Spring Cloud Kubernetes project. Application properties can be loaded through ConfigMaps or Secrets, as documented there. On this page, we show our preferred way of deploying PACE on Kubernetes. Adjust this to your own (Kubernetes) setup and way of working as needed.
As a prerequisite, a Postgres DB instance is required, reachable from your Kubernetes cluster, ideally with its own PACE database and user.
Kubernetes spec files
You may want to create a new namespace for PACE first:
In a directory of your choice, create the following three spec files. (Again, adjust to your own setup, e.g. using Terraform or Kustomize.)
Application configuration
In the Quickstart, we showed how the Spring Boot application configuration file was mounted as a volume in the PACE Docker container using Docker compose. For Kubernetes, you could use a similar approach. We suggest creating a Kubernetes Secret containing the entire application configuration yaml as stringData
, for example:
Deployment
With the application configuration secret in place, you can create a Kubernetes deployment with a spec similar to the following:
As you can see, we chose the approach of mounting the configuration yaml from the secret as a file and setting the spring.config.import
property through the SPRING_CONFIG_IMPORT
env variable, matching the volume mount's directory. You can use or combine the other approaches supported by Spring. We prefer this way, as we can simply keep using YAML.
Service
You will probably want to expose the PACE deployment through a Kubernetes service, similar to the following:
Applying the configuration
Now all you need to start PACE is to apply these specs:
Or simply kubectl apply --namespace pace -f .
if these are the only files in your current directory.
You can now interact with PACE, for example through port forwards or tools like Telepresence.
An example port forward to the JSON gRPC proxy endpoint:
After which you may retrieve the configured processing platforms like so:
Cleanup
Execute kubectl delete --namespace pace -f .
from the directory containing the spec files, or simply delete the namespace itself with kubectl delete namespace pace
, if applicable to your setup.
If you miss any Kubernetes-related functionality, please reach out to us!
Last updated