Deploy and expose a microservice

You already know how to deploy and expose a Function. Let's now do the same with a container microservice. We'll use the Kyma example orders-service for this.

Deploy the microservice

First, let's create a Deployment that provides the microservice definition and lets you run it on the cluster.

  • Kyma Dashboard
  • kubectl

Create the Service

Now that we have the Deployment, let's deploy the Kubernetes Service to allow other Kubernetes resources to communicate with your microservice.

  • Kyma Dashboard
  • kubectl

Expose the microservice

We have created the Service. Let's now expose it outside the cluster.

CAUTION: Exposing a workload to the outside world is always a potential security vulnerability, so tread carefully. In a production environment, always secure the workload you expose with OAuth2 or JWT.

To expose our microservice, we must create an APIRule CR for it, just like when we exposed our Function.

  • Kyma Dashboard
  • kubectl

Verify the microservice exposure

Now let's check that the microservice has been exposed successfully.

  • Kyma Dashboard
  • kubectl