Bug 1849322

Summary: Recreating recently deleted NodePort service results in 'port is already allocated' error
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: kube-apiserverAssignee: Stefan Schimanski <sttts>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: low    
Version: 4.6CC: aos-bugs, kewang, mfojtik, mrobson, sttts, xxia
Target Milestone: ---Keywords: Reopened, UpcomingSprint
Target Release: 4.4.z   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-22 06:58:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1849321    
Bug Blocks: 1849323    

Comment 2 Michal Fojtik 2020-08-24 13:10:52 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

Comment 3 Michal Fojtik 2020-08-31 13:59:41 UTC
This bug hasn't had any activity 7 days after it was marked as LifecycleStale, so we are closing this bug as WONTFIX. If you consider this bug still valuable, please reopen it or create new bug.

Comment 4 Michal Fojtik 2020-08-31 15:00:29 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 5 Stefan Schimanski 2020-09-11 15:27:33 UTC
PR is up, has to get green in CI. Adding UpcomingSprint while watching.

Comment 7 Ke Wang 2020-09-14 08:57:30 UTC
Verification steps see below,

oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.4.0-0.nightly-2020-09-13-231918   True        False         79m     Cluster version is 4.4.0-0.nightly-2020-09-13-231918

$ cat 1849322-nodeport.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: nodeport-admin
  name: nodeport-test
spec:
  type: NodePort
  externalTrafficPolicy: Cluster
  ports:
  - name: 8080-tcp
    port: 8080
    protocol: TCP
    nodePort: 30006
  selector:
    deploymentconfig: nodeport-app

$ cat 1849322-test.sh
#!/usr/bin/env bash
date
oc delete svc nodeport-test
#while [ -n "$(oc create -f nodeport.yml 2>&1 > /dev/null)" ]; do
while ! oc create -f 1848379-nodeport.yaml; do
  date
done

$ oc apply -f 1849322-nodeport.yaml

Run 100 times,
$ for i in {1..100}; do echo "test $i ..." >> test.log;./1849322-test.sh >> test.log;done

$ grep -i invalid test.log
Nothing found.

We got the expected results, move the bug verified.

Comment 10 errata-xmlrpc 2020-09-22 06:58:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.4.23 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3715