<p>When I run my Pod I get the Pod (cas-de) is invalid spec : forbidden pod updates may not change fields other than the  <code>spec.containers[*].image</code>, <code>spec.initContainers[*].image</code>, <code>spec.activeDeadlineSeconds</code> or <code>spec.tolerations</code> (only additions to existing tolerations)</p>

<p>However, I searched on the kubernetes website and I didn't find anything wrong: 
(I really don't understand where is my mistake) </p>

<p>Does it better to set <code>volumeMounts</code> in a Pod or in Deployment? </p>

<pre><code>apiVersion: v1
kind: Pod 
metadata:
  name: cas-de
  namespace: ds-svc
spec:
  containers:
  - name: ds-mg-cas
    image: "docker-all.xxx.net/library/ds-mg-cas:latest"
    imagePullPolicy: Always
    ports:
    - containerPort: 8443
    - containerPort: 6402
    env:
    - name: JAVA_APP_CONFIGS
      value: "/apps/ds-cas/configs"
    - name: JAVA_EXTRA_PARAMS
      value: "-Djava.security.auth.login.config=./config/jaas.config -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6402"
    volumeMounts:
    - name: ds-cas-config
      mountPath: "/apps/ds-cas/context"
  volumes:
    - name: ds-cas-config
      hostPath:
        path: "/apps/ds-cas/context"
</code></pre>

morla
<p>YAML template is valid. Some of the fields might have been changed that are forbidden and then <code>kubectl apply ....</code> is executed.</p>

<p>Looks like more like a development. Solution is to delete the existing pod using <code>kubectl delete pod cas-de</code> command and then execute <code>kubectl apply -f file.yaml</code> or <code>kubectl create -f file.yaml</code>.</p>
