tm-forum-api

by FIWARE Foundation

Helm chartv0.19.6App 2.2.1

A Helm chart for running the FIWARE TMForum-APIs

About this chart

tm-forum-api

A Helm chart for running the FIWARE TMForum-APIs

Maintainers

NameEmailUrl
wistefan[email protected]

Individual Configuration

The chart deploys all configured APIs, using the same default-configuration for each of them to make the deployment easier. However, it also allows to overwrite every configuration for the individual API as following:

While the default-config might set:

  defaultConfig:
    replicaCount: 1
    image:
      # -- repository to get the container from
      repository: quay.io/wi_stefan
      # -- tag to be used, most of the time the apis will use the same version
      tag: 0.4.1
      # -- pull policy to be used
      pullPolicy: IfNotPresent
    # -- log level of the api
    logLevel: WARN
    # -- cache config for connecting the broker
    cache:
      # -- maximum size of the cache
      maximumSize: 1000
      # -- how fast should the cache entry expire after it was written?
      expireAfterWrite: 2s

Those values can be overwritten on an individual API level as following:

apis:
  # uses the default
  - name: party-catalog
    image: tmforum-party-catalog
    basePath: /tmf-api/party/v4

  # customized
  - name: product-catalog
    image: tmforum-product-catalog
    basePath: /tmf-api/productCatalogManagement/v4
    replicaCount: 3
    image:
      repository: quay.io/my_own_repo
      tag: 1.2.3
      pullPolicy: Always
    logLevel: DEBUG
    cache:
      maximumSize: 3000

For all untouched values, the customized deployement will still use the defaults, while the explicitly set once are overwritten.

UI

tmf-ui is a read-only web browser for the APIs: it lists the entities and follows the references between them as hyperlinks. It only ever issues GET. Enable it with ui.enabled: true:

  • With allInOne.enabled: true it runs as a sidecar of the all-in-one and reads from it on localhost.
  • Otherwise it runs as a deployment of its own and reads through the apiProxy, which has to be enabled: the UI needs every API under a single origin. (ui.endpoint points it anywhere else.)

Either way it is reachable through the <fullname>-ui service:

kubectl port-forward svc/<fullname>-ui 8080:8080
# http://localhost:8080/

It has no authentication of its own: whoever reaches the service reads the APIs. Do not expose it publicly. The tmforum-ui image is only published by tmforum-api releases newer than 1.18.6; until appVersion points at one, set ui.image.tag.

In split mode the UI only finds the APIs at the base paths of the all-in-one: the default party-role base path (/tmf-api/partyRoleManagement/v4) differs from it (/tmf-api/partyRole/v4), and document-management is not deployed, so both show up as unreachable.

Source Code

Values

KeyTypeDefaultDescription
allInOne.enabledboolfalse
allInOne.image.pullPolicystring"IfNotPresent"pull policy to be used
allInOne.image.repositorystring"quay.io/fiware/tmforum-all-in-one"repository to get the container from
allInOne.image.tagstring""overrides the image tag whose default is the chart appVersion
apiProxy.additionalAnnotationsobject{}additional annotations for the deployment, if required
apiProxy.additionalLabelsobject{}
apiProxy.affinityobject{}affinity template ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
apiProxy.enabledboolfalseshould the proxy be deployed?
apiProxy.imageobject{"pullPolicy":"IfNotPresent","repository":"envoyproxy/envoy","tag":"v1.27-latest"}configuration to be used for the image of the proxy
apiProxy.image.pullPolicystring"IfNotPresent"pull policy to be used
apiProxy.image.repositorystring"envoyproxy/envoy"repository to get the proxy from
apiProxy.image.tagstring"v1.27-latest"tag to be used
apiProxy.nodeSelectorobject{}selector template ref: https://kubernetes.io/docs/user-guide/node-selection/
apiProxy.replicaCountint1initial number of target replications, can be different if autoscaling is enabled
apiProxy.revisionHistoryLimitint3number of old replicas to be retained
apiProxy.serviceobject{"annotations":{},"nameOverride":null,"port":8080,"type":"ClusterIP"}configuration for the proxy service
apiProxy.service.annotationsobject{}addtional annotations, if required
apiProxy.service.nameOverridestringnilname to be used for the proxy service.
apiProxy.service.portint8080port to be used by the service
apiProxy.service.typestring"ClusterIP"service type
apiProxy.sidecarslist[]additional sidecars for the deployment, if required
apiProxy.tolerationslist[]tolerations template ref: ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
apiProxy.updateStrategy.rollingUpdateobject{"maxSurge":1,"maxUnavailable":0}new pods will be added gradually
apiProxy.updateStrategy.rollingUpdate.maxSurgeint1number of pods that can be created above the desired amount while updating
apiProxy.updateStrategy.rollingUpdate.maxUnavailableint0number of pods that can be unavailable while updating
apiProxy.updateStrategy.typestring"RollingUpdate"type of the update
apislist[{"basePath":"/tmf-api/party/v4","image":"tmforum-party-catalog","name":"party-catalog"},{"basePath":"/tmf-api/customerBillManagement/v4","image":"tmforum-customer-bill-management","name":"customer-bill-management"},{"basePath":"/tmf-api/customerManagement/v4","image":"tmforum-customer-management","name":"customer-management"},{"basePath":"/tmf-api/productCatalogManagement/v4","image":"tmforum-product-catalog","name":"product-catalog"},{"basePath":"/tmf-api/productInventory/v4","image":"tmforum-product-inventory","name":"product-inventory"},{"basePath":"/tmf-api/productOrderingManagement/v4","image":"tmforum-product-ordering-management","name":"product-ordering-management"},{"basePath":"/tmf-api/resourceCatalog/v4","image":"tmforum-resource-catalog","name":"resource-catalog"},{"basePath":"/tmf-api/resourceFunctionActivation/v4","image":"tmforum-resource-function-activation","name":"resource-function-activation"},{"basePath":"/tmf-api/resourceInventoryManagement/v4","image":"tmforum-resource-inventory","name":"resource-inventory"},{"basePath":"/tmf-api/serviceCatalogManagement/v4","image":"tmforum-service-catalog","name":"service-catalog"},{"basePath":"/tmf-api/serviceInventory/v4","image":"tmforum-service-inventory","name":"service-inventory"},{"basePath":"/tmf-api/accountManagement/v4","image":"tmforum-account","name":"account-management"},{"basePath":"/tmf-api/agreementManagement/v4","image":"tmforum-agreement","name":"agreement-management"},{"basePath":"/tmf-api/partyRoleManagement/v4","image":"tmforum-party-role","name":"party-role"},{"basePath":"/tmf-api/usageManagement/v4","image":"tmforum-usage-management","name":"usage-management"},{"basePath":"/tmf-api/quote/v4","image":"tmforum-quote","name":"quote"},{"basePath":"/tmf-api/resourceOrderingManagement/v4","image":"tmforum-resource-order-management","name":"resource-order-management"},{"basePath":"/tmf-api/serviceOrdering/v4","image":"tmforum-service-order-management","name":"service-ordering-management"},{"basePath":"/tmf-api/softwareCompute/v4","image":"tmforum-software-management","name":"software-management"}]be aware: when you change the image repositrory or the tag for an api, you have to provide both values for the changes to take effect
autoscaling.enabledboolfalseshould autoscaling be enabled for the context broker
autoscaling.maxReplicasint10maximum number of running pods
autoscaling.metricslist[]metrics to react on
autoscaling.minReplicasint1minimum number of running pods
defaultConfig.additionalAnnotationsobject{}additional annotations for the deployment, if required
defaultConfig.additionalEnvVarslist[{"name":"API_EXTENSION_ENABLED","value":"true"}]a list of additional env vars to be set, check the tm-forum api docu for all available options
defaultConfig.additionalLabelsobject{}additional labels for the deployment, if required
defaultConfig.affinityobject{}affinity template ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
defaultConfig.cacheobject{"entities":{"expireAfterAccess":"2s","expireAfterWrite":"2s","maximumSize":1000},"subscriptions":{"expireAfterAccess":"14d","expireAfterWrite":"14d","maximumSize":1000}}cache config for connecting the broker
defaultConfig.cache.entitiesobject{"expireAfterAccess":"2s","expireAfterWrite":"2s","maximumSize":1000}entities cache
defaultConfig.cache.entities.expireAfterAccessstring"2s"how fast should the cache entry expire after it was last accessed?
defaultConfig.cache.entities.expireAfterWritestring"2s"how fast should the cache entry expire after it was written?
defaultConfig.cache.entities.maximumSizeint1000maximum size of the cache
defaultConfig.cache.subscriptionsobject{"expireAfterAccess":"14d","expireAfterWrite":"14d","maximumSize":1000}subscriptions cache
defaultConfig.cache.subscriptions.expireAfterAccessstring"14d"how fast should the cache entry expire after it was last accessed?
defaultConfig.cache.subscriptions.expireAfterWritestring"14d"how fast should the cache entry expire after it was written?
defaultConfig.cache.subscriptions.maximumSizeint1000maximum size of the cache
defaultConfig.contextUrlstring"https://smartdatamodels.org/context.jsonld"default context to be used when contacting the context broker
defaultConfig.countHeaderstringnilName of the response header the target NGSI-LD broker uses to report the total number of entities matching a query. Default NGSILD-Results-Count
defaultConfig.endpointsPortint9090metrics and health port
defaultConfig.imageobject{"pullPolicy":"IfNotPresent","repository":"quay.io/fiware","tag":""}configuration to be used for the image of the container
defaultConfig.image.pullPolicystring"IfNotPresent"pull policy to be used
defaultConfig.image.repositorystring"quay.io/fiware"repository to get the container from
defaultConfig.image.tagstring""overrides the image tag whose default is the chart appVersion
defaultConfig.livenessProbe.failureThresholdint3
defaultConfig.livenessProbe.healthPathstring"/health/liveness"path to be used for the health check
defaultConfig.livenessProbe.initialDelaySecondsint30
defaultConfig.livenessProbe.periodSecondsint10
defaultConfig.livenessProbe.successThresholdint1
defaultConfig.livenessProbe.timeoutSecondsint30
defaultConfig.logLevelstring"INFO"log level of the api
defaultConfig.ngsiLdobject{"path":"ngsi-ld/v1","readTimeout":"30s","url":"http://context-broker:1026"}ngsi-ld broker connection information
defaultConfig.ngsiLd.pathstring"ngsi-ld/v1"base path for the ngsi-ld api
defaultConfig.ngsiLd.readTimeoutstring"30s"timeout for requests ot the broker
defaultConfig.ngsiLd.urlstring"http://context-broker:1026"address of the broker
defaultConfig.nodeSelectorobject{}selector template ref: https://kubernetes.io/docs/user-guide/node-selection/
defaultConfig.portint8080port to be used for the app
defaultConfig.priorityClassNamestring""priority class to be assigned to the pods ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
defaultConfig.prometheusobject{"enabled":true,"path":"/prometheus"}configuration for proemtheus metrics
defaultConfig.prometheus.enabledbooltrueshould it be enabled
defaultConfig.prometheus.pathstring"/prometheus"path to get the metrics from
defaultConfig.readinessProbe.failureThresholdint3
defaultConfig.readinessProbe.initialDelaySecondsint30
defaultConfig.readinessProbe.periodSecondsint10
defaultConfig.readinessProbe.readinessPathstring"/health/readiness"path to be used for the health check
defaultConfig.readinessProbe.successThresholdint1
defaultConfig.readinessProbe.timeoutSecondsint30
defaultConfig.replaceOnUpdatestringnilWhen true, updateDomainEntity uses batchEntityUpsert replace (read-merge-write) instead of PATCH /attrs. Required for Scorpio 6.x which appends to array attributes on PATCH. Default false
defaultConfig.replicaCountint1initial number of target replications, can be different if autoscaling is enabled
defaultConfig.resourcesobject{}tmforum resource requests and limits, we leave the default empty to make that a concious choice by the user. for the autoscaling to make sense, you should configure this.
defaultConfig.revisionHistoryLimitint3number of old replicas to be retained
defaultConfig.serverHoststring"http://tm-forum-api-svc:8080"host that the tm-forum api can be reached at
defau

Deploy tm-forum-api with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tm-forum-api on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttm-forum-api is pinned at v0.19.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply