java - send tomcat conf files to container using kubernetes -


i new docker , kubernetes, trying create container having tomcat7/java7 deploy webapps it. concern have tomcat/conf config files, have details of database connections, threadpool, java memory etc.

what want copy these files kubernetes server docker-container , place them @ right places, while starting container.

p.s: don't want via enviroment variables, going huge in numbers if keep variable every entry in config files.

you add configmap in kubernetes, tomcat config (files or whole dir)

kubectl -n staging create configmap special-config --from-file={path-to-tomcat-conf}/server.xml 

and mount on pod (kubectl create -f path/to/the/pod.yaml)

apiversion: v1 kind: pod metadata:  name: tomcat-test-pod spec:  containers:  - name: test-container    image: tomcat:7.0    command: [ "catalina.sh", "run" ]    volumemounts:    - name: config-volume      mountpath: /usr/local/tomcat/conf/server.xml  volumes:  - name: config-volume    configmap:     # provide name of configmap containing files want     # add container     name: special-config 

kubernetes docs


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -