Skip to main content
Version: 1.4.x

Status

Each resource in TSB is able to provide a status to let the user know it's current integrity. Some resources, like configurations for ingress, traffic and security, are not immediately applied as soon as TSB accepts any modification from user. In these cases, the status will provide enough information to know when it is really applying to the affected workloads. This allows any user or CI/CD process to poll the status of any desired resource and proceed accordingly.

As an example, lets say the user pushes an IngressGateway configuration. As the requests succeeds in TSB server, that resource status will reach the ACCEPTED status with a TSB_ACCEPTED event in its details:

apiVersion: api.tsb.tetrate.io/v2
kind: ResourceStatus
metadata:
name: bookinfo-gateway
organization: my-org
tenant: my-tenant
workspace: bookinfo-ws
gatewaygroup: bookinfo-gw-group
spec:
status: ACCEPTED
message: "Check the details for more information"
details:
- type: TSB_ACCEPTED
occurredAt: 2021-10-05T01:30:15.01Z

Then, when pushed to MPC it succeeds and stays in ACCEPTED status, and the event list reflects the new event data, which will become:

// omiting the rest of the fields for simplicity
spec:
status: ACCEPTED
message: "Check the details for more information"
details:
- type: TSB_ACCEPTED
occurredAt: 2021-10-05T01:30:15.01Z
- type: MPC_ACCEPTED
occurredAt: 2021-10-05T01:30:15.01Z

Later on, if there is an error in the MPC underlying layers such as XCP Central, a new event will be propagated and appended to the resource status that will change to status FAILED with the corresponding message.

# omiting the rest of the fields for simplicity
spec:
status: FAILED
message: "IngressGateway.xcp.tetrate.io \"INVALID-96010ce1d9b7df5c\" is invalid: metadata.name:
Invalid value: \"INVALID-96010ce1d9b7df5c\": a DNS-1123 subdomain must consist of lower case alphanumeric characters,
'-' or '.', and must start and end with an alphanumeric character
(e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"
details:
- type: TSB_ACCEPTED
occurredAt: 2021-10-05T01:30:10.01Z
- type: MPC_ACCEPTED
occurredAt: 2021-10-05T01:30:15.01Z
- type: XCP_CENTRAL_REJECTED
occurredAt: 2021-10-05T01:30:20.01Z
reason: "ValidationFailed"
message: "IngressGateway.xcp.tetrate.io \"INVALID-96010ce1d9b7df5c\" is invalid: metadata.name:
Invalid value: \"INVALID-96010ce1d9b7df5c\": a DNS-1123 subdomain must consist of lower case alphanumeric characters,
'-' or '.', and must start and end with an alphanumeric character
(e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"

Another example would be pushing the configuration of a Tenant resource, which is a non-configurable resource. This kind of resource will reach the READY status once it's request has been processed by the TSB server.

apiVersion: api.tsb.tetrate.io/v2
kind: ResourceStatus
metadata:
name: tetrate
organization: tetrate
spec:
status: READY
details:
- type: TSB_ACCEPTED
occurredAt: 2021-10-05T01:30:15.01Z

ConfigEvents

ConfigEvents provides a way to notify the status of a configuration propagation as a sequence of events.

FieldDescriptionValidation Rule

events

List of tetrateio.api.tsb.v2.ConfigEvents.Event
Sequence of events occurred under the configuration propagation flow. It's ordered by event timestamp, newest first.

Event

Single Event event occurred in the configuration propagation flow.

FieldDescriptionValidation Rule

type

tetrateio.api.tsb.v2.ConfigEvents.EventType
Type of the event.

reason

string
Optional code that extends the type of the occurred event.

message

string
Optional message describing the reason in a human readable way.

timestamp

google.protobuf.Timestamp
Time of the event occurrence.

etag

string
The etag of the resource which configuration triggered this event.

EventType

Simple Status of the current resource. It's a projection of its details (events, etc.) that allows to easily know the status of the resource without requiring to check the details.

NameNumberDescription

INVALID

0

INVALID is the zero value and should never be reached.

TSB_ACCEPTED

1

TSB_ACCEPTED happens when the configuration has been validated and persisted by TSB. Note that there is no TSB_REJECTED because in case of an obvious syntax error, the client requests for the API will fail directly. The configuration will not be persisted and therefore no config status will be associated with it.

MPC_ACCEPTED

2

MPC_ACCEPTED happens when MPC receives the configuration from TSB. Note that there is no MPC_REJECTED because it's just a pass-through to XCP Central.

XCP_CENTRAL_ACCEPTED

3

XCP_CENTRAL_ACCEPTED happens when XCP Central validates the configuration and the XCP resource is properly created.

XCP_CENTRAL_REJECTED

4

XCP_CENTRAL_REJECTED happens when XCP Central reports that the configuration is not valid.

MPC_FAILED

5

MPC_FAILED happens when MPC fails to process some configuration received from TSB. These failures are prior to sending the translated configurations to XCP.

ResourceStatus

ResourceStatus provides the current status of any TSB resource.

FieldDescriptionValidation Rule

status

tetrateio.api.tsb.v2.ResourceStatus.Status
Current status of the resource.

message

string
User friendly message adding details of the status.

configEvents

tetrateio.api.tsb.v2.ConfigEvents
Status of the configuration workflow of the resource. It provides a sequence of events notifying the executed steps of a configuration being propagated to all the clusters.

Status

Simple Status of the current resource. It's a projection of its details (events, etc.) that allows to easily know the status of the resource without requiring to check the details.

NameNumberDescription

INVALID

0

INVALID status should never be reached. It indicates some problem occurred with the resource status, and would need to contact the admin to troubleshoot it. It's the default value but it's always expected to have one of the other values.

ACCEPTED

1

ACCEPTED is reached when the provided configuration has been validated and persisted by the TSB server.

READY

2

READY is reached when the resource is ready to be used. Non-configurable resources, like Organizations, Tenants or Users, will be ready as soon they are created. The configurable ones are ready when its configuration has been propagated to all the clusters.

FAILED

3

FAILED is reached in different situations, such as when:

  • a resource configuration triggered some internal error.
  • an offending resource affects the correct behaviour of the configuration. The message and details fields of the ResourceStatus provides the root cause of the error.