Prerequisites
Before you begin, ensure you have:- A Kubernetes cluster (local or remote)
- For local development, KIND is recommended
kubectlCLI tool installed and configured- WireMock CLI installed and configured
- Install from the WireMock CLI documentation
- Authenticate with
wiremock loginor configure your API token withwiremock 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:
Clone the demo repository
The WireMock Kubernetes Runner demo repository contains all the necessary configuration files and scripts:Set up authentication
Create a Kubernetes secret with your WireMock Cloud API token: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:- Create a Persistent Volume Claim (PVC) for storing WireMock configuration
- Deploy the WireMock Runner service and deployment
- Set up ingress rules for accessing the APIs
.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:
Running state.
Monitor your deployment
Check pod status
View logs
Test the APIs
For local development, you may need to add these entries to your hosts file:
Clean up
To remove the WireMock Runner deployment:Next steps
- Learn how to record multiple APIs simultaneously from within Kubernetes
- Learn how to promote your mock APIs between environments using Git and CI/CD.
Additional resources
- Learn more about Serve Mode configuration options
- Explore the Runner Overview for other modes