Score Specification
repository·main·Indexed 27 days ago
https://github.com/score-spec/specA vendor-neutral, open-source workload specification for cloud-native resource requirements. It allows developers to define containers, services, and resources in a platform-agnostic YAML format, which can then be translated into platform-specific configurations like Docker Compose via score-compose or Kubernetes manifests via score-k8s.
What's inside Score
- Score is an open-source, platform-agnostic workload specification designed for cloud-native developers. It allows you to describe a workload's configuration (such as containers, services, and resource dependencies) in a vendor-neutral way. This eliminates the need to maintain separate, platform-specific syntax for tools like Docker Compose or Kubernetes, as a Score specification can be translated into various target formats by different implementations.
Use Score implementations to generate target configurations
mainTo use a Score specification, you must use a Score Implementation to translate the spec into a target format.
Reference implementations include:
score-compose: Converts a Score specification into adocker-compose.yamlfile.score-k8s: Generatesmanifests.yamlfiles for deployment to Kubernetes clusters.
Define a workload using a Score specification
mainA Score specification is typically written in YAML and includes
apiVersion,metadata,containers,service, andresources.containers: Defines the containers in the workload, their images, and environment variables.service: Defines the ports exposed by the workload.resources: Declares dependencies like databases (type: postgres), DNS, or routing requirements.
Variables within containers can use parameterization to reference resource outputs (e.g.,
${resources.db.host}) to ensure environment-agnostic configuration.apiVersion: score.dev/v1b1 metadata: name: sample containers: main: image: ghcr.io/score-spec/sample-app-gif:sha-2533037 variables: PG_CONNECTION_STRING: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}?sslmode=disable" service: ports: web: port: 8080 resources: db: type: postgres dns: type: dns route: type: route params: host: ${resources.dns.host} path: / port: 8080