Skip to main content
This guide shows you how to deploy the WireMock Runner in a Kubernetes cluster, configured to serve mock APIs from WireMock Cloud.

Prerequisites

Before you begin, ensure you have:
  • A Kubernetes cluster (local or remote)
    • For local development, KIND is recommended
  • kubectl CLI tool installed and configured
  • WireMock CLI installed and configured
    • Install from the WireMock CLI documentation
    • Authenticate with wiremock login or configure your API token with wiremock config set api-token <your-token>
  • A WireMock Cloud account with one or more mock APIs created
If you don’t have a Kubernetes cluster, you can create a local one with KIND:
# Install KIND (macOS)
brew install kind

# Create a cluster
kind create cluster --name wiremock-demo

# Verify the cluster is running
kubectl cluster-info

Clone the demo repository

The WireMock Kubernetes Runner demo repository contains all the necessary configuration files and scripts:
git clone https://github.com/wiremock-inc/kubernetes-runner-demo.git
cd kubernetes-runner-demo

Set up authentication

Create a Kubernetes secret with your WireMock Cloud API token:
./set-secret.sh
This script retrieves your API token from the WireMock CLI configuration and creates a secret named wiremock-cloud-token that the WireMock Runner will use to authenticate with WireMock Cloud.
If you haven’t logged in with the WireMock CLI, run wiremock login first. You can also find your API token in the WireMock Cloud console.

Deploy to Kubernetes

Run the installation script to deploy WireMock Runner:
./install-wiremock.sh
This script will:
  1. Create a Persistent Volume Claim (PVC) for storing WireMock configuration
  2. Deploy the WireMock Runner service and deployment
  3. Set up ingress rules for accessing the APIs
The demo project includes pre-recorded stub mappings under .wiremock directory for both the PayPal Invoicing and GitHub REST APIs, so you can test the deployment immediately without needing to create stubs first. Verify the deployment:
kubectl get pods -l app=wiremock-runner
You should see the WireMock Runner pod in a Running state.

Monitor your deployment

Check pod status

kubectl get pods -l app=wiremock-runner

View logs

kubectl logs -l app=wiremock-runner -f

Test the APIs

For local development, you may need to add these entries to your hosts file:
127.0.0.1 admin.local.wiremock.cloud paypal.local.wiremock.cloud github.local.wiremock.cloud
First, try fetching a list of PayPal invoices from the simulated PayPal Invoicing API:
curl 'http://paypal.local.wiremock.cloud/v2/invoicing/invoices?page=1&page_size=10&total_required=true&fields=amount'
You should see a fairly large JSON response, containing invoice data. Now try fetching a list of GitHub users from the simulated GitHub REST API:
curl http://github.local.wiremock.cloud/users
Again, you should see a JSON response, containing a list of user profiles.

Clean up

To remove the WireMock Runner deployment:
./delete-wiremock.sh
To delete the KIND cluster (if using a local cluster):
kind delete cluster --name wiremock-demo

Next steps

Additional resources