Search…
Step 2: Create a Service
A service in Vamp Cloud is a microservice. In Kubernetes terms, a Vamp Cloud service is a Deployment or StatefulSet.
The next step is to create a service.

Name

This is the name that will be displayed wherever your service is used, including external notifications like Slack.
For example: Particles.

Description

This should be a short and meaningful description that provides additional context for the service.

Type

Vamp Cloud supports two types of service: API-based services and message-based services.
Vamp Cloud currently only supports API-based services.
Message-based services are supported for private cloud customers.
API-based services are services that expose a REST-based API or a GraphQL-based API and can be progressively released using traffic shaping.
Also known as canary releasing, this requires that each new version of a service is deployed in parallel with the existing, live version of the service. For this reason, API-based services are deployed using Kubernetes Deployments.
Message-based services are services that either do not expose an API or expose an API using a messaging system like NATS. This type of service cannot be progressively released.

API-based Service

Container Port

This is the network port on which your container exposes the API. Vamp uses this port to the Kubernetes Service to expose the API.
For example: 5000
Vamp Cloud currently only supports one network port per service.
Your container can expose multiple network ports but Vamp will only create a Kubernetes Service for the chosen port.
There are a number of ways you can find the container port for your service.
From a Dockerfile
From a running Docker container
From Kubernetes Deployment YAML
If you are starting from a Dockerfile, look for an EXPOSE instruction.
For example, the Dockerfile for the Particles demo service contains EXPOSE 5000.
If you are starting from a running Docker container, you can use the docker port <container-id | container-name> command to find the container port.
For example, if you run the particles Docker image locally:
1
docker run -d -P --name particles magneticio/particles:1.5.2
Copied!
Then you can find the exposed ports as follows:
1
docker port particles
Copied!
In this case, there is just one port, 5000:
1
5000/tcp -> 0.0.0.0:32769
Copied!
If you are starting from an existing Kubernetes Deployment then copy the containerPort value from your YAML file.
For example, this is a simplified version of the Kubernetes Deployment for the particles service:
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: particles-v1.5.2
5
namespace: production
6
labels:
7
app: particles
8
version: 1.5.2
9
spec:
10
selector:
11
matchLabels:
12
app: particles
13
version: 1.5.2
14
replicas: 4
15
template:
16
metadata:
17
labels:
18
app: particles
19
version: 1.5.2
20
spec:
21
containers:
22
- name: particles
23
image: magneticio/particles:1.5.2
24
ports:
25
- containerPort: 5000
Copied!

Kubernetes Details

Workload Type

Vamp Cloud supports two types of Kubernetes workload: Deployments and StatefulSets.
Vamp Cloud currently only supports Kubernetes Deployments. This is because progressive releasing requires the different versions to be deployed in parallel.
StatefulSets and Deployments using rolling updates are supported for private cloud customers.

App Label

Vamp discovers new versions of your service using Kubernetes labels.
For example: app = particles.
Each Kubernetes workload that Vamp releases needs to have an app label set. This label is used to locate all the instances of your service for an application.
The default name for the app label is "app". The value must be unique and is normally the name of the service.

Version Label

The name of the label that contains the semantic version number for each instance of your service. The default name of this label is "version".
Vamp uses this label to distinguish between versions of your service.
This label is also used to decide which release policy to apply when releasing a new version of your service.

Creating Additional Services

You can click the Next button to create the service and then move to the next step.
Alternatively, you can click the + Save & Add another service link to add additional services.
You may create a total of six services as part of the Quick Start Guide.
In both cases, you will see a message indicating that the service has been created.