diff --git a/content/en/docs/community/_index.md b/content/en/docs/community/_index.md index ec669fd6..9839b41f 100644 --- a/content/en/docs/community/_index.md +++ b/content/en/docs/community/_index.md @@ -42,6 +42,7 @@ We host [regular community meetings](https://github.com/score-spec/spec?tab=read ## Read external blog posts about Score +- [Deploy Backstage with Score](https://medium.com/@mabenoit/deploy-backstage-with-score-45bb2d7c2d90) - [Stop Building Platforms Nobody Uses: Pick the Right Kubernetes Abstraction with GitOps](https://itnext.io/stop-building-platforms-nobody-uses-pick-the-right-kubernetes-abstraction-with-gitops-64681357690f) - [From CI to Kubernetes Catalog: Building a Composable Platform with GitOps and vCluster](https://itnext.io/from-ci-to-kubernetes-catalog-building-a-composable-platform-with-gitops-and-vcluster-7e1decaa81da) - [Descomplicando o Score (CNCF)](https://www.linkedin.com/pulse/descomplicando-o-score-cncf-clecio-antao-nyt3f/) @@ -53,6 +54,7 @@ We host [regular community meetings](https://github.com/score-spec/spec?tab=read ## Leverage example projects using Score +- [`mathieu-benoit/deploy-backstage-with-score`](https://github.com/mathieu-benoit/deploy-backstage-with-score) - [`la-cc/score-k8s-webapp`](https://github.com/la-cc/score-k8s-webapp) - [`mathieu-benoit/nginx-score-demo`](https://github.com/mathieu-benoit/nginx-score-demo) - [`kendallroden/kubecon-dapr-score-demo`](https://github.com/kendallroden/kubecon-dapr-score-demo) diff --git a/content/en/docs/examples/backstage.md b/content/en/docs/examples/backstage.md new file mode 100644 index 00000000..1a0d7671 --- /dev/null +++ b/content/en/docs/examples/backstage.md @@ -0,0 +1,404 @@ +--- +title: "Backstage" +linkTitle: "Backstage" +description: "How to deploy a containerized Backstage application using a PostgreSQL database with `score-compose` and `score-k8s`" +weight: 6 +--- + +## Overview + +In this example we will walk you through how you can deploy a containerized Backstage application using a PostgreSQL database, and this with both `score-compose` and `score-k8s`. + +```mermaid +flowchart TD + dns[DNS] --> backstage-workload(Backstage) + subgraph Workloads + backstage-workload + end + backstage-workload-->postgres[(PostgreSQL)] +``` + +## 1. `score.yaml` + +Open your IDE and paste in the following `score.yaml` file, which describes a simple web server exposed via a DNS that queries a PostgreSQL database on each request. The demo code can be found [here](https://github.com/mathieu-benoit/deploy-backstage-with-score). + +```yaml +apiVersion: score.dev/v1b1 +metadata: + name: backstage +containers: + backstage: + image: . + command: + - "node" + args: + - packages/backend + - "--config" + - app-config.yaml + - "--config" + - app-config.production.yaml + variables: + POSTGRES_HOST: ${resources.pg.host} + POSTGRES_PASSWORD: ${resources.pg.password} + POSTGRES_PORT: ${resources.pg.port} + POSTGRES_USER: ${resources.pg.username} + APP_CONFIG_auth_providers_guest_dangerouslyAllowOutsideDevelopment: "true" + APP_CONFIG_app_baseUrl: ${resources.dns.url} + APP_CONFIG_backend_baseUrl: ${resources.dns.url} + APP_CONFIG_backend_cors_origin: ${resources.dns.url} +service: + ports: + tcp: + port: 7007 + targetPort: 7007 +resources: + pg: + type: postgres-instance + dns: + type: dns + route: + type: route + params: + host: ${resources.dns.host} + path: / + port: 7007 +``` + +From here, we will now see how you can deploy this exact same Score file: + +- Either with [`score-compose`](#2-score-compose) +- Or with [`score-k8s`](#3-score-k8s) + +## 2. `score-compose` + +To begin, follow the [installation instructions](/docs/score-implementation/score-compose/installation) to install the latest version of `score-compose`. + +### `init` + +Initialize your current `score-compose` workspace, run the following command in your terminal: + +```bash +score-compose init --no-sample \ + --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/dns/score-compose/10-dns-with-url.provisioners.yaml +``` + +The `init` command will create the `.score-compose` directory with the [default resource provisioners]({{< relref "/docs/score-implementation/score-compose/resources-provisioners/" >}}) available. We are also importing one external file to support the `dns` dependencies: [`dns` provisioner](https://github.com/score-spec/community-provisioners/blob/main/service/score-compose/10-dns-with-url.provisioners.yaml). + +You can see the resource provisioners available by running this command: + +```bash +score-compose provisioners list +``` + +The Score file example illustrated uses three resource types: `postgres-instance`, `dns` and `route`. + +```none ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| TYPE | CLASS | PARAMS | OUTPUTS | DESCRIPTION | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| dns | (any) | | host, url | Outputs a *.localhost domain as | +| | | | | the hostname and associated URL | +| | | | | in http on port 8080 | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| postgres-instance | (any) | | host, password, port, username | Provisions a dedicated | +| | | | | PostgreSQL instance | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| route | (any) | host, path, port | | Provisions an Ingress route on | +| | | | | a shared Nginx instance | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +``` + +### `generate` + +Convert the `score.yaml` file into a runnable `compose.yaml`, run the following command in your terminal: + +```bash +score-compose generate score.yaml --image ghcr.io/mathieu-benoit/backstage:latest +``` + +The `generate` command will add the input `score.yaml` workload with a particular container image to the `.score-compose/state.yaml` state file and generate the output `compose.yaml`. + +If you want to build the container image when this `compose.yaml` will be deployed, you can run this `generate` command with the `--build` parameter instead: + +```bash +score-compose generate score.yaml --build 'main={"context":".","tags":["backstage:local"]}' +``` + +See the generated `compose.yaml` by running this command: + +```bash +cat compose.yaml +``` + +If you make any modifications to the `score.yaml` file, run `score-compose generate score.yaml` to regenerate the output `compose.yaml`. + +### `resources` + +Get the information of the resources dependencies of the workload, run the following command: + +```bash +score-compose resources list +``` + +```none ++----------------------------------------+--------------------------------+ +| UID | OUTPUTS | ++----------------------------------------+--------------------------------+ +| dns.default#backstage.dns | host, url | ++----------------------------------------+--------------------------------+ +| postgres-instance.default#backstage.pg | host, password, port, username | ++----------------------------------------+--------------------------------+ +| route.default#backstage.route | | ++----------------------------------------+--------------------------------+ +``` + +At this stage, we can already see the value of the `dns` resource generated: + +```bash +score-compose resources get-outputs dns.default#backstage.dns +``` + +```none +{ + "host": "dnsjdtv57.localhost", + "url": "http://dnsjdtv57.localhost:8080" +} +``` + +Same for the `postgres-instance` resource: + +```bash +score-compose resources get-outputs postgres-instance.default#backstage.pg +``` + +```none +{ + "host": "pg-OuoTNo", + "password": "REDACTED", + "port": 5432, + "username": "REDACTED" +} +``` + +### `docker compose` + +Run `docker compose up` to execute the generated `compose.yaml` file: + +```bash +docker compose up -d +``` + +```none +[+] Running 4/4 + ✔ Container deploy-backstage-with-score-pg-OuoTNo-1 Healthy + ✔ Container deploy-backstage-with-score-wait-for-resources-1 Exited + ✔ Container deploy-backstage-with-score-routing-6uaxax-1 Started + ✔ Container deploy-backstage-with-score-backstage-backstage-1 Started +``` + +### `docker ps` + +See the running containers: + +```bash +docker ps +``` + +```none +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +9b2ff62333ff ghcr.io/mathieu-benoit/backstage:latest "node packages/backe…" 5 hours ago Up 5 hours deploy-backstage-with-score-backstage-backstage-1 +4b1203acbf41 mirror.gcr.io/postgres:17-alpine "docker-entrypoint.s…" 5 hours ago Up 5 hours (healthy) 5432/tcp deploy-backstage-with-score-pg-mwgmNx-1 +716b626ad841 mirror.gcr.io/nginx:1-alpine "/docker-entrypoint.…" 5 hours ago Up 5 hours 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp deploy-backstage-with-score-routing-idouo7-1 +``` + +### `curl localhost:8080` + +Test the running container, run the following command: + +```bash +curl localhost:8080 -H "Host: dnsjdtv57.localhost" +``` + +```none +... +Scaffolded Backstage App +... +``` + +Congrats! You’ve successfully deploy, with the `score-compose` implementation, a sample containerized Backstage workload talking to PostgreSQL and exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. + +## 3. `score-k8s` + +To begin, follow the [installation instructions](/docs/score-implementation/score-k8s/installation) to install the latest version of `score-k8s`. + +### `init` + +Initialize your current `score-k8s` workspace, run the following command in your terminal: + +```bash +score-k8s init --no-sample \ + --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/dns/score-k8s/10-dns-with-url.provisioners.yaml +``` + +The `init` command will create the `.score-k8s` directory with the [default resource provisioners]({{< relref "/docs/score-implementation/score-k8s/resources-provisioners/" >}}) available. We are also importing one external file to support the `dns` dependencies: [`dns` provisioner](https://github.com/score-spec/community-provisioners/blob/main/service/score-k8s/10-dns-with-url.provisioners.yaml). + +You can see the resource provisioners available by running this command: + +```bash +score-k8s provisioners list +``` + +The Score file example illustrated uses three resource types: `postgres-instance`, `dns` and `route`. + +```none ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| TYPE | CLASS | PARAMS | OUTPUTS | DESCRIPTION | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| dns | (any) | | host, url | Outputs a *.localhost domain as | +| | | | | the hostname and associated URL | +| | | | | in http on port 80 | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| postgres-instance | (any) | | host, password, port, username | Provisions a dedicated | +| | | | | PostgreSQL instance | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +| route | (any) | host, path, port | | Provisions an Ingress route on | +| | | | | a shared Nginx instance | ++-------------------+-------+------------------+--------------------------------+---------------------------------+ +``` + +### `generate` + +Convert the `score.yaml` file into a runnable `manifests.yaml`, run the following command in your terminal: + +```bash +score-k8s generate score.yaml --image ghcr.io/mathieu-benoit/backstage:latest +``` + +The `generate` command will add the input `score.yaml` workload with a particular container image to the `.score-k8s/state.yaml` state file and generate the output `manifests.yaml`. + +See the generated `manifests.yaml` by running this command: + +```bash +cat manifests.yaml +``` + +If you make any modifications to the `score.yaml` file, run `score-k8s generate score.yaml` to regenerate the output `manifests.yaml`. + +### `resources` + +Get the information of the resources dependencies of the workload, run the following command: + +```bash +score-k8s resources list +``` + +```none ++----------------------------------------+--------------------------------+ +| UID | OUTPUTS | ++----------------------------------------+--------------------------------+ +| dns.default#backstage.dns | host, url | ++----------------------------------------+--------------------------------+ +| postgres-instance.default#backstage.pg | host, password, port, username | ++----------------------------------------+--------------------------------+ +| route.default#backstage.route | | ++----------------------------------------+--------------------------------+ +``` + +At this stage, we can already see the value of the `dns` resource generated: + +```bash +score-k8s resources get-outputs dns.default#backstage.dns +``` + +```none +{ + "host": "dnsnocrke.localhost", + "url": "http://dnsnocrke.localhost:80" +} +``` + +Same for the `postgres-instance` resource: + +```bash +score-k8s resources get-outputs postgres-instance.default#backstage.pg +``` + +```none +{ + "host": "pg-backstage-d7058793", + "password": "REDACTED", + "port": 5432, + "username": "REDACTED" +} +``` + +### `kubectl apply` + +_Here you will need to have access to a Kubernetes cluster to execute the following commands. You can follow [these instructions](/docs/how-to/score-k8s/kind-cluster/) if you want to set up a Kind cluster._ + +Run `kubectl apply` to execute the generated `manifests.yaml` file: + +```bash +kubectl apply -f manifests.yaml +``` + +```none +secret/pg-backstage-d7058793 created +statefulset.apps/pg-backstage-d7058793 created +service/pg-backstage-d7058793 created +httproute.gateway.networking.k8s.io/route-backstage-76d19d47 created +service/backstage created +deployment.apps/backstage created +``` + +### `kubectl get all` + +See the running containers: + +```bash +kubectl get all,httproute +``` + +```none +NAME READY STATUS RESTARTS AGE +pod/backstage-7667f68bf9-vnlw9 1/1 Running 0 37s +pod/pg-backstage-d7058793-0 1/1 Running 0 37s + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/backstage ClusterIP 10.96.146.148 7007/TCP 37s +service/pg-backstage-d7058793 ClusterIP 10.96.21.104 5432/TCP 37s + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/backstage 1/1 1 1 37s + +NAME DESIRED CURRENT READY AGE +replicaset.apps/backstage-7667f68bf9 1 1 1 37s + +NAME READY AGE +statefulset.apps/pg-backstage-d7058793 1/1 37s + +NAME HOSTNAMES AGE +httproute.gateway.networking.k8s.io/route-backstage-76d19d47 ["dnsnocrke.localhost"] 37s +``` + +### `curl localhost` + +Test the running container, run the following command: + +```bash +curl localhost -H "Host: dnsnocrke.localhost" +``` + +```none +... +Scaffolded Backstage App +... +``` + +Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a sample containerized Backstage workload talking to PostgreSQL and exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. + +## Next steps + +- [**Deep dive with the associated step-by-step guide**](https://medium.com/@mabenoit/deploy-backstage-with-score-45bb2d7c2d90): Go through the associated step-by-step guide to understand the different concepts with both: Backstage and Score. +- [**Explore more examples**](/docs/examples/): Check out more examples to dive into further use cases and experiment with different configurations. +- [**Join the Score community**]({{< relref "/docs/community" >}}): Connect with fellow Score developers on our CNCF Slack channel or start find your way to contribute to Score. diff --git a/content/en/docs/examples/dapr.md b/content/en/docs/examples/dapr.md index 034e5ca3..cc0da1d9 100644 --- a/content/en/docs/examples/dapr.md +++ b/content/en/docs/examples/dapr.md @@ -1,13 +1,13 @@ --- title: "Dapr" linkTitle: "Dapr" -description: "How to deploy a NodeJS containerized application using a Dapr StateStore (Redis) with `score-compose` and `score-k8s`" +description: "How to deploy a containerized NodeJS application using a Dapr StateStore (Redis) with `score-compose` and `score-k8s`" weight: 4 --- ## Overview -In this example we will walk you through how you can deploy a NodeJS containerized application using a Dapr StateStore (Redis), and this with both `score-compose` and `score-k8s`. +In this example we will walk you through how you can deploy a containerized NodeJS application using a Dapr StateStore (Redis), and this with both `score-compose` and `score-k8s`. ```mermaid flowchart TD @@ -55,7 +55,7 @@ resources: port: 3000 ``` -From here, you can deploy this exact same Score file: +From here, we will now see how you can deploy this exact same Score file: - Either with [`score-compose`](#2-score-compose) - Or with [`score-k8s`](#3-score-k8s) @@ -225,7 +225,7 @@ You can check the logs of the running container: Node App listening on port 3000! ``` -Congrats! You’ve successfully deploy, with the `score-compose` implementation, a sample NodeJS containerized workload talking to a Dapr StateStore (Redis) and exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. +Congrats! You’ve successfully deploy, with the `score-compose` implementation, a sample containerized NodeJS workload talking to a Dapr StateStore (Redis) and exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. ## 3. `score-k8s` @@ -394,7 +394,7 @@ You can check the logs of the running container: Node App listening on port 3000! ``` -Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a sample NodeJS containerized workload talking to a Dapr StateStore (Redis) and exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. +Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a sample containerized NodeJS workload talking to a Dapr StateStore (Redis) and exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. ## Next steps diff --git a/content/en/docs/examples/microservices.md b/content/en/docs/examples/microservices.md index f95e4db2..8d8a0704 100644 --- a/content/en/docs/examples/microservices.md +++ b/content/en/docs/examples/microservices.md @@ -112,7 +112,7 @@ resources: type: service ``` -the following `score-cart.yaml` file, which describes the `cart` containerized application exposed via a DNS that queries different other applications on each request: +The following `score-cart.yaml` file, which describes the `cart` containerized application exposed via a DNS that queries different other applications on each request: ```yaml apiVersion: score.dev/v1b1 @@ -142,7 +142,7 @@ resources: Just two Score files have been illustrated above, you can grab the other Score files from [this GitHub repository](https://github.com/Humanitec-DemoOrg/onlineboutique-demo/tree/main/apps). -From here, you can deploy these Score files: +From here, we will now see how you can deploy these Score files: - Either with [`score-compose`](#2-score-compose) - Or with [`score-k8s`](#3-score-k8s) diff --git a/content/en/docs/examples/nginx.md b/content/en/docs/examples/nginx.md index d0a944f6..f6327c02 100644 --- a/content/en/docs/examples/nginx.md +++ b/content/en/docs/examples/nginx.md @@ -1,13 +1,13 @@ --- title: "Nginx" linkTitle: "Nginx" -description: "How to deploy an unprivileged Nginx containerized application with `score-compose` and `score-k8s`" +description: "How to deploy an unprivileged containerized Nginx application with `score-compose` and `score-k8s`" weight: 2 --- ## Overview -In this example we will walk you through how you can deploy an unprivileged Nginx containerized application, and this with both `score-compose` and `score-k8s`. +In this example we will walk you through how you can deploy an unprivileged containerized Nginx application, and this with both `score-compose` and `score-k8s`. ```mermaid flowchart TD @@ -78,7 +78,7 @@ resources: We will use this last Score file for the rest of this page. -From here, you can deploy this exact same Score file: +From here, we will now see how you can deploy this exact same Score file: - Either with [`score-compose`](#2-score-compose) - Or with [`score-k8s`](#3-score-k8s) @@ -221,7 +221,7 @@ curl localhost:8080 -H "Host: dnspb7p6y.localhost" Welcome to nginx! ``` -Congrats! You’ve successfully deploy, with the `score-compose` implementation, a simple Nginx containerized workload exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. +Congrats! You’ve successfully deploy, with the `score-compose` implementation, a simple containerized Nginx workload exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. ## 3. `score-k8s` @@ -362,7 +362,7 @@ curl localhost -H "Host: dnsev272w.localhost" Welcome to nginx! ``` -Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a simple Nginx containerized workload exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. +Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a simple containerized Nginx workload exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. ## Next steps diff --git a/content/en/docs/examples/nodejs-postgres.md b/content/en/docs/examples/nodejs-postgres.md index 4fa56079..4fe26fe1 100644 --- a/content/en/docs/examples/nodejs-postgres.md +++ b/content/en/docs/examples/nodejs-postgres.md @@ -1,13 +1,13 @@ --- title: "NodeJS and PostgreSQL" linkTitle: "NodeJS and PostgreSQL" -description: "How to deploy a NodeJS containerized application using a PostgreSQL database with `score-compose` and `score-k8s`" +description: "How to deploy a containerized NodeJS application using a PostgreSQL database with `score-compose` and `score-k8s`" weight: 3 --- ## Overview -In this example we will walk you through how you can deploy a NodeJS containerized application using a PostgreSQL database, and this with both `score-compose` and `score-k8s`. +In this example we will walk you through how you can deploy a containerized NodeJS application using a PostgreSQL database, and this with both `score-compose` and `score-k8s`. ```mermaid flowchart TD @@ -55,7 +55,7 @@ resources: port: 8080 ``` -From here, you can deploy this exact same Score file: +From here, we will now see how you can deploy this exact same Score file: - Either with [`score-compose`](#2-score-compose) - Or with [`score-k8s`](#3-score-k8s) @@ -218,7 +218,7 @@ This is an application talking to a PostgreSQL 17.5 database on host pg-Tut8g7, PostgreSQL 17.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit ``` -Congrats! You’ve successfully deploy, with the `score-compose` implementation, a sample NodeJS containerized workload talking to PostgreSQL and exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. +Congrats! You’ve successfully deploy, with the `score-compose` implementation, a sample containerized NodeJS workload talking to PostgreSQL and exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself. ## 3. `score-k8s` @@ -384,7 +384,7 @@ This is an application talking to a PostgreSQL 17.5 database on host pg-Tut8g7, PostgreSQL 17.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit ``` -Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a sample NodeJS containerized workload talking to PostgreSQL and exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. +Congrats! You’ve successfully deploy, with the `score-k8s` implementation, a sample containerized NodeJS workload talking to PostgreSQL and exposed via a DNS. You provisioned them through `kubectl`, without writing the Kubernetes manifests file by yourself. ## Next steps diff --git a/content/en/docs/get started/_index.md b/content/en/docs/get started/_index.md index ecffee46..b46a2c62 100644 --- a/content/en/docs/get started/_index.md +++ b/content/en/docs/get started/_index.md @@ -11,7 +11,7 @@ aliases: ## Overview -If you're new to Score, we recommend starting with the [`score-compose`](/docs/score-implementation/score-compose) reference implementation. It provides an helpful blueprint for using Score and allows you to become familiar with the [Score specification](/docs/score-specification/score-spec-reference) before exploring further implementation options. +If you're new to Score, we recommend starting with the [`score-compose`](/docs/score-implementation/score-compose) reference implementation. It provides an helpful blueprint for using Score and allows you to become familiar with the [Score specification](/docs/score-specification/score-spec-reference) before exploring further implementation options. `score-compose` is also great for local development and for building meaningful test steps into CI/CD pipelines. ## 1. `score-compose` diff --git a/content/en/docs/score implementation/score-compose/resources-provisioners.md b/content/en/docs/score implementation/score-compose/resources-provisioners.md index 8332f864..9d96d1e2 100644 --- a/content/en/docs/score implementation/score-compose/resources-provisioners.md +++ b/content/en/docs/score implementation/score-compose/resources-provisioners.md @@ -11,24 +11,36 @@ aliases: `score-compose` comes with out-of-the-box support of the following provisioners, that you can list with this command `score-compose provisioners list`: -| Type | Class | Params | Output | Description | -| --------------- | ----- | ---------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `amqp` | (any) | (none) | `host`, `password`, `port`, `username`, `vhost` | Provisions a dedicated RabbitMQ vhost on a shared instance. | -| `dns` | (any) | (none) | `host` | Outputs a *.localhost domain as the hostname. | -| `elasticsearch` | (any) | (none) | `host`, `password`, `port`, `username` | Provisions a dedicated Elastic Search instance. | -| `kafka-topic` | (any) | (none) | `host`, `name`, `num_partitions`, `port` | Provisions a dedicated Kafka topic on a shared Kafka broker. | -| `mongodb` | (any) | (none) | `connection`, `host`, `password`, `port`, `username` | Provisions a dedicated MongoDB database. | -| `mssql` | (any) | (none) | `connection`, `database`, `password`, `port`, `server`, `username` | Provisions a dedicated database on a shared MS SQL server instance. | -| `mysql` | (any) | (none) | `database`, `host`, `name`, `password`, `port`, `username` | Provisions a dedicated MySQL database on a shared instance. | -| `postgres` | (any) | (none) | `database`, `host`, `name`, `password`, `port`, `username` | Provisions a dedicated database on a shared PostgreSQL instance. | -| `redis` | (any) | (none) | `host`, `password`, `port`, `username` | Provisions a dedicated Redis instance. | -| `route` | (any) | `host`, `path`, `port` | | Provisions a ingress route on a shared Nginx instance. | -| `s3` | (any) | (none) | `access_key_id`, `aws_access_key_id`, `aws_secret_key`, `bucket`, `endpoint`, `region`, `secret_key` | Provisions a dedicated S3 bucket with AWS-style credentials on a shared MinIO instance. | -| `service-port` | (any) | `port`, `workload` | `hostname`, `port` | Outputs a hostname and port for connecting to another workload. | -| `volume` | (any) | (none) | `source`, `type` | Creates a persistent volume that can be mounted on a workload. | +| Type | Class | Params | Output | Description | +| ------------------- | ----- | ---------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `amqp` | (any) | (none) | `host`, `password`, `port`, `username`, `vhost` | Provisions a dedicated RabbitMQ vhost on a shared instance. | +| `dns` | (any) | (none) | `host` | Outputs a *.localhost domain as the hostname. | +| `elasticsearch` | (any) | (none) | `host`, `password`, `port`, `username` | Provisions a dedicated Elastic Search instance. | +| `kafka-topic` | (any) | (none) | `host`, `name`, `num_partitions`, `port` | Provisions a dedicated Kafka topic on a shared Kafka broker. | +| `mongodb` | (any) | (none) | `connection`, `host`, `password`, `port`, `username` | Provisions a dedicated MongoDB database. | +| `mssql` | (any) | (none) | `connection`, `database`, `password`, `port`, `server`, `username` | Provisions a dedicated database on a shared MS SQL server instance. | +| `mysql` | (any) | (none) | `database`, `host`, `name`, `password`, `port`, `username` | Provisions a dedicated MySQL database on a shared instance. | +| `postgres` | (any) | (none) | `database`, `host`, `name`, `password`, `port`, `username` | Provisions a dedicated database on a shared PostgreSQL instance. | +| `postgres-instance` | (any) | (none) | `host`, `password`, `port`, `username` | Provisions a dedicated PostgreSQL instance. | +| `redis` | (any) | (none) | `host`, `password`, `port`, `username` | Provisions a dedicated Redis instance. | +| `route` | (any) | `host`, `path`, `port` | (none) | Provisions a ingress route on a shared Nginx instance. | +| `s3` | (any) | (none) | `access_key_id`, `aws_access_key_id`, `aws_secret_key`, `bucket`, `endpoint`, `region`, `secret_key` | Provisions a dedicated S3 bucket with AWS-style credentials on a shared MinIO instance. | +| `service-port` | (any) | `port`, `workload` | `hostname`, `port` | Outputs a hostname and port for connecting to another workload. | +| `volume` | (any) | (none) | `source`, `type` | Creates a persistent volume that can be mounted on a workload. | The source code of these provisioners implementations can be found in the [`score-compose`'s default provisioners file](https://github.com/score-spec/score-compose/blob/main/internal/command/default.provisioners.yaml). Users are encouraged to write their own custom provisioners to support new resource types or to modify the default implementations above. Learn how to do that with this example [here](https://score.dev/blog/writing-a-custom-score-compose-provisioner-for-apache-kafka/). -A list of provisioners shared by the community can also be found [here](https://github.com/score-spec/community-provisioners). Users are encouraged to use them and contribute to this growing list of provisioners. +A list of provisioners authored and shared by the community can also be found [here](https://github.com/score-spec/community-provisioners). Users are encouraged to use them and contribute to this growing list of community provisioners: + +| Type | Class | Params | Outputs | Description | +| --------------------------- | ----- | ----------------- | --------------- | ----------------------------------------------------------------------------------------- | +| `dapr-pubsub` | (any) | (none) | `name` | Generates a Dapr PubSub `Component` pointing to a Redis `Service`. | +| `dapr-state-store` | (any) | (none) | `name` | Generates a Dapr StateStore `Component` pointing to a Redis `Service`. | +| `dapr-subscription` | (any) | `pubsub`, `topic` | `name`, `topic` | Generates a Dapr `Subscription` on a given Topic and `PubSub`. | +| `dns` | (any) | (none) | `host`, `url` | Get the forwarded port URL in current GitHub Codespace on port `8080`. | +| `dns` | (any) | (none) | `host`, `url` | Outputs a `*.localhost` domain as the hostname and associated URL in http on port `8080`. | +| `environment` | (any) | (none) | (none) | Loads environment variables from a local `.env` file. | +| `horizontal-pod-autoscaler` | (any) | (none) | (none) | Generates an empty object because HPA is not supported in Docker Compose. | +| `service` | (any) | (none) | `name` | Outputs the name of the Workload dependency if it exists in the list of Workloads. | diff --git a/content/en/docs/score implementation/score-k8s/resources-provisioners.md b/content/en/docs/score implementation/score-k8s/resources-provisioners.md index 113fef6f..285895b2 100644 --- a/content/en/docs/score implementation/score-k8s/resources-provisioners.md +++ b/content/en/docs/score implementation/score-k8s/resources-provisioners.md @@ -20,7 +20,7 @@ aliases: | `mysql` | (any) | (none) | `database`, `host`, `name`, `password`, `port`, `username` | Provisions a dedicated MySQL database on a shared instance. | | `postgres` | (any) | (none) | `database`, `host`, `name`, `password`, `port`, `username` | Provisions a dedicated database on a shared PostgreSQL instance. | | `redis` | (any) | (none) | `host`, `password`, `port`, `username` | Provisions a dedicated Redis instance. | -| `route` | (any) | `host`, `path`, `port` | | Provisions an HTTPRoute on a shared Nginx instance. | +| `route` | (any) | `host`, `path`, `port` | (none) | Provisions an HTTPRoute on a shared Nginx instance. | | `s3` | (any) | (none) | `access_key_id`, `aws_access_key_id`, `aws_secret_key`, `bucket`, `endpoint`, `region`, `secret_key` | Provisions a dedicated S3 bucket with AWS-style credentials on a shared MinIO instance. | | `service-port` | (any) | `port`, `workload` | `hostname`, `port` | Outputs a hostname and port for connecting to another workload. | | `volume` | (any) | (none) | `source` | Creates a persistent volume that can be mounted on a workload. | @@ -29,4 +29,20 @@ The source code of these provisioners implementations can be found in the [`scor Users are encouraged to write their own custom provisioners to support new resource types or to modify the default implementations above. Learn how to do that with this example [here](https://score.dev/blog/writing-a-custom-score-compose-provisioner-for-apache-kafka/). -A list of provisioners shared by the community can also be found [here](https://github.com/score-spec/community-provisioners). Users are encouraged to use them and contribute to this growing list of provisioners. +A list of provisioners authored and shared by the community can also be found [here](https://github.com/score-spec/community-provisioners). Users are encouraged to use them and contribute to this growing list of community provisioners: + +| Type | Class | Params | Outputs | Description | +| --------------------------- | ----- | --------------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------- | +| `dapr-pubsub` | (any) | (none) | `name` | Generates a Dapr PubSub `Component` pointing to a RabbitMQ `StatefulSet`. | +| `dapr-pubsub` | (any) | (none) | `name` | Generates a Dapr PubSub `Component` pointing to a Redis `StatefulSet`. | +| `dapr-state-store` | (any) | (none) | `name` | Generates a Dapr StateStore `Component` pointing to a Redis `StatefulSet`. | +| `dapr-subscription` | (any) | `pubsub`, `topic` | `name`, `topic` | Generates a Dapr `Subscription` on a given Topic and `PubSub`. | +| `dns` | (any) | (none) | `host`, `url` | Get the forwarded port URL in current GitHub Codespace on port `80`. | +| `dns` | (any) | (none) | `host`, `url` | Outputs a `*.localhost` domain as the hostname and associated URL in http on port `80`. | +| `environment` | (any) | (none) | (none) | Loads environment variables from a local `.env` file. | +| `horizontal-pod-autoscaler` | (any) | `maxReplicas`, `minReplicas`, `defaultTargetCPUUtilizationPercentage` | (none) | Generates an `HorizontalPodAutoscaler` manifest. | +| `redis` | (any) | (none) | `host`, `password`, `port`, `username` | Generates the manifests of the `bitnami/redis` Helm chart. | +| `redis` | (any) | (none) | `host`, `password`, `port`, `username` | Deploys the `bitnami/redis` Helm chart in an existing cluster. | +| `route` | (any) | `host`, `path`, `port` | (none) | Provisions an Ingress route on a shared Nginx instance. | +| `route` | (any) | `host`, `path`, `port` | (none) | Generates an `HTTPRoute` attached to a shared `Gateway`. | +| `service` | (any) | (none) | `name` | Outputs the name of the Workload dependency if it exists in the list of Workloads. |