-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
None
This one is a regression found against the OCP 4.3.0 nightly (not yet released - the issue doesn't exists in a public OCP relaease yet)
Tracked in upstream by https://bugzilla.redhat.com/show_bug.cgi?id=1772879
Description of problem:
service.kubernetes.io/load-balancer-cleanup finalizer is not removed from loadbalancer service upon CR removal if sessionAffinity: ClientIP.
Regression against previous releases
- crc version: 1.1.0+95966a9; OpenShift version: 4.2.2 (embedded in binary)
- OCP 4.1.20
Version-Release number of selected component (if applicable):
4.3.0-0.nightly-2019-11-11-115927 (https://projects.engineering.redhat.com/browse/LPINTEROP-680)
How reproducible:
Always
Steps to Reproduce:
Log in to OCP cluster as a user with ! cluster-admin permission !
1. Install the Wildfly operator
git clone git@github.com:wildfly/wildfly-operator.git
cd wildfly-operator
oc apply -f deploy/service_account.yaml
oc apply -f deploy/role.yaml
oc apply -f deploy/role_binding.yaml
oc apply -f deploy/crds/wildfly_v1alpha1_wildflyserver_crd.yaml
oc apply -f deploy/operator.yaml
# Make sure that the operator pod is up and running
$ oc get pods -w
NAME READY STATUS
wildfly-operator-7f555b86d5-2947c 1/1 Running
2. Create WildFlyServer CR - https://github.com/wildfly/wildfly-operator/blob/master/doc/apis.adoc
cat << EOF > wildfly-operator.yaml apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: name: wildfly spec: applicationImage: "quay.io/wildfly/wildfly-centos7:18.0" replicas: 1 sessionAffinity: true EOF oc apply -f wildfly-operator.yaml # Wait until the wildfly pod is up & running $ oc get pods/wildfly-0 -w NAME READY STATUS wildfly-0 1/1 Running
3. Delete the CR object
$ oc delete wildflyserver wildfly
wildflyserver.wildfly.org "wildfly" deleted
Actual results:
Service is still there after the CR deletion, and oc delete stuck due to a finalizer - cannot be removed without manual edit (remove the finalizer field)
Expected results:
$ oc get service No resources found.
Additional info:
Probably related to https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#garbage-collecting-load-balancers
In case that sessionAffinity: None, the finalizer is removed and service is deleted with the CR removal.
sessionAffinity: true
$ oc get service wildfly-loadbalancer -o yaml metadata: ... finalizers: - service.kubernetes.io/load-balancer-cleanup ... spec: clusterIP: 172.30.211.55 externalTrafficPolicy: Cluster ports: - name: http nodePort: 31746 port: 8080 protocol: TCP targetPort: 8080 selector: app.kubernetes.io/managed-by: wildfly-operator app.kubernetes.io/name: wildfly app.openshift.io/runtime: wildfly wildfly.org/operated-by-loadbalancer: active sessionAffinity: ClientIP sessionAffinityConfig: clientIP: timeoutSeconds: 10800 type: LoadBalancer
sessionAffinity: false
$ oc get service wildfly-loadbalancer -o yaml metadata: ... finalizers: - service.kubernetes.io/load-balancer-cleanup ... spec: clusterIP: 172.30.197.110 externalTrafficPolicy: Cluster ports: - name: http nodePort: 32128 port: 8080 protocol: TCP targetPort: 8080 selector: app.kubernetes.io/managed-by: wildfly-operator app.kubernetes.io/name: wildfly app.openshift.io/runtime: wildfly wildfly.org/operated-by-loadbalancer: active sessionAffinity: None type: LoadBalancer