Score

Capability

Service

Define how a service for the Workload is configured.

Refer to the service feature for configuration details.

You may optionally set annotations and labels on the Kubernetes Service object through a Score extension file.


humanitec.score.yaml ( view on GitHub ) :

apiVersion: humanitec.org/v1b1

spec:
  service:
    # Set annotations on the Kubernetes Service
    annotations:
      serviceannotationkey: serviceannotationvalue
    # Set labels on the Kubernetes Service
    labels:
      servicelabelkey: servicelabelvalue

score.yaml ( view on GitHub ) :

apiVersion: score.dev/v1b1
metadata:
  name: my-workload

containers:
  demo:
    image: registry/my-image:1.0.0
service:
  ports:
    www:
      port: 8080
      targetPort: 3001
    stream:
      port: 19245
      targetPort: 19245
      protocol: UDP

Top