Score Specification and Provisioners
website·Indexed 34 days ago
https://docs.score.dev/docs/Documentation for the Score specification, including details on resources, variables, volumes, probes, and annotations. It provides examples of default and community provisioners for services like Redis, PostgreSQL, RabbitMQ, S3, and Dapr, with implementation templates for score-compose and score-k8s.
What's inside Score
- score-k8s is a reference implementation of the Score specification. It serves two primary purposes: providing a standard for developers to create their own custom Score CLIs and acting as a practical tool for development within Kubernetes environments.
Overview of Score Resource Provisioners
Resource Provisioners in Score are used to manage and provide the necessary infrastructure (resources) for a project. They are categorized by:
- Implementation:
score-compose(local/docker) orscore-k8s(Kubernetes). - Provisioner Type:
Cmd(executes a binary),Local env(uses OS environment variables), orTemplate(uses predefined manifests). - Resource Types: Includes common infrastructure like
postgres,mysql,mongodb,redis,kafka-topic,s3,azure-blob,dns, andllm-model.
- Implementation:
Overview of score-k8s patch templates
Patch templates allow Platform Engineers to modify the output of thescore-k8sconversion process without requiring developers to change their Score specifications. These templates generate JSON patches that are applied to the output manifests just before they are written to the final file. Templates are evaluated as Golang text/templates and can utilize functions from the Masterminds/sprig library.Overview of Score Patch Template Examples
Score provides a variety of patch templates that can be implemented using eitherscore-composeorscore-k8s. These templates allow developers to customize the generated manifests for specific infrastructure requirements, such as integrating with Dapr, configuring Knative services, or applying restrictive Kubernetes Network Policies (Netpol) and Pod Security Standards (PSS).Overview of score-k8s patch templates
Patch templates allow Platform Engineers to modify the output of thescore-k8sconversion process without requiring changes from developers. These templates generate JSON patches that are applied to the output manifests just before they are written. Templates are evaluated as Golang text/templates and must output a YAML/JSON encoded array of patches. Each patch object requires anop(setordelete) and apath(dot-separated JSON path). An optionalvalueis required forsetoperations, and an optionaldescriptioncan be provided for logging.Overview of Score Implementation CLIs
Score provides a specification that allows developers to define their workloads independently of the target runtime. To execute these definitions, a Score implementation CLI is required. While users are encouraged to create custom implementations for their specific container runtimes or internal platforms, there are two primary reference implementations available:score-composeandscore-k8s. Additional community-maintained implementations may also be available.Overview of Score implementation requirements
A Score implementation is responsible for deploying workloads to a target container runtime or platform (e.g., Docker, AWS ECS, GCP Cloud Run, Azure Container Apps, Fly.io). The platform must be able to run Docker or Open Container images, set entrypoint commands/arguments, and inject environment variables at runtime.
The core responsibilities of any implementation are:
- Workload Collection: Gathering and validating Score workload files.
- Resource Provisioning: Provisioning resources defined in the
resourcessection and generating outputs before workload conversion. - Workload Conversion: Converting workloads into platform-specific manifests (e.g., Docker Compose YAML or Kubernetes YAML) while resolving all placeholders.
Overview of score-k8s reference implementation
score-k8s is a reference implementation of the Score specification. It serves two primary purposes: providing a standard for developers creating their own custom Score CLIs and acting as a practical tool for development within Kubernetes environments.Overview of the Score workload specification
Score is an open-source, CNCF Sandbox project that provides a platform-agnostic, container-based workload specification. It allows developers to define a workload's requirements (such as databases or event queues) in a singlescore.yamlfile without using platform-specific syntax (e.g., Kubernetes or Docker Compose). A Score Implementation (typically a CLI) then translates this specification into the native configuration files required by the target platform.Overview of Score Implementation CLIs
Score provides a specification that allows developers to define workloads independently of the target runtime. While users are encouraged to write custom implementations targeting their own container runtimes or internal platforms, two official reference implementations are provided:score-composeandscore-k8s. Additional community-maintained implementations are also available.Overview of score-compose patch templates
Patch templates allow Platform Engineers to modify the output of thescore-composeconversion process without requiring changes from developers. These templates generate JSON patches that are applied to the generated Compose file just before it is written to disk. Templates are evaluated as Golang text/templates and can utilize functions from the Masterminds/sprig library.Overview of score-compose patch templates
Patch templates allow Platform Engineers to modify the output of thescore-composeconversion process without requiring developers to change their Score specifications. These templates generate JSON patches that are applied to the compose file just before it is written to disk. Templates are evaluated as Golang text/templates and must output a YAML or JSON encoded array of patch objects.