alfredo-milani opened a new issue, #2731:
URL: https://github.com/apache/apisix-ingress-controller/issues/2731

   ### Current Behavior
   
   Ingress currently does not translate the .spec.scheme field of the CRD 
BackendTrafficPolicy in the corresponding APISIX configuration, e.g.
   ```yaml
   "upstreams": [
       {
         "pass_host": "pass",
         "hash_on": "vars",
         "labels": {
           "managed-by": "apisix-ingress-controller"
         },
         "retries": 3,
         "id": "36416151",
         "type": "roundrobin",
         "name": "ingress-apisix_httproute_0",
         "nodes": [
           {
             "host": "10.244.1.4",
             "port": 80,
             "weight": 1
           }
         ],
         "timeout": {
           "read": 10,
           "send": 10,
           "connect": 5
         },
         "modifiedIndex": 1772924708682
       }
     ],
   ```
   
   ### Expected Behavior
   
   The field .spec.scheme field of the CRD BackendTrafficPolicy will configure 
the upstream inside the APISIX configuration, e.g.
   ```yaml
   "upstreams": [
       {
         "nodes": {},
         "labels": {
           "managed-by": "apisix-ingress-controller",
           "meta_weight": "100"
         },
         "scheme": "https",
         "retries": 1,
         "id": "c45548c4",
         "type": "roundrobin",
         "name": "ingress-apisix_httpbin_0",
         "timeout": {
           "read": 10,
           "send": 10,
           "connect": 5
         },
         "modifiedIndex": 1772925278070
       }
     ],
   ```
   
   ### Error Logs
   
   No errors, it fails silently.
   
   ### Steps to Reproduce
   
   1. Install Apache APISIX
   2. Create Gateway, GatewacyClass
   ```yaml
   apiVersion: gateway.networking.k8s.io/v1
   kind: GatewayClass
   metadata:
     name: apisix
   spec:
     controllerName: apisix.apache.org/apisix-ingress-controller
   ---
   apiVersion: gateway.networking.k8s.io/v1
   kind: Gateway
   metadata:
     name: apisix-gateway
   spec:
     gatewayClassName: apisix
     infrastructure:
       parametersRef:
         group: apisix.apache.org
         kind: GatewayProxy
         name: ingress-apisix-config
     listeners:
     - allowedRoutes:
           namespaces:
             from: All
       name: http
       port: 80
       protocol: HTTP
   ```
   3. Create HTTPRoute and BackendTrafficPolicy
   ```yaml
   apiVersion: apisix.apache.org/v1alpha1
   kind: BackendTrafficPolicy
   metadata:
     name: hbin
   spec:
     targetRefs:
       - group: ""
         kind: Service
         name: httpbin
     timeout:
       connect: 5s
       send: 10s
       read: 10s
     retries: 3
     loadbalancer:
       type: roundrobin
     scheme: https
   ---
   apiVersion: gateway.networking.k8s.io/v1
   kind: HTTPRoute
   metadata:
     name: httproute
   spec:
     parentRefs:
       - name: apisix-gateway
         namespace: ingress-apisix
         group: "gateway.networking.k8s.io"
         kind: "Gateway"
         sectionName: http
     rules:
       - matches:
           - path:
               type: PathPrefix
               value: /
         backendRefs:
           - name: httpbin
             port: 80
   ```
   
   This will result in the upstream configuration on APISIX with the missing 
field for the schema, e.g.
   
   ```yaml
   "upstreams": [
       {
         "pass_host": "pass",
         "hash_on": "vars",
         "labels": {
           "managed-by": "apisix-ingress-controller"
         },
         "retries": 3,
         "id": "36416151",
         "type": "roundrobin",
         "name": "ingress-apisix_httproute_0",
         "nodes": [
           {
             "host": "10.244.1.4",
             "port": 80,
             "weight": 1
           }
         ],
         "timeout": {
           "read": 10,
           "send": 10,
           "connect": 5
         },
         "modifiedIndex": 1772924708682
       }
     ],
   ```
   
   
   NOTE: Using the CRD ApisixRoute and ApisixUpstream the configuration is 
updated correctly, e.g.
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: httpbin
   spec:
     ingressClassName: apisix
     retries: 1
     timeout:
       connect: 5s
       send: 10s
       read: 10s
     loadbalancer:
       type: roundrobin
     scheme: https
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: httpbin
   spec:
     ingressClassName: apisix
     http:
       - name: httpbin-rule
         match:
           paths:
             - /*
         backends:
           - serviceName: httpbin
             servicePort: 80
         upstreams:
           - name: httpbin
             weight: 100
   ```
   
   will produce the following configuration:
   
   ```yaml
   "upstreams": [
       {
         "nodes": {},
         "labels": {
           "managed-by": "apisix-ingress-controller",
           "meta_weight": "100"
         },
         "scheme": "https",
         "retries": 1,
         "id": "c45548c4",
         "type": "roundrobin",
         "name": "ingress-apisix_httpbin_0",
         "timeout": {
           "read": 10,
           "send": 10,
           "connect": 5
         },
         "modifiedIndex": 1772925278070
       }
     ],
   ```
   
   ### Environment
   
   - APISIX Ingress controller version
     - helm chart: helm.sh/chart=ingress-controller-1.1.1
     - image: apache/apisix-ingress-controller:2.0.1
   - Kubernetes cluster version: Server Version: v1.30.14-eks-ac2d5a0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to