I'm trying to have a kubernetes deployment to work, on a mac with minikube, and using a jar file located in a local host directory:
apiVersion: apps/v1
kind: Deployment
metadata:
name: master
spec:
replicas: 1
(...)
containers:
- name: master-c
(...)
volumeMounts:
(...)
- name: master-volume
mountPath: /server/plugins/master.jar
#subPath: master.jar
volumes:
- name: master-volume
hostPath:
path: /localdir/master.jar
type: File
using File type I get this error:
Warning FailedMount 10s (x6 over 26s) kubelet
MountVolume.SetUp failed for volume "master-volume" : hostPath type check failed: /localdir/master.jar is not a file
using Directory type is simply creating an empty dir in pod path.
How to get the jar file available ? I know that kubectl cp can copy the jar file into the pod directory, but application is started and does not recognize it, so I need to have the jar file available before to start the application. Any idea ?