Skip to content

[NPM] issue with using same string for namedPort and labelKey #733

@vakalapa

Description

@vakalapa

What happened:

In some cluster, customer are seeing this below errors in azure-npm.log

Stderr: [exit status 1, ipset v6.34: Syntax error: Elem separator in <IP_ADDR>,<PORT_NUM>, but settype hash:net supports none.]

This error occurs when 2 different k8s objs for which NPM creates Ipsets are named the same. One such example is illustrated below. Here both the port is named as "http" and the label's key is "http". This results in NPM creating the same ipset name.

apiVersion: v1
kind: Pod
metadata:
  name: hello
  labels:
    http: redis
spec:
      containers:
      - name: hello
        image: busybox
        command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 3600']
        ports:
        - containerPort: 80
          name: http
      restartPolicy: OnFailure

What you expected to happen:
Expected behavior is two different ipsets being created without issues.

How to reproduce it:

  1. Add any network policy
  2. Apply above yaml and monitor NPM log.

Kubernetes Version:
all

Kernel (e.g. uname -a):
Ubuntu 18.04
Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions