Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-12041

APICAST_PATH_ROUTING_ONLY env. variable cannot added in self-managed APIcast

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.15.5 GA
    • Apicast Operator
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Hide

      Injecting an environment variable into the APIcast image requires building a new image, as the APIcast CR lacks support for APICAST_PATH_ROUTING_ONLY.

      This can be done by setting the env var directly in the Dockerfile after referencing the official image from the red hat registry and simply build the new one and push it to the Openshift image registry:

      1. Create the Dockerfile with the following content:

      FROM registry.redhat.io/3scale-amp2/apicast-gateway-rhel8:3scale2.15.5
      
      # This is the Docker equivalent of 'export'
      ENV APICAST_PATH_ROUTING_ONLY=true
      
      # APIcast will now ignore the 'Host' header and route 
      # purely based on the URL path by default.

      2. Create the Build Config:

       $ oc new-build --strategy=docker --binary --name=apicast-2.15.5-custom-build
      

      3. Start the build using the local file:

       $ oc start-build apicast-2.15.5-custom-build --from-dir=. --follow

      4. Deploy a new APIcast self-managed referencing the new image in the CRD:

       spec:
        logLevel: debug
        pathRoutingEnabled: true
        responseCodesIncluded: true
        cacheConfigurationSeconds: 0
        deploymentEnvironment: staging
        adminPortalCredentialsRef:
          name: apicast-staging-secret
        image: 'image-registry.openshift-image-registry.svc:5000/3scale-apicast/apicast-custom-build@sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
        managementAPIScope: status
       configurationLoadMode: lazy
      Show
      Injecting an environment variable into the APIcast image requires building a new image, as the APIcast CR lacks support for APICAST_PATH_ROUTING_ONLY . This can be done by setting the env var directly in the  Dockerfile  after referencing the official image from the red hat registry and simply build the new one and push it to the Openshift image registry: 1. Create the Dockerfile with the following content: FROM registry.redhat.io/3scale-amp2/apicast-gateway-rhel8:3scale2.15.5 # This is the Docker equivalent of 'export' ENV APICAST_PATH_ROUTING_ONLY= true # APIcast will now ignore the 'Host' header and route # purely based on the URL path by default . 2. Create the Build Config: $ oc new -build --strategy=docker --binary --name=apicast-2.15.5-custom-build 3. Start the build using the local file: $ oc start-build apicast-2.15.5-custom-build --from-dir=. --follow 4. Deploy a new APIcast self-managed referencing the new image in the CRD: spec: logLevel: debug pathRoutingEnabled: true responseCodesIncluded: true cacheConfigurationSeconds: 0 deploymentEnvironment: staging adminPortalCredentialsRef: name: apicast-staging-secret image: 'image-registry.openshift-image-registry.svc:5000/3scale-apicast/apicast-custom-build@sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' managementAPIScope: status configurationLoadMode: lazy
    • Important

      APICAST_PATH_ROUTING_ONLY is not part of the configurations options available in the APIcast operator reference document.

      When trying to add it manually to the APIcast deployment it works on embedded APIcast gateways that are built in the 3scale API Manager installation. However, when trying to do the same in a self-managed APIcast, after a few seconds, the APIcast operator reconciles the change done in the apicast deployment yaml file and hence, the APICAST_PATH_ROUTING_ONLY cannot be enabled in self-managed apicast gateway.

      Current behavior:

      APICAST_PATH_ROUTING_ONLY can be successfully enabled in the embedded apicast gateways (3scale Operator) but it cannot be enabled in a self-managed apicast (APIcast operator) since the operator reconciles the change done in the apicast's deployment when trying to manually add it as a new environment variable.

      Desired behavior:

      Be able to enabled APICAST_PATH_ROUTING_ONLY in self-managed apicast gateways also.

      Reproducer steps:
      1) Install APIcast 2.15 operator.
      2) Create an instance of apicast gateway.
      3) Modify the deployment yaml of the apicast instance by adding APICAST_PATH_ROUTING_ONLY = true as new environment variable.
      4) Wait for some seconds and that new variable will be deleted when APIcast operator reconciles the deployment.

              Unassigned Unassigned
              rhn-support-icaldero Ivan Calderon Clemente
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: