Skip to content

Commit

Permalink
Changed extension file example to show route and annotations (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasBabin authored Feb 1, 2024
2 parents 1f2318d + 53d199e commit adbbcd2
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions content/en/docs/reference/humanitec-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit adbbcd2

Please sign in to comment.