Skip to main content

CRD & Operator

The foundation of Rig is our Capsule CRD (CustomResourceDefinition). The Rig Operator will spawn all derived Kubernetes resources as defined by a Capsule resource. It will also watch these derived resources and undo any changes applied to them which conflicts with their Capsule parent. Updating these resources can only be done by updating the corresponding capsule spec. The resources we spawn are

ConfigMaps and Secrets used by a capsule is not owned by the capsule though. These will be created by the Platform and can be updated independently of the capsules. The operator, however, will watch those config files and redeploy instances if configs or secrets they depend on have been changed.

Capsule Spec‚Äč

This is a complete example of the Capsule CRD spec

apiVersion: rig.dev/v1alpha1
kind: Capsule
metadata:
name: my-capsule
namespace: default
spec:
image: nginx:latest
command: ./somecommand
args:
- arg1
- arg2
files:
- path: /etc/config.yaml
secret:
key: config.yaml
name: config
horizontalScale:
cpuTarget:
averageUtilizationPercentage: 80
minReplicas: 2
maxReplicas: 5
interfaces:
- name: http
port: 4747
public:
loadBalancer:
nodePort: 30047
port: 4747
- name: ingress
port: 5678
public:
ingress:
host: http://www.example.com
serviceAccountName: name