|
1 | 1 | # wiremock-helm
|
2 |
| -Helm Chart for deployment Wiremock to Kubernetes |
| 2 | + |
| 3 | +Helm Chart for WireMock deployment to Kubernetes. |
| 4 | +It allows deploying the official [WireMock Docker images](https://github.com/wiremock/wiremock-docker) |
| 5 | +and also other charts that extend it, |
| 6 | +in particular [holomekc/wiremock](https://github.com/holomekc/wiremock) with embedded UI. |
3 | 7 |
|
4 | 8 | # Quick Start
|
| 9 | + |
5 | 10 | ## Pre-requisites
|
6 |
| -1. [Install minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) |
| 11 | + |
| 12 | +1. [Install Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) |
7 | 13 | 2. [Install helm](https://helm.sh/docs/intro/install/)
|
8 |
| -3. Deploy Wiremock |
9 |
| - ```bash |
10 |
| - helm upgrade --install wiremock ./charts/wiremock |
11 |
| - ``` |
12 |
| -4. Verify Wiremock deployment |
13 |
| - ```bash |
14 |
| - $ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "wiremock.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") |
15 |
| -
|
16 |
| - $ kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort}} |
17 |
| - ``` |
18 |
| - Visit http://127.0.0.1:8080/__admin/webapp on your browser. |
19 |
| -5. Verifying a response using Wiremock, run |
20 |
| - ``` |
21 |
| - $ curl -X POST http://127.0.0.1:8080/v1/hello |
22 |
| - ``` |
23 | 14 |
|
| 15 | +## Deploy WireMock |
| 16 | + |
| 17 | +Install WireMock using the Helm chart |
| 18 | + |
| 19 | +```bash |
| 20 | +helm upgrade --install wiremock ./charts/wiremock |
| 21 | +``` |
| 22 | + |
| 23 | +Setup port forwarding |
| 24 | + |
| 25 | +```bash |
| 26 | +$ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "wiremock.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") |
| 27 | + |
| 28 | +$ kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort}} |
| 29 | +``` |
| 30 | + |
| 31 | +## Verify Wiremock deployment |
| 32 | + |
| 33 | +To verify erifying a response using Wiremock, run |
| 34 | + |
| 35 | +```bash |
| 36 | +$ curl -X POST http://127.0.0.1:8080/v1/hello |
| 37 | +``` |
| 38 | + |
| 39 | +To check the web app when using `holomekc/wiremock`, visit http://127.0.0.1:8080/__admin/webapp on your browser. |
| 40 | + |
24 | 41 | # References:
|
25 |
| -* https://github.com/holomekc/wiremock |
26 |
| -* https://github.com/tomakehurst/wiremock |
| 42 | + |
| 43 | +- [WireMock Java Library](https://github.com/tomakehurst/wiremock) |
| 44 | +- [Official WireMock Docker Image](https://github.com/wiremock/wiremock-docker) |
| 45 | +- [WireMock extended with Web UI](https://github.com/holomekc/wiremock), a project by [(@holomekc]https://github.com/holomekc) |
0 commit comments