Hey folks, my namespace has all ingress/egress con...
# k3s
l
Hey folks, my namespace has all ingress/egress controlled via network policies. However, I'm having some trouble adding a network policy that allows for egress to the API server. This doesn't work:
Copy code
egress:
    - to:
      - ipBlock:
          cidr: fda5:1234:5::1/128 # kubernetes svc is listening on fda5:1234:5::1
      ports:
      - protocol: TCP
        port: 443
Am I missing something?
Given that this service isn't backed by a pod, this actually won't work at all, will it. Huh, is this impossible?
Yeah, not even
- namespaceSelector: {}
works. Hmm...
It works if I add my server IP and port 6443. That's... not great
c
Yeah that's not a normal service. I don't think you can target it with netpol
l
What is the typical approach for doing this, then?