Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-34757

[4.12] Ingress Operator is needlessly reverting default values in Internal Services

XMLWordPrintable

    • Moderate
    • No
    • 3
    • Sprint 254
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      * Previously, the Ingress Operator was leaving the "spec.internalTrafficPolicy", "spec.ipFamilies", and "spec.ipFamilyPolicy" fields unspecified for `NodePort` and `ClusterIP` type services. The API would then set default values for these fields, which the Ingress Operator would try to revert. With this update, the Ingress Operator specifies an initial value and fixes the error caused by API default values. (link:https://issues.redhat.com/browse/OCPBUGS-34757[*OCPBUGS-34757*]) Backport to 4.12.
      Show
      * Previously, the Ingress Operator was leaving the "spec.internalTrafficPolicy", "spec.ipFamilies", and "spec.ipFamilyPolicy" fields unspecified for `NodePort` and `ClusterIP` type services. The API would then set default values for these fields, which the Ingress Operator would try to revert. With this update, the Ingress Operator specifies an initial value and fixes the error caused by API default values. (link: https://issues.redhat.com/browse/OCPBUGS-34757 [* OCPBUGS-34757 *]) Backport to 4.12.
    • Bug Fix
    • In Progress

      === Backport of OCPBUGS-33990

      Description of problem:

      Ingress operator is constantly reverting Internal Services when it detects a service change that are default values.

      Version-Release number of selected component (if applicable):

      4.13, 4.14

      How reproducible:

      100%

      Steps to Reproduce:

      1. Create an ingress controller
      2. Watch ingress operator logs for excess updates "updated internal service"
      [I'll provide a more specific reproducer if needed]

      Actual results:

      Excess:
      2023-05-04T02:08:02.331Z INFO operator.ingress_controller ingress/internal_service.go:44 updated internal service ...

      Expected results:

      No updates

      Additional info:

      The diff looks like:
      2023-05-05T15:12:06.668Z    INFO    operator.ingress_controller    ingress/internal_service.go:44    updated internal service    {"namespace": "openshift-ingress", "name": "router-internal-default", "diff": "  &v1.Service{
          TypeMeta:   {},
          ObjectMeta: {Name: \"router-internal-default\", Namespace: \"openshift-ingress\", UID: \"815f1499-a4d4-4cb8-9a5b-9905580e0ffd\", ResourceVersion: \"8031\", ...},
          Spec: v1.ServiceSpec{
            Ports:                    {{Name: \"http\", Protocol: \"TCP\", Port: 80, TargetPort: {Type: 1, StrVal: \"http\"}, ...}, {Name: \"https\", Protocol: \"TCP\", Port: 443, TargetPort: {Type: 1, StrVal: \"https\"}, ...}, {Name: \"metrics\", Protocol: \"TCP\", Port: 1936, TargetPort: {Type: 1, StrVal: \"metrics\"}, ...}},
            Selector:                 {\"ingresscontroller.operator.openshift.io/deployment-ingresscontroller\": \"default\"},
            ClusterIP:                \"172.30.56.107\",
      -     ClusterIPs:               []string{\"172.30.56.107\"},
      +     ClusterIPs:               nil,
            Type:                     \"ClusterIP\",
            ExternalIPs:              nil,
      -     SessionAffinity:          \"None\",
      +     SessionAffinity:          \"\",
            LoadBalancerIP:           \"\",
            LoadBalancerSourceRanges: nil,
            ... // 3 identical fields
            PublishNotReadyAddresses:      false,
            SessionAffinityConfig:         nil,
      -     IPFamilies:                    []v1.IPFamily{\"IPv4\"},
      +     IPFamilies:                    nil,
      -     IPFamilyPolicy:                &\"SingleStack\",
      +     IPFamilyPolicy:                nil,
            AllocateLoadBalancerNodePorts: nil,
            LoadBalancerClass:             nil,
      -     InternalTrafficPolicy:         &\"Cluster\",
      +     InternalTrafficPolicy:         nil,
          },
          Status: {},
        }
      "}
      

      Messing around with unit testing, it looks like internalServiceChanged triggers true when spec.IPFamilies, spec.IPFamilyPolicy, and spec.InternalTrafficPolicy are set to the default values that you see in the diff above.

      Ingress operator then resets back to nil, then the API server sets them to their defaults, and this process repeats.

      internalServiceChanged should either ignore, or explicitly set these values.

            cholman@redhat.com Candace Holman
            gspence@redhat.com Grant Spence
            Melvin Joseph Melvin Joseph
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: