Sometimes it is convenient to have a workload that does nothing. In this example a container with
curl installed is used as the base for the
sleep service, so that testing is easier.
sleep service is used in multiple examples in the TSB documentation. This document provides the basic installation procedure for this service.
Please make sure to refer to each TSB documentation for specific caveats or customizations that are required for the examples to work, as this document describes the most generic installation steps.
The following examples assume that you have already setup TSB, and that you have onboarded Kubernetes clusters to install the
sleep workload to.
Unless otherwise stated, the examples that use the
kubectl command must be pointed to the same cluster. Make sure that your
kubeconfig is pointing to the desired cluster before running these commands.
Unless otherwise stated, the
sleep service is assumed to be installed in the
sleep namespace. If not already present, this namespace must be created in the target cluster.
Run the following command to create the namespace if not already present:
kubectl create namespace sleep
sleep pod in this namespace must have an Istio sidecar proxy running in it. To automatically enable the injection of this sidecar for all pods, execute the following:
kubectl label namespace sleep istio-injection=enabled --overwrite=true
This will let Istio know that it needs to inject the sidecar to the pod that you will create later.
sleep Pod and Service
sleep.yaml manifest found in the Istio repository.
Run the following command to deploy the
sleep service in the
kubectl apply -n sleep -f sleep.yaml
This next step may or may not be necessary depending on the usage scenario. If you are creating a TSB Workspace, follow the steps below to create one.
In this example we assume that you have already created a tenant in your organization. If you have not created one, read the examples in documentation and create one.
Create a workspace for
sleep that claims the namespace
sleep, if you have not already done so. Create a file called
sleep-workspace.yaml with contents similar to the sample below. Make sure to replace the organization, tenant, and cluster names to appropriate values.
If you have installed the
demo profile, an organization named
tetrate and a cluster already onboarded named
demo already exist.
displayName: Sleep Workspace
Apply the manifest using
tctl apply -f sleep-workspace.yaml