Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-6229

Not compatible with the symlinks Kubernetes uses to mount ConfigMaps

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: fileinstall-3.6.4
    • Fix Version/s: None
    • Component/s: File Install
    • Labels:
      None
    • Environment:
      linux

      Description

      I am trying to deploy xml blueprint files in Karaf by using Kubernetes to mount a ConfigMap as a file inside Karafs deploy folder. Unfortunately, K8s doesn't just put the file in the deploy folder.

       

      root@/apache-karaf/deploy# ls -al
       total 0
       drwxrwxrwx 3 root root 151 Feb 26 04:20 .
       drwxr-xr-x 1 root root 64 Feb 25 05:49 ..
       drwxr-xr-x 2 root root 98 Feb 26 04:20 ..2020_02_26_04_20_14.044787912
       lrwxrwxrwx 1 root root 31 Feb 26 04:20 ..data -> ..2020_02_26_04_20_14.044787912
       lrwxrwxrwx 1 root root 45 Feb 26 04:13 route.xml -> ..data/route.xml

      K8s creates a chain of symlinks. This works at first, because Felix detects the creation of the symlink from route.xml -> data/route.xml, and follows the symlinks through to get to the actual file.

      But when K8s comes in to update with a new version of the route, it creates a new timestamped directory, and then updates the intermediate symlink from data -> timestamp.

       

      Felix detects this as well, but only partially. It deploys the new timestamp dir with wrap:jardir: and the new symlink to the timestamp dir as wrap:jardir: as well. But it does not reload the route.

       

      Steps to reproduce:
      In this variant, intermediate and final are detected and deployed as {{wrap:jardir: }}and the route is detected and deployed correctly, but subsequent changes to the route are not.

       

      mkdir final1
      cp /routev1.xml /apache-karaf/deploy/final1/route.xml
      ln -s final1 intermediate
      ln -s intermediate/route.xml route.xml 
      
      # And then to mimic k8s switching to the new file
      mkdir final2
      cp /routev2.xml /apache-karaf/deploy/final2/route.xml
      rm intermediate
      ln -s final2 intermediate
      

      In this variant, the route is never detected. But intermediate and final are both detected and deployed as wrap:jardir:

       

      mkdir final1
      cp /routev1.xml /apache-karaf/deploy/final1/route.xml
      ln -s intermediate/route.xml route.xml
      ln -s final1 intermediate

       

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              lbenedetto Lars Benedetto
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: