Skip to content

Instantly share code, notes, and snippets.

@aojea
Last active January 22, 2024 07:43
Show Gist options
  • Select an option

  • Save aojea/461dd0da7c36b4210737301620ab1a11 to your computer and use it in GitHub Desktop.

Select an option

Save aojea/461dd0da7c36b4210737301620ab1a11 to your computer and use it in GitHub Desktop.
Test UDP and TCP service
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-deployment
labels:
app: MyApp
spec:
replicas: 2
selector:
matchLabels:
app: MyApp
template:
metadata:
labels:
app: MyApp
spec:
containers:
- name: agnhost
image: k8s.gcr.io/e2e-test-images/agnhost:2.21
args:
- netexec
- --http-port=80
- --udp-port=80
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nodeport-service
spec:
type: NodePort
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment