Skip to content

Instantly share code, notes, and snippets.

@diversario
Created March 2, 2020 11:43
Show Gist options
  • Save diversario/fd276abee55b8fbb7f39c9cd983adfba to your computer and use it in GitHub Desktop.
Save diversario/fd276abee55b8fbb7f39c9cd983adfba to your computer and use it in GitHub Desktop.
cilium-repro.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: host-network
labels:
name: host-network
---
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: toolbox
name: toolbox-host-network
namespace: host-network
spec:
containers:
- image: diversario/toolbox
command:
- cat
name: toolbox
stdin: true
tty: true
dnsPolicy: ClusterFirst
restartPolicy: Always
hostNetwork: true
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-cluster-network
namespace: host-network
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
name: cluster-network
---
apiVersion: v1
kind: Namespace
metadata:
name: cluster-network
labels:
name: cluster-network
---
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: toolbox
name: toolbox-cluster-network
namespace: cluster-network
spec:
containers:
- image: diversario/toolbox
command:
- cat
name: toolbox
stdin: true
tty: true
dnsPolicy: ClusterFirst
restartPolicy: Always
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-host-network
namespace: cluster-network
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
name: host-network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment