You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Raymond Augé (Jira)" <ji...@apache.org> on 2021/05/15 13:55:00 UTC

[jira] [Resolved] (FELIX-6229) Not compatible with the symlinks Kubernetes uses to mount ConfigMaps

     [ https://issues.apache.org/jira/browse/FELIX-6229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Augé resolved FELIX-6229.
---------------------------------
    Resolution: Fixed

> Not compatible with the symlinks Kubernetes uses to mount ConfigMaps
> --------------------------------------------------------------------
>
>                 Key: FELIX-6229
>                 URL: https://issues.apache.org/jira/browse/FELIX-6229
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-3.6.4
>         Environment: linux
>            Reporter: Lars Benedetto
>            Assignee: Raymond Augé
>            Priority: Major
>             Fix For: fileinstall-3.7.0
>
>
> 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.
>  
> {code:java}
> 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{code}
> 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.
>  
> {code:java}
> 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
> {code}
> In this variant, the route is never detected. But intermediate and final are both detected and deployed as {{wrap:jardir:}}
>  
> {code:java}
> mkdir final1
> cp /routev1.xml /apache-karaf/deploy/final1/route.xml
> ln -s intermediate/route.xml route.xml
> ln -s final1 intermediate{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)