Saltar al contenido principal

Service

In Sleakops a service is an entity of an application, as in a microservices architecture.

Create a Service

To create a service you provide the following basic information:

  • Project and Environment for the service to be deployed.
  • A 'name' to identify the service.
  • A 'command' (or CMD of Dockerfile) that will be applied to the service execution. If no command is provided, the default Docker command will be used.
  • Service TYPE which are described below .
  • Resource set which is also described below

Service Types

Depending on the Service type chosen you will need to fill in different fields, besides that, the Command will always be applied so there is where comes the importance of that field which is normally the line you use to make the service work. The actual possible service types are:

  • Worker: Requires nothing else, just be sure that the defined CMD activates the worker.
  • Cron Job: You need to define the 'Cron' or the frequency of a Job execution, which is basically, set how often the Job occurs.
  • Hook: An 'event' is required to be set, when this event happens the Hook triggers the CMD.
  • Web Service: A Web Service requires an 'url' that will work as its endpoint. SleakOps generate this url based on the name of the service and external-dns will use the hierarchy of where it has been created. As an example, the URL will be: {service_name}.{environment_name}.{provider_domain_name}.

Create a Job

A Job uses the same fields that the Service, the difference radicates in that a Job can be created and executed at any moment, by the other side, while you create a Service as a structural need of your Deployment a Job is something that you create to be executed at the moment.

Resource Set

You'll also need to set the resource set needed for this service to run.

NameDescription
CPU MinMin CPU requested in milicores. More information here
CPU MaxMax CPU requested in milicores. More information here
Memory MinMin memory requested in MegaBytes. More information here
Memory MaxMax memory requested in MegaBytes. More information here
AutoscalingEnables Horizontal Pod Austocaling as described here .
CPU TargetOnly when autoscaling is enabled. Average CPU utilization that triggers the scaling.
Memory TargetOnly when autoscaling is enabled. Average memory utilization that triggers the scaling.
Replica MinOnly when autoscaling is enabled. Min amount of replicas to be achieved.
Replica MaxOnly when autoscaling is enabled. Max amount of replicas to be achieved.
Replicas DesiredOnly when autoscaling is enabled. The number of replicas that the service initially has.

Cloud resources

Sleakops doesn't generate any resources in your provider when you create a service but you should take into account that the resource set you've defined come from the nodes of the Cluster, so these resources like RAM and Cores are consumed from the EC2 instance.