Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wasim-nihal authored Mar 28, 2024
1 parent f61fa26 commit a2adee0
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,70 @@ endpoints:
- ...
```
## Running in k8s environment
```yaml
apiVersion: v1
kind: Pod
metadata:
name: mock-server-pod
labels:
app: mock-server
spec:
containers:
- name: mock-server-container
image: nihalwasim/mock-http-server:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
command: ["/mock-server"]
args:
- "--server.config=/etc/config/server.yaml"
volumeMounts:
- name: config-volume
mountPath: /etc/config
readOnly: true
volumes:
- name: config-volume
configMap:
name: my-configmap
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-configmap
data:
server.yaml: |
endpoints:
/hello:
- method: GET
content: text/plain
body: Hello, World! (GET)
status: 200
- method: POST
content: text/plain
body: Hello, World! (POST)
status: 200
/bye:
- method: GET
content: text/plain
body: Goodbye!
status: 400
---
apiVersion: v1
kind: Service
metadata:
name: mock-server-service
spec:
selector:
app: mock-server
ports:
- protocol: TCP
port: 8080
targetPort: 8080
```
## License
This project is licensed under the Apache-2.0 license License. See the [LICENSE](https://github.com/wasim-nihal/mock-http-server/blob/master/LICENSE) file for details.
Expand Down

0 comments on commit a2adee0

Please sign in to comment.