I have created a configmap and a pod yaml file .
I have tried multiple solutions but none worked for me .
kubectl describe cm cf3
Name: cf3
Namespace: default
Labels: <none>
Annotations: <none>
Data
====
index.html:
----
hii im marimmo
Events: <none
pod yaml file
apiVersion: v1
kind: Pod
metadata:
name: dapi-test-pod
spec:
containers:
- name: test-container
image: manya97/manya_tomcat:0.1
volumeMounts:
- name: config-volume
mountPath: /apache-tomcat-8.0.32/webapps/SampleWebApp/index.html
subPath: index.html
volumes:
- name: config-volume
configMap:
name: cf3
restartPolicy: Never
this was supposed to replace existing index.html file but somehow it removes all the content of SampleWebApp and places only index.html. I dont know if have done it in correct way , I want to replace only content of index.html. Might be possible that mounting works this way I do not know .