odo can deploy services with the help of operators.
The list of available operators and services available for installation can be found with the
odo catalog command.
Services are created in the context of a component, so you should have run
odo create before you deploy services.
The deployment of a service is done in two steps:
- Define the service and store its definition in the devfile,
- Deploy the defined service to the cluster, using
You can create a new service with the command:
For example, to create an instance of a Redis service named
my-redis-service, you can run:
This command creates a Kubernetes manifest in the
kubernetes/ directory, containing the definition of the service, and this file is referenced from the
Note that the name of the created instance is optional. If you do not provide a name, it will be the lowercased name of the service. For example, the following command will create an instance of a Redis service named
By default, a new manifest is created in the
kubernetes/ directory, referenced from the
devfile.yaml file. It is possible to inline the manifest inside the
devfile.yaml file using the
Without specific indication, the service will be created with a default configuration. You can use either command-line arguments or a file to specify your own configuration.
You can use the
-p) flag to specify your own configuration.
In the following example, we will configure the Redis service with three parameters:
You can obtain the possible parameters for a specific service from the
odo catalog describe service command.
You can use a YAML manifest to specify your own specification.
In the following example, we will configure the Redis service with three parameters. For this, first create a manifest:
Then create the service from the manifest:
You can delete a service with the command:
You can use the
-f) flag to force the deletion of the service without confirmation.
You can get the list of services created for your component with the command:
For each service,
STATE indicates if the service has been pushed to the cluster using
odo push, or if the service is still running on the cluster but removed from the devfile locally using
odo service delete.
You can get the details about a service such as its kind, version, name and list of configured parameters with the command: