loader

Onboarding Applications
Introduction

This page will guide you through onboarding an application deployment to a slice, as well as setting up the necessary ServiceExports if necessary.

Deploying the Application

Variable

Description

<slice name>

Name of the slice the application should be deployed on.

<cluster name>

Name of the name the application will be deployed on.

<namespace>

The namespace the application will be deployed on.

<deployment yaml>

The path to the application deployment .yaml file.

Updating the Deployment .yaml File

To onboard an application onto a slice, you will need to modify the application deployment .yaml file to include the below annotation:

metadata:
  annotations:
    avesha.io/slice: <slice name>

As an example, here is the top portion of an iperf application deployment file with the correct annotation:

apiVersion: apps/v1
kind: deployment
metadata:
  name: iperf
  namespace: iperf
  labels:
    app: iperf
  annotations:
    avesha.io/slice: <slice name>

spec:
...

Deploying the Deployment .yaml File

Note
The following steps should be performed for each cluster you would like the application directly deployed on. If exported, services will be available across the slice.

First, switch contexts to the cluster you will be deploying the application(s) to:

kubectx <cluster name>

You are now able to use the below command to apply the deployment .yaml file created in the previous section:

kubectl apply -f <deployment yaml> -n <namespace>

Verify your deployment by getting and listing the pods in the namespace in which the deployment .yaml file was applied:

kubectl get pods -n <namespace>
ServiceExports and ServiceImports
Note
If you wish to have your service discoverable across the KubeSlice DNS, you will need to create a ServiceExport. Without exporting, your application can still be accessed locally or remotely using each service’s remote IP address.

Variable

Description

<serviceexport name>

What you will name the ServiceExport.

<slice name>

Name of the slice the application should be deployed on.

<serviceexport name>

Name of the name the application will be deployed on.

<key>: <value>

The spec: selector: label pointing to your service.

<protocol name>

The protocol being used for external communications (ex: tcp).

<port>

The port being used for external communications.

<protocol>

The protocol being used for external communications (ex: TCP).

<serviceexport yaml>

The path to the application deployment .yaml file.

Creating a ServiceExport

To export a service, you will want to create a service export .yaml file following the template below:

apiVersion: mesh.avesha.io/v1beta1
kind: ServiceExport
metadata:
  name: <serviceexport name>
spec:
  slice: <slice name>
  selector:
    matchLabels:
      <key>: <value>
  meshType: none
  ingressEnabled: false
  ports:
  - name: <protocol name>
    containerPort: <port>
    protocol: <protocol>

To apply the service export to the service deployed in the previous section, use the command below targeting the newly created service export .yaml file:

kubectl apply -f <serviceexport yaml> -n <namespace>

You can verify the service was exported successfully using the below command:

kubectl get serviceexport <serviceexport name> -n <namespace>

The service will now be exported and reachable through KubeSlice DNS as:

<application name>.<slice name>.svc.slice.local

ServiceImports

When a ServiceExport is deployed, the corresponding ServiceImport is automatically created on each of the clusters that are part of the slice. This populates the necessary DNS entries and ensures your traffic always reaches the correct cluster and endpoint.

You can verify the service was imported on other clusters correctly using the below command:

kubectl get serviceimport <serviceexport name> -n <namespace>
Note
You have successfully deployed and exported a service to your KubeSlice cluster.
Next Steps

That’s all there is to it!

Feel Free to Follow our Tutorials on Installing Specific Applications Here:

Reverse the Process and Begin Uninstalling KubeSlice Here:


< PREVIOUS
Installing Slices In this step, you will configure and install a slice across your registered clusters. This is the final step to be completed before you can get started deploying your applications with KubeSlice. Read More
NEXT >
Tutorials We’ve outlined two end-to-end application tutorials to aid you in getting started with KubeSlice and begin introducing you to it’s various features: Read More