Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with min
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2.9 KiB

Getting Started with Deployment

This tutorial assumes that you have completed the Frontend Backend Run Sample

Before we deploy, make sure you have the following installed on your machine.

  1. Installing docker based on your operating system.

  2. A container registry. Docker by default will create a container registry on DockerHub. You could also use Azure Container Registry or another container registry of your choice.

  3. A Kubernetes Cluster. There are many different options here, including:

Deploying the application

Now that we have our application running locally with multiple containers, let's deploy the application. In this example, we will deploy to Kubernetes by using tye deploy.

  1. Adding a container registry to tye.yaml

    Based on what container registry you configured, add the following line in the tye.yaml file:

    name: microservice
    registry: <registry_name>
    

    If you are using dockerhub, the registry_name will be in the format of 'example'. If you are using Azure Kubernetes Service (AKS), the registry_name will be in the format of example.azurecr.io.

  2. Deploy to Kubernetes

    Next, deploy the rest of the application by running.

    tye deploy
    

    tye deploy does many different things to deploy an application to Kubernetes. It will:

    • Create a docker image for each project in your application.
    • Push each docker image to your container registry.
    • Generate a Kubernetes Deployment and Service for each project.
    • Apply the generated Deployment and Service to your current Kubernetes context.
  3. Test it out!

    You should now see two pods running after deploying.

    kubectl get pods
    
    NAME                                             READY   STATUS    RESTARTS   AGE
    backend-ccfcd756f-xk2q9                          1/1     Running   0          85m
    frontend-84bbdf4f7d-6r5zp                        1/1     Running   0          85m
    

    You can visit the frontend application by port forwarding to the frontend pod.

    kubectl port-forward frontend-84bbdf4f7d-6r5zp 8000:80
    

    Now navigate to http://localhost:8000 to view the frontend application working on Kubernetes.

Next Steps

Now that you are able to deploy an application to Kubernetes, learn how to add a non-project dependency to tye with our Redis tutorial.