Created
April 28, 2025 03:43
-
-
Save muhammad-asn/0a239b2a9c8b9d52d5e96c43939075ee to your computer and use it in GitHub Desktop.
Test UDP and TCP Connection in Kubernetes
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
## TCP Connection | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-service | |
namespace: monitoring | |
spec: | |
type: ClusterIP | |
selector: | |
app: nginx | |
ports: | |
- port: 8125 | |
targetPort: 80 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
labels: | |
app: nginx | |
namespace: monitoring | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: | |
labels: | |
app: nginx | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:latest | |
ports: | |
- containerPort: 80 |
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
## UDP Connection | |
# Reference: https://hub.docker.com/r/cilium/echoserver-udp | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: echoserver-udp-service | |
namespace: monitoring | |
spec: | |
type: ClusterIP | |
selector: | |
app: echoserver-udp | |
ports: | |
- port: 8125 | |
targetPort: 8125 | |
protocol: UDP | |
name: echoserver-udp | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: echoserver-udp | |
namespace: monitoring | |
labels: | |
app: echoserver-udp | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: echoserver-udp | |
template: | |
metadata: | |
labels: | |
app: echoserver-udp | |
spec: | |
containers: | |
- name: echoserver-udp | |
image: quay.io/cilium/echoserver-udp | |
command: ["echoserver-tftp"] | |
args: ["-listen", ":8125"] | |
ports: | |
- containerPort: 8125 | |
protocol: UDP | |
name: echoserver-udp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment