appconfiguration
Schema AppConfiguration
AppConfiguration is a developer-centric definition that describes how to run an Application.
This application model builds upon a decade of experience at AntGroup running super large scale
internal developer platform, combined with best-of-breed ideas and practices from the community.
Attributes
Name and Description | Type | Default Value | Required |
---|---|---|---|
workload Workload defines how to run your application code. Currently supported workload profile includes Service and Job. | workload.Service \ | workload.Job | Undefined |
opsRule OpsRule specifies collection of rules that will be checked for Day-2 operation. | trait.OpsRule | Undefined | optional |
database Database describes a locally deployed or a cloud provider managed database instance for the workload. | {str: mysql.MySQL | postgres.PostgreSQL} | Undefined | optional |
monitoring | monitoring.Prometheus | Undefined | optional |
labels | {str: str} | Undefined | optional |
annotations | {str: str} | Undefined | optional |
Examples
# Instantiate an App with a long-running service and its image is "nginx:v1"
import catalog.models.schema.v1 as ac
import catalog.models.schema.v1.workload as wl
import catalog.models.schema.v1.workload.container as c
import catalog.models.schema.v1.accessories.database as db
import catalog.models.schema.v1.accessories.monitoring as m
import catalog.models.schema.v1.accessories.trait as t
appConfiguration = ac.AppConfiguration {
workload: wl.Service {
containers: {
"nginx": c.Container {
image: "nginx:v1"
}
}
type: "CollaSet"
}
opsRule: t.OpsRule {
maxUnavailable: "30%"
}
database: db.Database {
type: "aws"
engine: "mysql"
version: "5.7"
instanceType: "db.t3.micro"
}
monitoring: m.Prometheus{
interval: "30s"
timeout: "15s"
path: "/metrics"
port: "web"
scheme: "http"
}
}