Skip to content

invalid ipBlock section in example network policy #51402

Open
@imschuler

Description

@imschuler

This is a Bug Report

Problem:
In the example network policy :

service/networking/networkpolicy.yaml

on

https://kubernetes.io/docs/concepts/services-networking/network-policies/

there is an invalid ipBlock

ingress:
  - from:
    - ipBlock:
        cidr: 172.17.0.0/16
        except:
        - 172.17.1.0/24
    - namespaceSelector:
        matchLabels:
          project: myproject
    - podSelector:
        matchLabels:
          role: frontend

If you run the command

kubectl explain netpol.spec.ingress.from

you can read

ipBlock
ipBlock defines policy on a particular IPBlock. If this field is set then
neither of the other fields can be.

Proposed Solution:

remove the ipBlock from the exampple

Page to Update:
https://kubernetes.io/docs/concepts/services-networking/network-policies/

Strange enough no error message is generated when applying the network policy using kubectl .

ipBlock is simply ignored .

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions