Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network policy template #62

Merged
merged 18 commits into from
Oct 21, 2023
Merged

Network policy template #62

merged 18 commits into from
Oct 21, 2023

Conversation

clux
Copy link
Member

@clux clux commented Oct 20, 2023

Hardest part of this was actually the apiserver access egress...

I started out with:

    - namespaceSelector:
        matchLabels:
          name: default

which works in many places, but not all, so now we have this complicated endpoint query, that's fed into helm:

          apiserver="$(kubectl get endpoints kubernetes -ojson | jq '.subsets[0].addresses[0].ip' -r)"
          helm template charts/doc-controller \
            --set version=latest \
            --set networkPolicy.enabled=true \
            --set networkPolicy.apiserver.0=${apiserver}/32

which is fine, but we don't want first-comers to have to deal with all of that garbage so in values.yaml there's a wide-open egress default for where the endpoint is:

networkPolicy:
  apiserver:
  - "0.0.0.0/0" # extremely wide-open egress on ports 443 + 6443

hopefully, that is a decent enough starting point that doesn't discourage networkpolicies, but also doesn't front-load all the mysticism..

@clux clux marked this pull request as ready for review October 20, 2023 22:34
@clux clux merged commit b863bbd into main Oct 21, 2023
7 checks passed
@clux clux deleted the netpol branch October 21, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant