Skip to content

Instantly share code, notes, and snippets.

@shosti
Created October 24, 2023 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shosti/e0302667b7afe7634e0c901301e569f7 to your computer and use it in GitHub Desktop.
Save shosti/e0302667b7afe7634e0c901301e569f7 to your computer and use it in GitHub Desktop.
Cilium repro
---
apiVersion: v1
kind: Namespace
metadata:
name: ciltestout
---
apiVersion: v1
kind: Namespace
metadata:
name: ciltestin
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: server
name: server
namespace: ciltestin
spec:
replicas: 1
selector:
matchLabels:
app: server
template:
metadata:
labels:
app: server
spec:
containers:
- image: nginx
name: nginx
---
apiVersion: v1
kind: Service
metadata:
labels:
app: server
name: server
namespace: ciltestin
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: server
---
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: egress
namespace: ciltestout
spec:
endpointSelector:
matchLabels:
app: client
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
rules:
dns:
- matchPattern: "*"
- toEndpoints:
- matchLabels:
app: server
matchExpressions:
- key: k8s:io.kubernetes.pod.namespace
operator: In
values:
- ciltestin
---
apiVersion: v1
kind: Pod
metadata:
name: client
namespace: ciltestout
labels:
app: client
spec:
containers:
- name: client
image: curlimages/curl
command: [sleep, infinity]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment