Skip to content

Instantly share code, notes, and snippets.

@anfernee
Last active March 4, 2021 01:39
Show Gist options
  • Save anfernee/5f83f55ca4ae4936e7507a0402fe090c to your computer and use it in GitHub Desktop.
Save anfernee/5f83f55ca4ae4936e7507a0402fe090c to your computer and use it in GitHub Desktop.

Original proposal:

kind: EgressRoute
metadata:
  name: egress
spec:
  egress:
  - namespaceSelector:
      matchLabels:
        user: alice
    podLabelSelector:
      matchLabels:
        role: frontend
  - namespaceSelector:
      matchLabels:
        user: paul
    podLabelSelector:
      matchLabels:
        role: frontend
  destinations:
  - 8.8.8.0/24
  egressSourceIP: 192.168.1.100

Amended proposal:

kind: EgressRoute
metadata:
  name: egress
spec:
  egress:
  - namespaceSelector:
      matchLabels:
        user: alice
  - namespace: default
    podLabelSelector:
      matchLabels:
        role: frontend
  destinations:
  - 8.8.8.0/24
  egressSourceIP: 192.168.1.100
kind: NetworkPolicy
metadata:
  name: egress
  namespace: default
spec:
  egress:
  - namespaceSelector:
      matchLabels:
        user: alice
  - podLabelSelector:
      matchLabels:
        role: frontend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment