This score-implementation-sample is a template repo for creating a new Score implementation following the conventions laid out in Score Compose and Score K8s.
This sample comes complete with:
- CLI skeleton including
initandgeneratesubcommandsgenerate --overrides-fileandgenerate --override-propertyfor applying Score overrides before conversiongenerate --imagefor overriding the workload image before conversion.- Full placeholder support for
${metadata...}and${resource...}expressions in the workload variables, files, and resource params.
- State directory storage in
.score-implementation-sample/ TODOin place of resource provisioning and workload conversion
To adapt this for your target platform, you should:
- Fork the repo or use the "use as template" button in Github (this flattens the commit history)

- Rename the go module by replacing all instances of
github.com/score-spec/score-implementation-samplewith your own module name. - Replace all other instances of
score-implementation-samplewith your ownscore-xyzname including renaming thecmd/score-implementation-sampledirectory. - Run the tests with
go test -v ./.... - Change the
TODOin provisioning.go to provision resources and set the resource outputs. The existing implementation resolves placeholders in the resource params but does not set any resource outputs. - Change the
TODOin convert.go to convert workloads into the target manifest form. The existing implementation resolves placeholders in the variables and files sections but just returns the workload spec as yaml content in the manifests.
Good luck, and have fun!
Write the following to score.yaml:
apiVersion: score.dev/v1b1
metadata:
name: example
containers:
main:
image: stefanprodan/podinfo
variables:
key: value
dynamic: ${metadata.name}
files:
- target: /somefile
content: |
${metadata.name}
resources:
thing:
type: something
params:
x: ${metadata.name}And run:
go run ./cmd/score-xyz init
go run ./cmd/score-xyz generate score.yamlThe output manifests.yaml contains the following which indicates:
- Resources were "provisioned" and their parameters interpolated.
- Workloads were converted by copying them to the output manifests with variables or files interpolated as required.
apiVersion: score.dev/v1b1
metadata:
name: example
containers:
main:
files:
- content: |
example
noExpand: true
target: /somefile
image: stefanprodan/podinfo
variables:
dynamic: example
key: value
resources:
thing:
params:
x: example
type: somethingMost code files here retain the Apache licence header since they were copied or adapted from the reference score-compose which is Apache licensed. Any modifications to these files should retain the Apache licence and attribution.