# How to apply Calico GlobalNetworkPolicy

**URL:** <https://forums.suse.com/t/how-to-apply-calico-globalnetworkpolicy/14133>\
**Category:** General\
**Created:** [May 1, 2019, 12:30pm UTC](https://forums.suse.com/t/how-to-apply-calico-globalnetworkpolicy/14133 "2019-05-01T12:30:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugen-eugen](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/eugen-eugen/32/4621_2.png) [@eugen-eugen](https://forums.suse.com/u/eugen-eugen)\
**Post date:** [May 1, 2019, 12:30pm UTC](https://forums.suse.com/t/how-to-apply-calico-globalnetworkpolicy/14133/1 "2019-05-01T12:30:10Z")

</div>

Dear Experts,

I have Rancher managing a Kubernetes cluster. The cluster has Calico CNI. Now I want to use Calico GlobalNetworkPolicy. How ca I apply it. The common approach with kubectl create … doesn’t work:

```
kubectl create -f - <<EOT
apiVersion: projectcalico.org/v3
kind: GlobalNetworkPolicy
metadata:
  name: Deny-Egress
spec:
  selector: noegress == 'y'
  types:
  - Egress
  egress:
  - action: Deny
EOT

```

ends up with this error:

`error: unable to recognize "STDIN": no matches for kind "GlobalNetworkPolicy" in version "projectcalico.org/v3"`

Do you have any idea, how I can apply this policy?  
Thank You very much.

---

<div class="post-metadata">

**Author:** ![eugen-eugen](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/eugen-eugen/32/4621_2.png) [@eugen-eugen](https://forums.suse.com/u/eugen-eugen)\
**Post date:** [May 1, 2019, 10:18pm UTC](https://forums.suse.com/t/how-to-apply-calico-globalnetworkpolicy/14133/2 "2019-05-01T22:18:07Z")

</div>

I could solve this Problem on my own: for applying calico policies the utiliti **calicoctl** can be used.
