Skip to content

Centralized Deployment

Centralized Deployment

A single ContractShield service for multiple applications.

Architecture

Apps → Load Balancer → ContractShield Service → Redis

Kubernetes Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
name: contractshield
spec:
replicas: 3
template:
spec:
containers:
- name: contractshield
image: contractshield/sidecar:latest
env:
- name: REDIS_URL
value: "redis://redis:6379"
---
apiVersion: v1
kind: Service
metadata:
name: contractshield
spec:
ports:
- port: 3100
selector:
app: contractshield

Client Configuration

import { ContractShieldClient } from '@cshield/client';
const client = new ContractShieldClient({
url: 'http://contractshield:3100',
cacheEnabled: true,
failOpen: true
});