Search…
Step 6: Release Your Services
You are now ready to deploy the first version of your services into your application namespace on your cluster, where Vamp can release them.

The Vamp Particles Service

If you followed the proceeding steps, you should now have the following:
  • An application called Production that:
    • Maps to a Kubernetes Namespace called particles
    • Uses the Contour Ingress controller
    • Exposes a service called Particles on the path /
    • Releases new versions of the Particles service using a three-step policy called General Patch Release Policy.
  • A service called Particles with:
    • An app=particles label
    • A version label called version
    • An API exposed on port 5000.
You can now deploy the first version of this service using the following command:
1
kubectl apply -f https://raw.githubusercontent.com/magneticio/vamp-cloud-demo/main/particles/particles-v1.0.0.yaml
Copied!
Within around 30 seconds of the deployment, the version will show up with the Success status:

How to label your workload

For Vamp to release a version of a service, the workload must be correctly labelled.
The name of the version label is configurable
Vamp requires that the app and version labels on the Kubernetes Deployment and Pod template match.
If the labels do not match, the Release Agent ignores the Deployment and the new version is not released.
Canary Releases Only
Vamp requires that the label selector on the Kubernetes Deployment matches both the app and version labels.
If the label selector does not match both labels, Vamp will not create a Kubernetes Service for your Deployment and the release will fail.

Canary Release Example

This is the Kubernetes Deployment YAML for version 1.0.0 of the Vamp Particles service.
The app=particles and version=1.0.0 labels are set in three places:
  1. 1.
    metadata.labels
  2. 2.
    spec.selector.matchLabels
  3. 3.
    spec.template.metadata.labels
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: particles-v1.0.0
5
namespace: production
6
labels:
7
app: particles
8
version: 1.0.0
9
spec:
10
selector:
11
matchLabels:
12
app: particles
13
version: 1.0.0
14
replicas: 2
15
template:
16
metadata:
17
labels:
18
app: particles
19
version: 1.0.0
20
spec:
21
containers:
22
- name: particles
23
ports:
24
- containerPort: 5000
Copied!
For comparison, this is the Kubernetes Deployment YAML for version 1.0.1:
The app=particles and version=1.0.1 labels are set in three places:
  1. 1.
    metadata.labels
  2. 2.
    spec.selector.matchLabels
  3. 3.
    spec.template.metadata.labels
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: particles-v1.0.1
5
namespace: production
6
labels:
7
app: particles
8
version: 1.0.1
9
spec:
10
selector:
11
matchLabels:
12
app: particles
13
version: 1.0.1
14
replicas: 2
15
template:
16
metadata:
17
labels:
18
app: particles
19
version: 1.0.1
20
spec:
21
containers:
22
- name: particles
23
ports:
24
- containerPort: 5000
Copied!

Validation Release Example

Validation Releases Only
Do not set a version label on the spec.selector.matchLabels. Doing so will cause rolling updates to the Deployment to fail.
This is the Kubernetes Deployment YAML for version 1.0.0 of the Vamp Particles service.
The app=particles and version=1.0.0 labels are set in three places:
  1. 1.
    metadata.labels
  2. 2.
    spec.template.metadata.labels
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: particles
5
namespace: production
6
labels:
7
app: particles
8
version: 1.0.0
9
spec:
10
selector:
11
matchLabels:
12
app: particles
13
replicas: 2
14
template:
15
metadata:
16
labels:
17
app: particles
18
version: 1.0.0
19
spec:
20
containers:
21
- name: particles
22
ports:
23
- containerPort: 5000
Copied!
For comparison, this is the Kubernetes Deployment YAML for version 1.0.1:
The app=particles and version=1.0.1 labels are set in three places:
  1. 1.
    metadata.labels
  2. 2.
    spec.template.metadata.labels
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: particles
5
namespace: production
6
labels:
7
app: particles
8
version: 1.0.1
9
spec:
10
selector:
11
matchLabels:
12
app: particles
13
replicas: 2
14
template:
15
metadata:
16
labels:
17
app: particles
18
version: 1.0.1
19
spec:
20
containers:
21
- name: particles
22
ports:
23
- containerPort: 5000
Copied!