Closed linuxbsdfreak closed 5 years ago
For reference see https://kubernetes.io/docs/concepts/services-networking/network-policies/.
I had a look into the versioning of the NetworkPolicy
created by Karydia.
We use the package k8s.io/api/networking/v1
provided by Kubernetes, which creates the NetworkPolicy
. I could not find an error in our implementation.
However, when observing the bug on a Cluster created by Gardener I noticed that on different versions the NetworkPolicy
has different apiVersions
. Using a cluster with version 1.15.4
it yields VERSION: extensions/v1beta1
and a cluster with version 1.16.1
yields VERSION: networking.k8s.io/v1
. That is why I believe that the implementation is correct and with a version upgrade of the cluster the NetworkPolicy
will be created with the correct apiVersion
(probably).
Keep in mind that Helm has currently a bug that does not allow it to be used with version 1.16
(see https://github.com/karydia/karydia/issues/223) and that is why I could not test it entirely.
I will close this issue for now and will re-evaluate my findings when the bug in Helm is fixed (probably within the next 2 weeks).
To reproduce my tests do the following:
1.15.4
kubectl explain NetworkPolicy
:
KIND: NetworkPolicy
VERSION: extensions/v1beta1
DESCRIPTION: DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods
FIELDS:
apiVersion
kind
metadata
spec
3. Create a cluster with version `1.16.1`
4. Run `kubectl explain NetworkPolicy`:
KIND: NetworkPolicy VERSION: networking.k8s.io/v1
DESCRIPTION: NetworkPolicy describes what network traffic is allowed for a set of Pods
FIELDS:
apiVersion
kind
metadata
spec
Description
The default network policy installed by Karydia has the following yaml
Please change the apiVersion to the one given below.
Environment
kubectl version
):cat /etc/os-release
ORsw_vers
):uname -a
):