Velocity Blueprints
Blueprints are collections of annotated Kubernetes manifests that Velocity logically groups into abstractions called Velocity Services.
For example, when the following manifests are deployed in Velocity, they will be combined into a single element called
web-api
– a Velocity Service that will be visible in the Velocity UI.Deployment
Service
Ingress
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
velocity.tech.v1/id: web-api # Assign the resulting Velocity service a unique id.
velocity.tech.v1/dependsOn: mongodb # Control the provisioning order and access connection details dynamically from listed Velocity Services.
name: web-api
labels:
app: web-api
spec:
selector:
matchLabels:
app: web-api
replicas: 1
template:
metadata:
labels:
app: web-api
spec:
containers:
- name: web-api
image: example/web_api:latest
env:
- name: MONGO_HOST
value: "{velocity.v1:mongodb.exposures(port=mongo).host}" # Dynamically resolve hostname of "mongo" service.
- name: MONGO_PORT
value: "{velocity.v1:mongodb.exposures(port=mongo).port}" # Dynamically resolve port of "mongo" service.
ports:
- name: web-api
containerPort: 8000
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: web-api
spec:
ports:
- port: 8000
targetPort: 8000
name: web-api
selector:
app: web-api
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web-api
spec:
rules:
- host: "api-{velocity.v1.domainSuffix}" # The host will dynamically relsove to include your designated domain.
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web-api
port:
number: 8000
Velocity Annotations and Templates, such as the Velocity ID and the
MONGO_HOST
value in the above deployment can also be added to Helm values.yaml
files or Kustomize overlays to streamline deploying Velocity and production environments. Last modified 1mo ago