Can we use nfs volume plugin to maintain the High Availability and Disaster Recovery among the kubernetes cluster?
I am running the pod with MongoDB. Getting the error
chown: changing ownership of '/data/db': Operation not permitted .
Cloud any body, Please suggest me how to resolve the error? (or)
Is any alternative volume plugin is suggestible to achieve HA- DR in kubernetes cluster?
You'll want to either launch the mongo container as
root
, so that you canchown
the directory, or if the image prohibits it (as some images already have aUSER mongo
clause that prohibits the container from escalating privileges back up toroot
), then one of two things: supersede the user with asecurityContext
stanza incontainers:
or use aninitContainer:
to preemptively change the target folder to be the mongo UID:Approach #1:
(which may require altering your cluster's config to permit such a thing to appear in a
PodSpec
)Approach #2 (which is the one I use with Elasticsearch images):