Configuring Services
Services are the building blocks of your infrastructure. OpenPrime provides a configuration-driven approach to defining and deploying cloud services.
Available Services​
Compute​
| Service | AWS | Azure | GCP | On-Premise |
|---|---|---|---|---|
| Kubernetes | EKS | AKS | GKE | K8s |
| Virtual Machines | EC2 | VMs | Compute Engine | - |
| Serverless | Lambda | Functions | Cloud Functions | - |
Storage​
| Service | AWS | Azure | GCP |
|---|---|---|---|
| Object Storage | S3 | Blob Storage | Cloud Storage |
| Block Storage | EBS | Managed Disks | Persistent Disk |
| File Storage | EFS | Azure Files | Filestore |
Database​
| Service | AWS | Azure | GCP |
|---|---|---|---|
| PostgreSQL | RDS | Database for PostgreSQL | Cloud SQL |
| MySQL | RDS | Database for MySQL | Cloud SQL |
| Redis | ElastiCache | Cache for Redis | Memorystore |
Kubernetes Configuration​
Basic Setup​
kubernetes:
enabled: true
clusterName: my-cluster
version: "1.28"
Node Groups​
Define multiple node groups for different workloads:
kubernetes:
nodeGroups:
- name: system
instanceType: t3.medium
desiredSize: 3
minSize: 3
maxSize: 5
labels:
role: system
taints:
- key: CriticalAddonsOnly
effect: NoSchedule
- name: workload
instanceType: t3.large
desiredSize: 5
minSize: 2
maxSize: 20
labels:
role: workload
Networking​
kubernetes:
networking:
vpcCidr: "10.0.0.0/16"
podCidr: "10.244.0.0/16"
serviceCidr: "10.96.0.0/12"
publicSubnets:
- "10.0.1.0/24"
- "10.0.2.0/24"
privateSubnets:
- "10.0.10.0/24"
- "10.0.11.0/24"
Add-ons​
kubernetes:
addons:
- name: vpc-cni
version: latest
- name: coredns
version: latest
- name: kube-proxy
version: latest
Database Configuration​
RDS PostgreSQL​
database:
enabled: true
engine: postgresql
version: "15"
instanceClass: db.t3.medium
allocatedStorage: 100
maxAllocatedStorage: 500
multiAZ: true
publiclyAccessible: false
backupRetention: 7
High Availability​
database:
multiAZ: true
readReplicas: 2
backupRetention: 30
deletionProtection: true
Storage Configuration​
S3 Buckets​
storage:
enabled: true
buckets:
- name: app-assets
versioning: true
encryption: AES256
lifecycle:
- id: archive-old
prefix: logs/
transitions:
- days: 30
storageClass: STANDARD_IA
- days: 90
storageClass: GLACIER
Service Dependencies​
OpenPrime automatically handles service dependencies:
graph TD
A[Helm Charts] --> B[Kubernetes]
C[Load Balancer] --> B
D[Ingress] --> B
E[Service Mesh] --> B
Custom Configuration​
Using JSON Schema​
Services are defined using JSON Schema:
// servicesConfig.js
kubernetes: {
schema: {
clusterName: {
type: 'string',
required: true,
pattern: '^[a-z][a-z0-9-]{2,62}$',
description: 'Cluster name (lowercase, alphanumeric, hyphens)'
},
version: {
type: 'select',
options: ['1.28', '1.27', '1.26'],
default: '1.28'
}
}
}
Provider-Specific Options​
Some options vary by provider:
# AWS EKS
kubernetes:
instanceType: t3.medium # EC2 instance types
# Azure AKS
kubernetes:
instanceType: Standard_D2_v3 # Azure VM sizes
# GCP GKE
kubernetes:
instanceType: e2-medium # GCP machine types
Best Practices​
- Start small - Begin with minimal resources, scale up
- Use tags - Apply consistent tags for cost tracking
- Enable monitoring - Always include monitoring services
- Plan for HA - Use multi-AZ for production
- Secure defaults - Private subnets, encryption enabled