A few issues I had while deploying to GKE
For those who run into the same problems as me here are a few notes.
uuidgen and jq commands are not installed by default, I installed it manually with apt-get install jq uuid-runtime. The jq is noted at the top of the bash script but the uuidgen one is not.
The current ismounted check prevented my pods from terminating because there were multiple entries returned by findmnt, the following worked for me.
ismounted() {
MOUNT=$(findmnt -n ${MNTPATH} 2>/dev/null)
if [ ! -z "$MOUNT" ]; then
echo "1"
else
echo "0"
fi
}
I found only setting "chmod +x" did not allow autodiscovery, I had to set 777 on the whole plugins directory and bash script for it to work.
Private GCR repos do not work because the docker cli is not logged in so if you are going to use private docker images you need to run something like this after adding the FlexVolume driver.
sudo su
docker login \
-u oauth2accesstoken \
-p "$(curl "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" -H "Metadata-Flavor: Google" | jq -r '.access_token')" \
https://asia.gcr.io
Otherwise its working great so thanks!!!
Also the volume plugin dir for GKE is /home/kubernetes/flexvolume.