28 Commits
Author SHA1 Message Date
Raj Chaudhuri c1d3107418 Changed module name, edited default manifests in prog/weave-kube
* Module name changed to `github.com/rajch/weave`
* Added environment variable `CHECKPOINT_DISABLE=1` to default manifests, to bypass weaveworks telemetry
2024-03-01 18:05:19 +05:30
Kitt Hsu a547d4571c Fix the source of iptable rules generated for Ingress NetworkPolicy when both port and IP block specified 2019-06-28 15:02:22 +08:00
Murali Reddy 75e106b667 using an explicti selector set for network policies with both namespace and pod lable selectors 2019-05-30 12:03:28 +05:30
Murali Reddy bb4f51499d add support for combination of podSelector and namespaceSelector
in network policies

- enhance selectorSpec to accomodate both pod and namespace selectors
- enhance analysePolicy to handle policies with both selectors

Fixes #3312
2019-05-28 12:40:39 +05:30
Martynas Pumputis f68579654b Merge pull request #3375 from weaveworks/issue-3302
Fix weave-npc crash when named ports specified in the named ports
2018-08-17 14:20:41 +02:00
Murali Reddy a19d025677 addressing review comment 2018-08-14 20:16:04 +05:30
Murali Reddy 6625e29071 addressing review comments 2018-08-10 19:36:18 +05:30
Murali Reddy d5e864736b weave-npc doesn't handle named ports
Support for names ports in enhancement, but with this PR just adding more graceful failure.

Fixes #3032
2018-08-10 18:37:08 +05:30
Martynas Pumputis c742ec4993 npc: Enable ipBlock for Ingress policy
When using ipBlock in Ingress policy, one should be aware
that source IP addr of packet destined to Pod in many cases
is mangled, see docs/k8s-src-ip.md for the cases.

However, the mangling in some cases can be prevented with
setting externalTrafficPolicy to Local.
2018-08-03 13:21:45 +02:00
Martynas Pumputis 1649080a35 npc: Add ns name into ipBlock ipset name
Otherwise, the same ipBlock ipset can be used among different namespaces which
results in panic as refcounting of ipsets happens only per namespace, so
npc will try to create the same ipset twice.
2018-07-24 10:06:55 +02:00
Martynas Pumputis 2c708b57a1 npc: Improve analyser comments 2018-07-24 10:06:55 +02:00
Martynas Pumputis 07d31a8558 npc: Get rid of the legacy netpol 2018-07-24 10:06:55 +02:00
Martynas Pumputis 49224ec9f7 npc: Rename policy{Ingress,Egress} to policyType{Ingress,Egress} 2018-07-24 10:06:23 +02:00
Martynas Pumputis a5e0b3452d npc: Create rules with IPBlock (egress only) 2018-07-24 10:06:23 +02:00
Martynas Pumputis affdc6f5af npc: Provision networkingv1.IPBlock (only for Egress) 2018-07-24 10:06:23 +02:00
Martynas Pumputis 8904a4b144 npc: Get rid of selectorSpec.target
We treat selectorSpec as a target selector if len(selectorSpec.policyTypes) > 0.
2018-07-24 10:06:23 +02:00
Martynas Pumputis 8d1ee752d4 npc: Rename dstSelector to targetSelector
dstSelector becomes ambiguous once we introduce the egress.

So, from now on, we call selector a target selector if it selects
pods to which a netpol applies (aka NetworkPolicySpec.podSelector).
2018-07-24 10:06:23 +02:00
Martynas Pumputis f02a11b27b npc: Analyse egress policy
This is a copy-paste from the ingress part with small modifications.
2018-07-24 10:06:23 +02:00
Martynas Pumputis 497a9c7fd0 npc: Replace rulesType by policyType 2018-07-24 10:06:23 +02:00
Martynas Pumputis 5afcd0595d npc: Parse PolicyTypes field when analysing a netpol 2018-07-24 10:06:23 +02:00
Martynas Pumputis d474c1c26d npc: Add policyType to selectorSpec
This allows us to distinguish between ingress and egress
dst selectors (required when managing entries in default-allow
ipsets).
2018-07-24 10:06:23 +02:00
Martynas Pumputis cabc05b06c npc: Add rule type (ingress, egress) 2018-07-24 10:06:23 +02:00
Martynas Pumputis 27c98070e8 Move npc/ipset package to net/ipset
It's going to be used by net/bridge.go.
2018-06-04 14:08:24 +02:00
Martynas Pumputis 08858c2a10 npc: Fix bug when dstSelector is overwritten by srcSelector
There was a bug in the npc analyser when adding a netpol with
dstSelector == srcSelector. The analyser was overwriting
dstSelector with srcSelector which resulted in Pod selected
by dstSelector not being removed from a corresponding
"default-allow" ipset.

This applies only to non-legacy netpols.
2018-02-04 13:23:38 +01:00
Martynas Pumputis f51347feac npc: Address PR comments
* Add comments about presence of `analysePolicyLegacy` and `analysePolicy`.
* Use non-legacy netpol in TestRegressionPolicyNamespaceOrdering3059.
2017-11-07 15:40:58 +02:00
Martynas Pumputis 7c39f96d08 npc: Implement networking.k8s.io/v1/NetworkPolicy semantics (k8s 1.7)
The main difference between new and legacy (pre-1.7) netpol semantics
are the following:

    * The DenyDefault ingress isolation annotation is obsoleted.
    * Traffic is allowed to a pod if there are no netpol selecting
      the pod.

See https://kubernetes.io/docs/api-reference/v1.6/#networkpolicyspec-v1beta1-extensions
vs https://kubernetes.io/docs/api-reference/v1.7/#networkpolicyspec-v1-networking
for more details.

weave-npc can operate either in the legacy or the new mode (default). To
use the legacy, pass "--use-legacy-netpol" arg when starting the npc.

In non-legacy mode we create for each Namespace a default-allow ipset
which stores IP addrs of such Pods which are not selected by any
NetworkPolicy.The ipsets are dst's in rules of the WEAVE-NPC-DEFAULT chain.
2017-10-22 19:37:18 +02:00
Ayodele Abejide 1ac543aba7 Upgrading client go and vendoring it's extra dependencies. 2017-10-10 16:48:35 +00:00
Adam Harrison 19088ba8bc Import from weave-npc repo 2016-11-02 11:28:59 +00:00