Skip to main content

Complete Capsule Spec

You can find a documentation of the Platform Capsule and Kubernetes Capsule here. The following is a comprehensive example of both the Platform Capsule and Kubernetes Capsule spec.

apiVersion: platform.rig.dev/v1
kind: Capsule
name: my-capsule
project: myproject
environment: prod
spec:
annotations:
key: value
args:
- arg1
- arg2
command: ./somecommand
files:
- path: /etc/config.yaml
string: "contents of file"
- path: /etc/config2.yaml
string: "contents of secret"
asSecret: true
- path: /etc/config3.yaml
ref:
kind: ConfigMap
name: myconfigmap
key: content
env:
raw:
ENV_VAR: value
sources:
- name: envvars-configmap
kind: ConfigMap
- name: envvars-secret
kind: Secret
image: nginx:latest
interfaces:
- name: http
port: 4747
liveness:
path: /healthz
- name: ready
port: 4748
readiness:
tcp: true
- name: ingress
port: 5678
routes:
id: id1
host: http://www.example.com
paths:
- path: /some/path
match: PathPrefix
- path: /some/other/path
match: Exact
annotations:
key: value
scale:
horizontal:
cpuTarget:
utilization: 80
instances:
max: 5
min: 2
customMetrics:
- instanceMetric:
metricName: some-metric
averageValue: 10
- objectMetric:
metricName: some-metric
describedObject:
kind: Service
name: some-service
value: 3
vertical:
cpu:
request: 2.5
limit: 5
memory:
request: 500M
limit: 2G
gpu:
request: 1
limit: 2
cronJobs:
- name: some-bash-job
schedule: 30 12 * * *
command:
command: ./cmd
args: ['arg1', 'arg2']
maxRetries: 3
timeoutSeconds: 600
- name: some-http-job
schedule: 1/10 * * * *
url:
port: 1234
path: /some/path
queryParameters:
key1: value1
key2: value2
timeoutSeconds: 60