Created
August 18, 2020 21:52
-
-
Save weinong/0380c0bf1819e2fb87ec24e6ef6213b1 to your computer and use it in GitHub Desktop.
simple udp on k8s
This file contains hidden or 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
| FROM alpine | |
| RUN apk add --no-cache netcat-openbsd | |
| ENTRYPOINT [ "nc" ] |
This file contains hidden or 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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: netcat | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: netcat | |
| template: | |
| metadata: | |
| labels: | |
| app: netcat | |
| spec: | |
| containers: | |
| - name: netcat | |
| image: weinong/netcat:latest | |
| imagePullPolicy: Always | |
| args: | |
| - "-lkuv" | |
| - "9000" | |
| ports: | |
| - name: nc | |
| containerPort: 9000 | |
| protocol: UDP | |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: netcat-lb | |
| name: netcat-lb | |
| namespace: default | |
| spec: | |
| ports: | |
| - name: nc | |
| port: 9000 | |
| protocol: UDP | |
| targetPort: 9000 | |
| sessionAffinity: None | |
| selector: | |
| app: netcat | |
| type: LoadBalancer | |
| status: | |
| loadBalancer: {} |
This file contains hidden or 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
| for i in {1..100}; do echo $i | nc -uvc 52.161.184.63 9000; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment