DEV Community

mia
mia

Posted on

Mocker makes it easy it to mock a service running inside a cluster and debug

Hi, it’s Mia again from Skyramp. A few weeks ago we announced the availability of the first of our Kubernetes testing tools, Mocker on the VS Code extensions marketplace.

Today I want to show you how easy it is to mock a service running inside a cluster and debug if you already have your application deployed in that cluster.

First, deploy a new worker container in the namespace where your application is running.

Image description

Second, once the worker container is deployed, you can create a mock in six easy steps:

Step 1. Enter a port number

Image description

Step 2. Select an API protocol

Image description

Step 3. Choose the input API definition file

Image description

Step 4. Select a service to mock

Image description

Step 5. Enter the name of the K8s service that is running

Image description

Step 6. Review your choices, and confirm by clicking “Create Mock”

Image description

You’ll see a YAML of the generated configuration. If needed, you can edit default values here.

Third, apply the created mock. This will push the mock configurations to Mocker in-cluster. All calls to the mock service will now be routed to Mocker, which will respond with the configured default values.

If you’d like to update mock values, simply rerun the “apply mocks” command and change them.

We’ll have a video walkthrough of this entire process posted shortly!

If you have any feedback or requests, please let me know by replying here or at support@skyramp.dev.

We are adding more features continually, as well as new Kubernetes testing tools to accompany Mocker, including:

  • a JS library to create complex in-cluster mocks
  • Tester, Mocker’s powerful test client partner

Sign up here to get notified of important new Skyramp launches and announcements.

Thanks,

Mia

Top comments (0)