-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6484b7d
commit 7a419e3
Showing
8 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.8-slim-buster | ||
|
||
WORKDIR /app | ||
COPY requirements.txt requirements.txt | ||
RUN pip3 install -r requirements.txt | ||
RUN apt-get update | ||
RUN apt-get -y install curl procps | ||
COPY example.py . | ||
COPY run.sh . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build . -t mertyildiran/mizutest-websocket-client:latest && docker push mertyildiran/mizutest-websocket-client:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import websocket | ||
import time | ||
|
||
while True: | ||
ws = websocket.WebSocket() | ||
ws.connect("ws://echo.websocket.events") | ||
ws.send("Hello, Server") | ||
|
||
print(ws.recv()) | ||
|
||
ws.close() | ||
|
||
time.sleep(3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Faker>=4.18.0 | ||
pika>=1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
python3 example.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
deploy/kubernetes/manifests/extras/54-mizutest-websocket-client-dep.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: mizutest-websocket-client | ||
labels: | ||
name: mizutest-websocket-client | ||
namespace: sock-shop | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: mizutest-websocket-client | ||
template: | ||
metadata: | ||
labels: | ||
name: mizutest-websocket-client | ||
spec: | ||
containers: | ||
- name: mizutest-websocket-client | ||
image: mertyildiran/mizutest-websocket-client:latest | ||
env: | ||
- name: PYTHONUNBUFFERED | ||
value: "1" | ||
- name: PYTHONIOENCODING | ||
value: "UTF-8" | ||
imagePullPolicy: Always | ||
command: ["sh", "-c", "./run.sh > /dev/null 2>&1"] | ||
resources: | ||
limits: | ||
cpu: 50m | ||
memory: 200Mi | ||
requests: | ||
cpu: 10m | ||
memory: 10Mi | ||
ports: | ||
- containerPort: 5672 | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 10001 | ||
capabilities: | ||
drop: | ||
- all | ||
add: | ||
- NET_BIND_SERVICE | ||
readOnlyRootFilesystem: true | ||
nodeSelector: | ||
beta.kubernetes.io/os: linux |
13 changes: 13 additions & 0 deletions
13
deploy/kubernetes/manifests/extras/55-mizutest-websocket-client-svc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mizutest-websocket-client | ||
annotations: | ||
prometheus.io/scrape: 'true' | ||
labels: | ||
name: mizutest-websocket-client | ||
namespace: sock-shop | ||
spec: | ||
selector: | ||
name: mizutest-websocket-client |