Skip to content

Commit

Permalink
curvenote: remove networkpolicy hacks
Browse files Browse the repository at this point in the history
Switched to using Calico for network policies, which should be a full implementation instead of the partial implementation in the AWS VPC-CNI
  • Loading branch information
manics committed Nov 19, 2023
1 parent ea6b1e6 commit 4e08f30
Showing 1 changed file with 17 additions and 52 deletions.
69 changes: 17 additions & 52 deletions config/curvenote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,65 +171,30 @@ binderhub:
image_pull_policy: Always
extraPodSpec:
priorityClassName: binderhub-core
networkPolicy:
ingress:
# AWS VPC CNI only works if the name of the service port name is the same as
# the name of the pod port and the port number is the same
# https://docs.aws.amazon.com/eks/latest/userguide/cni-network-policy.html#cni-network-policy-considerations
- from:
- podSelector:
matchLabels:
hub.jupyter.org/network-access-hub: "true"
# For unknown reasons the hub <-> notebook traffic is partially blocked if
# this is included:
# ports:
# # service/hub port name is "hub"
# # pod/hub port name is "http"
# - port: 8081
# protocol: TCP

singleuser:
networkPolicy:
ingress:
# AWS VPC CNI only works if the name of the service port name is the same as
# the name of the pod port and the port number is the same
# https://docs.aws.amazon.com/eks/latest/userguide/cni-network-policy.html#cni-network-policy-considerations
- from:
- podSelector:
matchLabels:
hub.jupyter.org/network-access-singleuser: "true"
ports:
# proxy/pod port name is "notebook-port"
# I've no idea why that doesn't work
- port: 8888
protocol: TCP
initContainers:
- name: tc-init
image: jupyterhub/mybinder.org-tc-init:2020.12.4-0.dev.git.4289.h140cef52
imagePullPolicy: IfNotPresent
env:
- name: WHITELIST_CIDR
value: 10.0.0.0/8
- name: EGRESS_BANDWIDTH
value: 1mbit
securityContext:
# capabilities.add seems to be disabled
# by the `runAsUser: 1000` in the pod-level securityContext
# unless we explicitly run as root
runAsUser: 0
capabilities:
add:
- NET_ADMIN

proxy:
chp:
extraPodSpec:
priorityClassName: binderhub-core
networkPolicy:
ingress:
# AWS VPC CNI only works if the name of the service port name is the same as
# the name of the pod port and the port number is the same
# https://docs.aws.amazon.com/eks/latest/userguide/cni-network-policy.html#cni-network-policy-considerations
- from:
- podSelector:
matchLabels:
hub.jupyter.org/network-access-proxy-api: "true"
ports:
# service/proxy-api port doesn't have a name
# proxy/pod port name is "api"
- port: 8001
protocol: TCP
- from:
ports:
# service/proxy-public port is 80
# proxy/pod port is 8000
- port: 8000
protocol: TCP
- port: 80
protocol: TCP

ingress:
hosts:
Expand Down

0 comments on commit 4e08f30

Please sign in to comment.