📘

Note

While using TrueFoundry python SDK type is not a required field in any of the imported classes

Service

Description

Describes the configuration for the service

Schema

{
  "type": "string",
  "replicas": 1,
  "allow_interception": false,
  "rollout_strategy": {}
}

Properties

NameTypeRequiredDescription
typestringfalse+value=service
replicasanyfalseReplicas of service you want to run
allow_interceptionbooleanfalseWhether to allow intercepts to be applied for this service.
This would inject an additional sidecar in each pod of the service. Not recommended on production
rollout_strategyobjectfalseStrategy to dictate how a rollout should happen when a new release for this service is made

Liveliness/Readiness Probe

The modules below help configuring the Health Probes for the Service. Learn more about Health Probes here.

HttpProbe

Description

Describes the Instructions for assessing container health by executing an HTTP GET request.
To learn more you can go here

Schema

{
  "type": "string",
  "path": "string",
  "port": 65535,
  "host": "string",
  "scheme": "HTTP"
}

Properties

NameTypeRequiredDescription
typestringtrue+sort=1
+value=http
pathstringtrueThe endpoint, relative to the port, to which the HTTP GET request should be directed.
portintegertrueThe TCP socket within the container to which the HTTP GET request should be directed.
hoststringfalseHost name to connect to, defaults to the pod IP
schemestringfalseScheme to use for connecting to the host

HealthProbe

Description

Describes the configuration for the Health Probe's
To learn more you can go here

Schema

{
  "config": {
    "type": "string",
    "path": "string",
    "port": 65535,
    "host": "string",
    "scheme": "HTTP"
  },
  "initial_delay_seconds": 0,
  "period_seconds": 10,
  "timeout_seconds": 1,
  "success_threshold": 1,
  "failure_threshold": 3
}

Properties

NameTypeRequiredDescription
configHttpProbetrueDescribes the Instructions for assessing container health by executing an HTTP GET request.
To learn more you can go here
initial_delay_secondsintegerfalseNumber of seconds after the container is started before the first probe is initiated.
period_secondsintegerfalseHow often, in seconds, to execute the probe.
timeout_secondsintegerfalseNumber of seconds after which the probe times out.
success_thresholdintegerfalseMinimum consecutive successes for the probe to be considered successful after having failed.
failure_thresholdintegerfalseNumber of consecutive failures required to determine the container is not alive (liveness probe) or not ready (readiness probe).

Port

Port

Description

Describes the ports the service should be exposed to.

Schema

{
  "port": 80,
  "protocol": "TCP",
  "expose": true,
  "app_protocol": "http",
  "host": "string",
  "path": "string",
  "rewrite_path_to": "string",
  "auth": {
    "type": "string",
    "username": "string",
    "password": "string"
  }
}

Properties

NameTypeRequiredDescription
portintegertruePort number to expose.
protocolstringtrueProtocol for the port.
exposebooleantrueExpose the port
app_protocolstringfalseApplication Protocol for the port.
Select the application protocol used by your service. For most use cases, this should be http(HTTP/1.1).
If you are running a gRPC server, select the grpc option.
This is only applicable if expose=true.
hoststringfalseHost e.g. ai.example.com, app.truefoundry.com
pathstringfalsePath e.g. /v1/api/ml/, /v2/docs/
rewrite_path_tostringfalseRewrite the path prefix to a different path.
If path is /v1/api and rewrite_path_to is /api. The URI in the HTTP request http://0.0.0.0:8080/v1/api/houses will be rewritten to http://0.0.0.0:8080/api/houses before the request is forwarded your service.
Defaults to /.
This is only applicable if path is given.
authBasicAuthCredsfalseUsername and password for Basic Service Authentication

Enumerate Values

PropertyValue
protocolTCP
protocolUDP
app_protocolhttp
app_protocolgrpc
app_protocoltcp

RolloutStrategy

Rolling

Description

This strategy updates the pods in a rolling fashion such that a subset of the
total pods are replaced with new version at one time.
A commonly used strategy can be to have maxUnavailablePercentage close to 0 so that there
is no downtime and keep the maxSurgePercentage to around 25%. If you are anyways running
a large number of pods, the service can often tolerate a few pods going down - so you
max maxUnavailablePercentage = 10 and maxSurgePercentage=0. You can read about it more
here

Schema

{
  "type": "string",
  "max_unavailable_percentage": 25,
  "max_surge_percentage": 0
}

Properties

NameTypeRequiredDescription
typestringtrue+value=rolling_update
max_unavailable_percentageintegertruePercentage of total replicas that can be brought down at one time.
For a value of 25 when replicas are set to 12 this would mean minimum (25% of 12) = 3 pods might be unavailable during the deployment.
Setting this to a higher value can help in speeding up the deployment process.
max_surge_percentageintegertruePercentage of total replicas of updated image that can be brought up over the total replicas count.
For a value of 25 when replicas are set to 12 this would mean (12+(25% of 12) = 15) pods might be running at one time.
Setting this to a higher value can help in speeding up the deployment process.

Canary

Description

This strategy brings up the new release without bringing the older release down. Traffic is shifted from the older release to the newer release in a staged manner.
This can help with verifying the health of the new release without shifting complete traffic.

Schema

{
  "type": "string",
  "steps": [
    {
      "weight_percentage": 100,
      "pause_duration": 30
    }
  ]
}

Properties

NameTypeRequiredDescription
typestringtrue+value=canary
steps[CanaryStep]trueThese steps would be executed in order to enable shifting of traffic slowly from stable to canary version

CanaryStep

Description

Describes a canary deployment step

Schema

{
  "weight_percentage": 100,
  "pause_duration": 30
}

Properties

NameTypeRequiredDescription
weight_percentageintegertruePercentage of total traffic to be shifted to the canary release.
The rest will continue to go to the existing deployment
pause_durationintegerfalseDuration for which to pause the release. The release process will wait for these seconds before proceeding to the next step.
If this is not set, the step will pause indefinitely on this step

BlueGreen

Description

This strategy brings up the new release completely before switching the complete load to the new release.
This minimizes the time that two versions are serving traffic at the same time.

Schema

{
  "type": "string",
  "enable_auto_promotion": false,
  "auto_promotion_seconds": 30
}

Properties

NameTypeRequiredDescription
typestringtrue+value=blue_green
enable_auto_promotionbooleantruePromote the new release to handle the complete traffic. A manual promotion would be needed if this is disabled
auto_promotion_secondsintegerfalsePromote the new release to handle the complete traffic after waiting for these many seconds

Autoscaling

ServiceAutoscaling

Description

Describes a Service Autoscaling configuration

Schema

{
  "metrics": {}
}

Properties

NameTypeRequiredDescription
metricsobjectfalseMetrics to use for the autoscaler

CPUUtilizationMetric

Description

Describes CPU utilization metric for autoscaling

Schema

{
  "type": "string",
  "value": 0
}

Properties

NameTypeRequiredDescription
typestringtrue+value=cpu_utilization
valueintegertruePercentage of cpu request averaged over all replicas which the autoscaler should try to maintain

RPSMetric

Description

Describes requests per second metric for autoscaling

Schema

{
  "type": "string",
  "value": 1
}

Properties

NameTypeRequiredDescription
typestringtrue+value=rps
valueintegertrueAverage request per second averaged over all replicas that autoscaler should try to maintain

CronMetric

Description

Describes cron metric for autoscaling

Schema

{
  "type": "string",
  "desired_replicas": 1,
  "start": "string",
  "end": "string",
  "timezone": "UTC"
}

Properties

NameTypeRequiredDescription
typestringtrue+value=cron
desired_replicasintegerfalseDesired number of replicas during the given interval. Default value is max_replicas.
startstringtrueCron expression indicating the start of the cron schedule.
endstringtrueCron expression indicating the end of the cron schedule.
timezonestringtrueTimezone against which the cron schedule will be calculated, e.g. "Asia/Tokyo". Default is machine's local time.
https://docs.truefoundry.com/docs/list-of-supported-timezones

Authentication

BasicAuthCreds

Description

Username and password for Basic Service Authentication

Schema

{
  "type": "string",
  "username": "string",
  "password": "string"
}

Properties

NameTypeRequiredDescription
typestringtrue+value=basic_auth
usernamestringtrue+label=Username for service auth
+message=Upto 64 lower case alphanumeric character long
+sort=1
passwordstringtrue+label=Password for service auth
+message=Password should not be more than 64 characters
+sort=2