Score

Capability

Multiple Workloads

This example shows how to deploy multiple workloads within one deployment.

Doing so requires a separate Score file per workload (score.example-service.yaml and score.another-service.yaml). The example also uses a Score extension file (score.humanitec.yaml) to apply some common settings to both workloads.

The file deploy-config.yaml wraps all those files into a deploy configuration which can be passed in to humctl using the --deploy-config flag. See the CLI documentation for details.


deploy-config.yaml ( view on GitHub ) :

apiVersion: config.humanitec.io/v1b1
kind: ScoreDeployConfig
workloads:
  - name: example-service
    specFile: ./score.example-service.yaml
    extensionsFile: ./score.humanitec.yaml
  - name: another-service
    specFile: ./score.another-service.yaml
    extensionsFile: ./score.humanitec.yaml


score.another-service.yaml ( view on GitHub ) :

apiVersion: score.dev/v1b1
metadata:
  name: another-service

containers:
  demo:
    image: registry/my-image:1.0.0
    command: ["/bin/sh"]
    args: ["-c", "while true; do printenv && sleep 60; done"]


score.example-service.yaml ( view on GitHub ) :

apiVersion: score.dev/v1b1
metadata:
  name: example-service

containers:
  demo:
    image: registry/my-image:1.0.0
    command: ["/bin/sh"]
    args: ["-c", "while true; do printenv && sleep 60; done"]


score.humanitec.yaml ( view on GitHub ) :

apiVersion: humanitec.org/v1b1
spec:
  containers:
    demo:
      resources:
        limits:
          cpu: "500m"
          memory: "256Mi"

Top