Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wasim-nihal/mock-http-server
Browse files Browse the repository at this point in the history
  • Loading branch information
wasim-nihal committed Mar 28, 2024
2 parents 1fb76e8 + a2adee0 commit 7fbf4a6
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ jobs:
docker build . -t nihalwasim/mock-http-server:latest
- name: Publish
run: |
docker login -u nihalwasim -p ${{ secrets.DOCKER_HUB }}
docker push nihalwasim/mock-http-server:latest
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,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 7fbf4a6

Please sign in to comment.