From 53d199ef631c79faae2f4e49ffe9dcfbef54b52d Mon Sep 17 00:00:00 2001 From: Tobias Babin Date: Mon, 22 Jan 2024 16:21:57 +0100 Subject: [PATCH] Changed extension file example to show route and annotations --- .../en/docs/reference/humanitec-extension.md | 55 +++++++++++++------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/content/en/docs/reference/humanitec-extension.md b/content/en/docs/reference/humanitec-extension.md index f8c5d166..7dbdbe04 100644 --- a/content/en/docs/reference/humanitec-extension.md +++ b/content/en/docs/reference/humanitec-extension.md @@ -44,24 +44,45 @@ resources: ### Extension example -The following example would help score-humanitec add proper routes to the Deployment Delta, so that the service is available to the outside world. +The following example shows a Score file and a corresponding extension file. The Score file declares a `container` and a `service`, while the extension file declares annotations on both elements. + +`score.yaml`: ```yaml -apiVersion: humanitec.org/v1b1 -profile: "humanitec/default-module" -spec: - "labels": - "tags.datadoghq.com/env": "${resources.env.DATADOG_ENV}" - "ingress": - rules: - "${resources.dns}": - http: - "/": - type: prefix - port: 80 +apiVersion: score.dev/v1b1 +metadata: + name: my-workload + +containers: + demo: + image: registry/my-image:1.0.0 +service: + ports: + http: + port: 80 + targetPort: 8080 + resources: - db: - scope: external - dns: - scope: shared + api-dns: + type: dns + users-route: + type: route + params: + host: ${resources.api-dns.host} + path: "/" + port: 80 ``` + +`humanitec.score.yaml`: + +```yaml +apiVersion: humanitec.org/v1b1 +profile: humanitec/default-module + +spec: + annotations: + annotationkey: annotationvalue + service: + annotations: + serviceannotationkey: serviceannotationvalue +``` \ No newline at end of file