Mizar – Experimental, High Scale and High Performance Cloud Network https://mizar.readthedocs.io
GNU General Public License v2.0
112
stars
50
forks
source link
Convert Network Policy Rules into json format and pass it as a string through gRPC #464
Open
clu2xlu opened 3 years ago
Mizar and Arktos communicates through gRPC protocol. The desired Network policy gRPC message should be:
https://github.com/clu2xlu/arktos/blob/poc/pkg/controller/mizar/builtins.proto#L75-L79
However, in go, the network policy obj's Spec is not in String format. e.g. policy.Spec cannot be converted to string directly. https://github.com/clu2xlu/arktos/blob/poc/pkg/controller/mizar/util.go#L125
For this task, you will need to use NetworkPolicySpec, Ingress and Egress to convert network policy's spec into a json string
The desired spec json strong looks like this:
it's yaml is
NOTE: please use my branch for now:
For mizar: use branch poc https://github.com/clu2xlu/mizar/tree/poc
For arktos: use branch poc https://github.com/clu2xlu/arktos/tree/poc