diff --git a/.github/workflows/linkchecker.yaml b/.github/workflows/linkchecker.yaml index 4ecce21..4c057e2 100644 --- a/.github/workflows/linkchecker.yaml +++ b/.github/workflows/linkchecker.yaml @@ -1,5 +1,5 @@ --- -name: "Code Quality: Link Checker" +name: "CI" on: pull_request: @@ -18,3 +18,6 @@ jobs: fail: true env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Check Schema + run: make test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2fffd8c --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +# Disable all the default make stuff +MAKEFLAGS += --no-builtin-rules +.SUFFIXES: + +SCORE_EXAMPLES_DIR ?= ./samples + +## Display help menu +.PHONY: help +help: + @echo Documented Make targets: + @perl -e 'undef $$/; while (<>) { while ($$_ =~ /## (.*?)(?:\n# .*)*\n.PHONY:\s+(\S+).*/mg) { printf "\033[36m%-30s\033[0m %s\n", $$2, $$1 } }' $(MAKEFILE_LIST) | sort + +# ------------------------------------------------------------------------------ +# NON-PHONY TARGETS +# ------------------------------------------------------------------------------ + +${GOPATH}/bin/jv: +ifeq ($(GOPATH),) + $(error GOPATH must be set) +endif + go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest + +# ------------------------------------------------------------------------------ +# PHONY TARGETS +# ------------------------------------------------------------------------------ + +.PHONY: .ALWAYS +.ALWAYS: + +## Test that the score schema matches the json-schema reference +.PHONY: test-schema +test-schema: ${GOPATH}/bin/jv + ${GOPATH}/bin/jv -assertformat -assertcontent https://json-schema.org/draft/2020-12/schema ./score-v1b1.json + @echo "Schema is a valid jsonschema" + +## Test that the given score examples in $SCORE_EXAMPLES_DIR match the schema +.PHONY: test-examples +test-examples: ${GOPATH}/bin/jv +ifeq ($(SCORE_EXAMPLES_DIR),) + $(error SCORE_EXAMPLES_DIR must be set) +endif + find ${SCORE_EXAMPLES_DIR} -name 'score*.yaml' -print -exec ${GOPATH}/bin/jv -assertformat -assertcontent ./score-v1b1.json {} \; + @echo "Schema matches all samples" + +## Run all tests +.PHONY: test +test: test-schema test-examples diff --git a/README.md b/README.md index 7d9b124..6463538 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ ![Score banner](/docs/images/banner.png) +[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) + ## ![Score](/docs/images/logo.svg) The Score Specification Score is an open-source workload specification designed to simplify development for cloud-native developers. The specification 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 Compose or Kubernetes. 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”. @@ -56,7 +59,7 @@ Looking at the example above, you'll notice that the Score specification is: * **declarative**: With Score, developers declare what their workload requires to run as part of the Score specification. The platform in the target environment is responsible for resolving individual runtime requirements. This establishes a contract between dev and ops: If the requirements listed in the spec are honoured, the workload will run as intended. -The current version of the specification schema is stored [here](https://github.com/score-spec/schema/blob/main/score-v1b1.json). For a more detailed specification reference, check out our [developer documentation](https://docs.score.dev/docs/score-specification/score-spec-reference/). +The current version of the specification schema is stored [here](https://github.com/score-spec/spec/blob/main/score-v1b1.json). For a more detailed specification reference, check out our [developer documentation](https://docs.score.dev/docs/score-specification/score-spec-reference/). ## ![Score](/docs/images/logo.svg) Implementation of the Score Specification @@ -112,11 +115,3 @@ See [Roadmap](roadmap.md). You can [submit an idea](https://github.com/score-spe ### Contribution Guidelines and Governance Our general contributor guidelines can be found in [CONTRIBUTING.md](CONTRIBUTING.md). Please note that some repositories may have additional guidelines. For more information on our governance model, please refer to [GOVERNANCE.md](GOVERNANCE.md). - -### License - -[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - -### Code of conduct - -[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) diff --git a/docs/images/contributing.svg b/docs/images/contributing.svg deleted file mode 100644 index 10200b4..0000000 --- a/docs/images/contributing.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/docs/images/demo.gif b/docs/images/demo.gif deleted file mode 100644 index 73e6fa8..0000000 Binary files a/docs/images/demo.gif and /dev/null differ diff --git a/docs/images/install.svg b/docs/images/install.svg deleted file mode 100644 index 5d51ace..0000000 --- a/docs/images/install.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/docs/images/run-workload.png b/docs/images/run-workload.png deleted file mode 100644 index 5156387..0000000 Binary files a/docs/images/run-workload.png and /dev/null differ diff --git a/docs/questions/README.md b/docs/questions/README.md deleted file mode 100644 index fc22c07..0000000 --- a/docs/questions/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Questions - -Your questions should go in this directory. - -Question files should be named with the extension ".question.md". diff --git a/docs/questions/are_config_files_generated_by_score_deployment_read.question.md b/docs/questions/are_config_files_generated_by_score_deployment_read.question.md deleted file mode 100644 index d7ea714..0000000 --- a/docs/questions/are_config_files_generated_by_score_deployment_read.question.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Are the configuration files generated by Score deployment-ready?" ---- - -This depends on the complexity of your set-up. The "Hello World" guides for [score-compose](https://github.com/score-spec/score-compose/tree/main/examples) and [score-helm](https://github.com/score-spec/score-helm/tree/main/examples) allows you to directly deploy a workload. In more complex use cases, however, it is likely that the configuration generated by Score is combined with additional configuration provided by a platform or operations team. This allows for a clean separation of concerns between the developer owned workload related configuration and operations owned platform - and infrastructure related configuration. - -To understand what this means in practice, the following needs to be considered: - -Score only describes workload level properties. This means, if you’re deploying to an environment that runs on a system such as Kubernetes, you’ll likely have additional platforms and environment-specific configuration in place. - -For example: You might want to set up `namespace.yaml` and `ingress.yaml` files for the deployments. Score assumes that any configuration outside the workload (and developer) scope is defined and managed externally, for example by an operations team. This allows you to combine the configuration generated by Score with more advanced infrastructure configuration if needed and doesn’t limit teams in leveraging the full potential of their platforms. - -The Score Specification is defined in an environment-agnostic way. This means environment-specific parameters (such as variable values and secrets) need to be injected in the target environment. - -For example: In your development environment, a database connection string such as: `postgres://${postgres.username}:{postgres.password}@${postgres.host}:${postgres.port}/${postgres.name}` might be resolved to `postgresql://admin:password@group_db_host.example.com:1521/db.example.com` while in staging and production you’ll want to have different credentials to be inserted. How, and from where these values are injected, is up to the platform in the target environment. - -Score allows users to define resource dependencies for their service. It does not declare by whom, when and how the resource should be provisioned and allocated in the target environment. It is up to the Score Implementation to resolve the resource by name, type, or any other meta information available. For example: a dependency on a Postgres database could be resolved by a Docker image, a mock service, Terraform, a custom provisioning script or even a manual action - it is totally up to the platform (team). - -If you’d like to learn more about the philosophy behind our way of separating concerns, I recommend reading the article [Why we advocate for workload-centric over infrastructure-centric development](https://score.dev/blog/workload-centric-over-infrastructure-centric-development). diff --git a/docs/questions/how_do_I_install.question.md b/docs/questions/how_do_I_install.question.md deleted file mode 100644 index a027f5e..0000000 --- a/docs/questions/how_do_I_install.question.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "How do I install Score?" ---- - -You can get started by visiting our [docs](https://docs.score.dev/docs/get-started/install/). diff --git a/docs/questions/how_does_score_work.question.md b/docs/questions/how_does_score_work.question.md deleted file mode 100644 index b5a6e7a..0000000 --- a/docs/questions/how_does_score_work.question.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "How does Score work?" ---- - -The Score Specification file is a platform-agnostic workload specification which can be run against a Score Implementation (CLI) such as [score-compose](https://github.com/score-spec/score-compose) or [score-helm](https://github.com/score-spec/score-helm) to generate a platform configuration file such as `docker-compose.yaml` or a helm `values.yaml` file. The generated configuration file can then be combined with environment-specific parameters to run the workload in the target environment. - -![How Score works](/docs/images/run-workload.png). diff --git a/docs/questions/how_is_score_platform_agnostic.question.md b/docs/questions/how_is_score_platform_agnostic.question.md deleted file mode 100644 index 49aae64..0000000 --- a/docs/questions/how_is_score_platform_agnostic.question.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Is Score really platform-agnostic?" -alt_titles: - - "Is Score really platform-agnostic - given that score-compose and score-helm are the only available Implementations?" - - "Why are score-compose and score-helm the only reference Implementations?" ---- - -Yes. [`score-compose`](https://github.com/score-spec/score-compose) and [`score-helm`](https://github.com/score-spec/score-helm) are reference Implementations that were developed by the team to demonstrate how Score could be used. Depending on your use case, you might want to write your own Implementation for - let’s say - `score-ecs` or `score-kustomize`. You can also use one of the existing Implementations and extend it according to your needs. If you’re interested in doing so, don’t hesitate to reach out, we’d be happy to collaborate. diff --git a/docs/questions/how_to_contanct.question.md b/docs/questions/how_to_contanct.question.md deleted file mode 100644 index b777f0a..0000000 --- a/docs/questions/how_to_contanct.question.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "How do I contact you?" -alt_titles: - - "How do I contact the Score Team?" - - "I have an idea, who do I talk to?" ---- - -If you have questions related to Score, its capabilities, use cases, or adoption, you can contact us anytime on the [Score](https://cloud-native.slack.com/archives/C07DN0D1UCW) channel in the CNCF Slack (), [GitHub](https://github.com/score-spec/spec/discussions), or [email](mailto:team@score.dev). diff --git a/docs/questions/what_do_I_need_to_know.question.md b/docs/questions/what_do_I_need_to_know.question.md deleted file mode 100644 index 65a4154..0000000 --- a/docs/questions/what_do_I_need_to_know.question.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "What do I need to know about the Score Specification before getting started?" ---- - -The Score Specification is a file that describes your workload's runtime requirements. It is characterized by being: - -- platform-agnostic: The Score Specification is not tied to a specific platform or tool. As a fully platform-agnostic spec can it be integrated with many container orchestration platforms and tooling such as Kustomize, Amazon ECS, Google Cloud Run, or Nomad for example. -- environment-agnostic: The score.yaml file captures the configuration that stays the same across all environments. This allows combining it with environment-specific parameters in the target environment. For example: Your Score spec might specify a parameterized database connecting string such as `postgres://${postgres.username}:{postgres.password}}@${postgres.host}:${postgres.port}/${postgres.name}` which is resolved in each environment the workload is deployed to by injecting the according credentials. -- tightly scoped: Score describes workload level properties. It does not intend to be a fully featured YAML replacement for any platform. Instead, it draws a line between developer-owned workload related configuration and operations-owned platform related configuration. -- declarative: Developers declare what their workload requires to run as part of `score.yaml`. The platform in the target environment is responsible for resolving individual runtime requirements. This establishes a contract between dev and ops: If the requirements listed in the spec are honored, the workload will run as intended. - -The counterpart of the Score Specification is a Score Implementation, a CLI tool (such as [`score-compose`](https://github.com/score-spec/score-compose)) that the spec can be executed against to generate the required configuration (such as compose.yaml). diff --git a/docs/questions/what_is_score.question.md b/docs/questions/what_is_score.question.md deleted file mode 100644 index 69ec50c..0000000 --- a/docs/questions/what_is_score.question.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "What is Score?" -alt_titles: - - "What is the meaning of Score?" - - "What does Score mean?" ---- - -Score is an open source, platform-agnostic, container-based workload specification. This means you can define your workload once with the Score Specification and then use a Score Implementation CLI to translate it to multiple platforms, such as Helm, Docker Compose or Google Cloud Run. Score aims to reduce developer toil and cognitive load by only having to define a single yaml file that works across multiple platforms. diff --git a/docs/questions/whats_the_difference.question.md b/docs/questions/whats_the_difference.question.md deleted file mode 100644 index e739b2a..0000000 --- a/docs/questions/whats_the_difference.question.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "What's the difference between Score and the Score Implementation?" ---- - -Score is the specification, while the Score Implementation is the CLI tool used to translate a `score.yaml` file into an output of your choice. diff --git a/docs/questions/who_should_adopt_score.question.md b/docs/questions/who_should_adopt_score.question.md deleted file mode 100644 index a6bd179..0000000 --- a/docs/questions/who_should_adopt_score.question.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "Who should adopt Score?" -alt_titles: - - "Is Score right for me?" ---- - -Technically, Score can be utilized by any team running containerized applications. When wanting to understand if Score is the right solution for your team, the main thing to orient towards is whether the pain points we communicate resonate with you: - -- Are you tired of fighting tech and tools when deploying your workloads from local to production? -- Does making a configuration change feel like a tedious and error-prone procedure? -- Are you often blocked and rely on other (ops) engineers to help you out? - -From our experience, this is often the case in medium-sized and larger development teams that work in a continuously growing production landscape. For example, bottlenecks and knowledge silos can arise when teams deal with the adoption of new tech and tools while maintaining legacy systems. diff --git a/docs/questions/why_should_I_use_score.question.md b/docs/questions/why_should_I_use_score.question.md deleted file mode 100644 index c07ec0c..0000000 --- a/docs/questions/why_should_I_use_score.question.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "Why should I use Score?" -alt_titles: - - "What does Score help with?" - - "What are Score's benefits?" ---- - -Score does not intend to be a fully featured YAML replacement for platforms, it only aims to define workloads that can be combined with more advanced YAML configurations that an infrastructure team would provide to developers in an organization. - -Using Score provides the following advantages: - -- The developer only needs to learn the _Score Specification_ to define the workloads that run across various platforms. -- The _Score Specification_ is designed to be applied to multiple environments to reduce the amount of configuration. -- An infrastructure team can help define and configure the resources and multiple platforms where the developer can work on. diff --git a/docs/questions/why_would_I_adpot_score.question.md b/docs/questions/why_would_I_adpot_score.question.md deleted file mode 100644 index a98663f..0000000 --- a/docs/questions/why_would_I_adpot_score.question.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Why would I adopt Score?" ---- - -Score provides a single, easy to understand specification for each workload that describes its runtime requirements in a declarative manner. The `score.yaml` file allows generating configuration in an automated, standardized and one directional way. By reducing the risk of wrongly specified or inconsistent configuration between environments, we hope to foster focus and joy for developers in their day-to-day work. diff --git a/samples/score-full.yaml b/samples/score-full.yaml new file mode 100644 index 0000000..8b51d2b --- /dev/null +++ b/samples/score-full.yaml @@ -0,0 +1,75 @@ +apiVersion: score.dev/v1b1 +metadata: + name: example-workload-name123 + extra-key: extra-value + annotations: + prefix.com/Another-Key_Annotation.2: something else +service: + ports: + port-one: + port: 1000 + protocol: TCP + targetPort: 10000 + port-two2: + port: 8000 +containers: + container-one1: + image: localhost:4000/repo/my-image:tag + command: ["/bin/sh", "-c"] + args: ["hello", "world"] + resources: + requests: + cpu: 1000m + memory: 10Gi + limits: + cpu: "0.24" + memory: 128M + variables: + SOME_VAR: some content here + files: + - target: /my/file + mode: "0600" + source: file.txt + - target: /my/other/file + content: | + some multiline + content + volumes: + - source: volume-name + target: /mnt/something + path: /sub/path + readOnly: false + - source: volume-two + target: /mnt/something-else + livenessProbe: + httpGet: + port: 8080 + path: /livez + readinessProbe: + httpGet: + host: 127.0.0.1 + port: 80 + scheme: HTTP + path: /readyz + httpHeaders: + - name: SOME_HEADER + value: some-value-here + container-two2: + image: . +resources: + resource-one1: + metadata: + annotations: + Default-Annotation: this is my annotation + prefix.com/Another-Key_Annotation.2: something else + extra-key: extra-value + type: Resource-One + class: default + params: + extra: + data: here + resource-two2: + type: Resource-Two + resource-three: + type: Type-Three + id: shared-type-three diff --git a/score-v1b1.json b/score-v1b1.json new file mode 100644 index 0000000..3b609fd --- /dev/null +++ b/score-v1b1.json @@ -0,0 +1,410 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://score.dev/schemas/score", + "title": "Score schema", + "description": "Score workload specification", + "type": "object", + "required": [ + "apiVersion", + "metadata", + "containers" + ], + "additionalProperties": false, + "properties": { + "apiVersion": { + "description": "The declared Score Specification version.", + "type": "string", + "pattern": "^score\\.dev/v1b1$" + }, + "metadata": { + "description": "The metadata description of the Workload.", + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "description": "A string that can describe the Workload. This must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.", + "type": "string", + "minLength": 2, + "maxLength": 63, + "pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" + }, + "annotations": { + "description": "Annotations that apply to the Workload. The annotation can contain A-Z, a-z, 0-9, and '-' and may contain an optional /-separated RFC1123 Host Name prefix.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "propertyNames": { + "minLength": 2, + "maxLength": 316, + "pattern": "^(([a-z0-9][a-z0-9-]{0,61}[a-z0-9])(\\.[a-z0-9][a-z0-9-]{0,61}[a-z0-9])*/)?[A-Za-z0-9][A-Za-z0-9._-]{0,61}[A-Za-z0-9]$" + } + } + } + }, + "service": { + "description": "The service that the workload provides.", + "type": "object", + "additionalProperties": false, + "properties": { + "ports": { + "description": "The set of named network ports published by the service. The service name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.", + "type": "object", + "propertyNames": { + "minLength": 2, + "maxLength": 63, + "pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" + }, + "additionalProperties": { + "$ref": "#/$defs/servicePort" + } + } + } + }, + "containers": { + "description": "The set of named containers in the Workload. The container name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.", + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/$defs/container" + }, + "propertyNames": { + "minLength": 2, + "maxLength": 63, + "pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" + } + }, + "resources": { + "description": "The Resource dependencies needed by the Workload. The resource name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/resource" + }, + "propertyNames": { + "minLength": 2, + "maxLength": 63, + "pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" + } + } + }, + "$defs": { + "servicePort": { + "description": "The network port description.", + "type": "object", + "required": [ + "port" + ], + "additionalProperties": false, + "properties": { + "port": { + "description": "The public service port.", + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "protocol": { + "description": "The transport level protocol. Defaults to TCP.", + "type": "string", + "enum": [ + "TCP", + "UDP" + ] + }, + "targetPort": { + "description": "The internal service port. This will default to 'port' if not provided.", + "type": "integer", + "minimum": 1, + "maximum": 65535 + } + } + }, + "resource": { + "description": "The set of Resources associated with this Workload.", + "type": "object", + "additionalProperties": false, + "required": [ + "type" + ], + "properties": { + "type": { + "description": "The Resource type. This should be a type supported by the Score implementations being used.", + "type": "string", + "minLength": 2, + "maxLength": 63, + "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9]$" + }, + "class": { + "description": "An optional specialisation of the Resource type.", + "type": "string", + "minLength": 2, + "maxLength": 63, + "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9]$" + }, + "id": { + "description": "An optional external Resource identifier. When two resources share the same type, class, and id, they are considered the same resource when used across related Workloads. The id must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.", + "type": "string", + "minLength": 2, + "maxLength": 63, + "pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" + }, + "metadata": { + "description": "The metadata for the Resource.", + "type": "object", + "additionalProperties": true, + "properties": { + "annotations": { + "description": "Annotations that apply to the Resource. The annotation can contain A-Z, a-z, 0-9, and '-' and may contain an optional /-separated RFC1123 Host Name prefix.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "propertyNames": { + "minLength": 2, + "maxLength": 316, + "pattern": "^(([a-z0-9][a-z0-9-]{0,61}[a-z0-9])(\\.[a-z0-9][a-z0-9-]{0,61}[a-z0-9])*/)?[A-Za-z0-9][A-Za-z0-9._-]{0,61}[A-Za-z0-9]$" + } + } + } + }, + "params": { + "description": "Optional parameters used to provision the Resource in the environment.", + "type": "object", + "additionalProperties": true + } + } + }, + "resourcesLimits": { + "description": "The compute and memory resource limits.", + "type": "object", + "additionalProperties": false, + "properties": { + "memory": { + "description": "The memory limit in bytes with optional unit specifier. For example 125M or 1Gi.", + "type": "string", + "pattern": "^[1-9]\\d*(K|M|G|T|Ki|Mi|Gi|Ti)?$" + }, + "cpu": { + "description": "The CPU limit as whole or fractional CPUs. 'm' indicates milli-CPUs. For example 2 or 125m.", + "type": "string", + "pattern": "^\\d*(?:m|\\.\\d+)?$" + } + } + }, + "container": { + "description": "The specification of a Container within the Workload.", + "type": "object", + "required": [ + "image" + ], + "additionalProperties": false, + "properties": { + "image": { + "description": "The container image name and tag.", + "type": "string", + "minLength": 1 + }, + "command": { + "description": "If specified, overrides the entrypoint defined in the container image.", + "type": "array", + "items": { + "type": "string" + } + }, + "args": { + "description": "If specified, overrides the arguments passed to the container entrypoint.", + "type": "array", + "items": { + "type": "string" + } + }, + "variables": { + "description": "The environment variables for the container.", + "type": "object", + "propertyNames": { + "minLength": 1, + "pattern": "^[^=]+$" + }, + "additionalProperties": { + "type": "string" + } + }, + "files": { + "description": "The extra files to mount into the container.", + "type": "array", + "items": { + "type": "object", + "required": [ + "target" + ], + "additionalProperties": false, + "properties": { + "target": { + "description": "The file path to expose in the container.", + "type": "string", + "minLength": 1 + }, + "mode": { + "description": "The optional file access mode in octal encoding. For example 0600.", + "type": "string", + "pattern": "^0?[0-7]{3}$" + }, + "source": { + "description": "The relative or absolute path to the content file.", + "type": "string", + "minLength": 1 + }, + "content": { + "description": "The inline content for the file.", + "type": "string" + }, + "noExpand": { + "description": "If set to true, the placeholders expansion will not occur in the contents of the file.", + "type": "boolean" + } + }, + "oneOf": [ + { + "required": [ + "target", + "content" + ] + }, + { + "required": [ + "target", + "source" + ] + } + ] + } + }, + "volumes": { + "description": "The volumes to mount.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "source", + "target" + ], + "properties": { + "source": { + "description": "The external volume reference.", + "type": "string" + }, + "path": { + "description": "An optional sub path in the volume.", + "type": "string" + }, + "target": { + "description": "The target mount on the container.", + "type": "string" + }, + "readOnly": { + "description": "Indicates if the volume should be mounted in a read-only mode.", + "type": "boolean" + } + } + } + }, + "resources": { + "description": "The compute resources for the container.", + "type": "object", + "additionalProperties": false, + "properties": { + "limits": { + "description": "The maximum allowed resources for the container.", + "$ref": "#/$defs/resourcesLimits" + }, + "requests": { + "description": "The minimal resources required for the container.", + "$ref": "#/$defs/resourcesLimits" + } + } + }, + "livenessProbe": { + "description": "The liveness probe for the container.", + "$ref": "#/$defs/containerProbe" + }, + "readinessProbe": { + "description": "The readiness probe for the container.", + "$ref": "#/$defs/containerProbe" + } + } + }, + "containerProbe": { + "type": "object", + "required": [ + "httpGet" + ], + "additionalProperties": false, + "properties": { + "httpGet": { + "$ref": "#/$defs/httpProbe" + } + } + }, + "httpProbe": { + "description": "An HTTP probe details.", + "type": "object", + "additionalProperties": false, + "required": [ + "port", + "path" + ], + "properties": { + "host": { + "description": "Host name to connect to. Defaults to the workload IP. The is equivalent to a Host HTTP header.", + "type": "string", + "minLength": 1 + }, + "scheme": { + "description": "Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.", + "type": "string", + "enum": [ + "HTTP", + "HTTPS" + ] + }, + "path": { + "description": "The path to access on the HTTP server.", + "type": "string" + }, + "port": { + "description": "The port to access on the workload.", + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "httpHeaders": { + "description": "Additional HTTP headers to send with the request", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "description": "The HTTP header name.", + "type": "string", + "pattern": "^[A-Za-z0-9_-]+$" + }, + "value": { + "description": "The HTTP header value.", + "type": "string", + "minLength": 1 + } + } + } + } + } + } + } +}