diff --git a/content/en/docs/overview/score-for-devs.md b/content/en/docs/overview/score-for-devs.md new file mode 100644 index 00000000..12b5e5f1 --- /dev/null +++ b/content/en/docs/overview/score-for-devs.md @@ -0,0 +1,91 @@ +--- +title: "Score for developers" +linkTitle: "Score for developers" +description: Learn about Score as a developer +weight: 1 +Focus_Keyword: "Learn about Score as a developer" + +--- + +## Experience Score as a Developer + +Score is a workload specification designed to simplify development for cloud-native developers. The spec enables you to describe your workload’s configuration in a vendor-neutral way, eliminating the need for tooling-specific syntax from platforms such as Docker or Kubernetes for example. By leveraging familiar concepts and semantics, defining a workload’s configuration becomes as simple as stating, "I want a database of type X and an event queue of type Y to accompany my workload". + +Below you'll find an example of a simple Score application with a web server that queries a Postgres database on each request. The demo code can be found [here](https://github.com/score-spec/sample-app-gif). + + +``` yaml +# The version string helps identify the Score file syntax +apiVersion: score.dev/v1b1 +metadata: + name: sample + +# A set of containers deployed together for this Workload. +containers: + main: + # The "default" image for our service. When deploying, we may override this with a particular tag. + image: ghcr.io/score-spec/sample-app-gif:sha-2533037 + variables: + # Pass the resource outputs to our container as environment variables. The Score implementation takes care of securing any secret access as needed. + PG_CONNECTION_STRING: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}?sslmode=disable" + +# The service ports indicate which ports of the Workload are exposed for other services to call. +service: + ports: + web: + port: 8080 + +# Each resource dependency has a name and definition that helps the Score implementation link or provision the required resource. +resources: + db: + # This database is specific to this Workload and not shared. + type: postgres + dns: + # Ensure a dns name is available for request routing. + type: dns + route: + # We want to ensure that requests on the Workload hostname go to our service port. + type: route + params: + host: ${resources.dns.host} + path: / + port: 8080 +``` + +You can now use this Score file for deploying your workload to a specific platform such as Docker Compose or Kubernetes. Run it through a Score implementation CLI to generate the configuration manifests, and apply them using the standard platform tooling. In the graphic below, this process is illustrated with our reference implementations: [score-compose](https://github.com/score-spec/score-compose) (for Docker Compose files) and [score-kubernetes](https://github.com/score-spec/score-k8s) (for Kubernetes manifests). + +![how-score-works](/images/how-score-works.png) + +If you’re curious about how this looks in practice, check out the recording below where we walk through examples using [score-compose](https://github.com/score-spec/score-compose) and [score-k8s](https://github.com/score-spec/score-k8s) to generate manifests for Docker Compose and Kubernetes, both derived from the same Score spec. + +