DEV Community

3logy
3logy

Posted on

4 1

Deploy a castlemock mockserver on Kubernetes with helm.

Table Of Contents

This is my first post ever

What is a mockserver?

A mock server is actually a fake API that simulates a real server response. There are many articles about certain open source solutions like mockserver or about the general concept of mocking APIs

Why should a team use a mock server in their development lifecycle? There could be two good reasons :

  • Simplify testing
  • Decoupling development teams

After we noticed a tight coupling behavior between a product team and my team, I decided to deploy a mock server to reduce the dependencies between the team. The mock server should have the following properties:

  • could be used for automation tests as well as for manual tests
  • Easy setup and maintenance by the business analyst
  • can process REST as SOAP requests

I found out that there are a lot of open source solution for mocking api. From mock-server to castlemock

Install Docker and Kubernetes on MacOs

This is pretty easy.
The following steps can help you with:

When that's done, all you have to do is pull the latest version of castlemock from Docker Hub :

 docker pull castlemock/castlemock

If everything works, install Helm using the following commands :

 brew install helm

It's all.

Install castlemock with helm

Assuming Docker, Kubernetes and Helm are install and running. Do the following steps:

So easy it's when working with Helm.

Many thanks to Muhammad Hewedy đź‘Ť , who helps me on Twitter to get into Castlemock deployment on Kubernetes.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (3)

Collapse
 
mhewedy profile image
Muhammad Hewedy •

You welcome :)

Collapse
 
bosofelipe profile image
Felipe Thiago Boso •

Hi @3logy , Is possible running this aplication using minikube, for a local tests?

I run the helm an access chart-example.local, but is out of service

Collapse
 
bosofelipe profile image
Felipe Thiago Boso •

I changed to NodePort in a ingress tag, and solve my problem!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay