<pre><code>apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
    kind: Deployment
    metadata:
      name: consoleservice1
    spec:
      selector:
        matchLabels:
          app: consoleservice1
      replicas: 3 # tells deployment to run 3 pods matching the template
      strategy:
        type: RollingUpdate
        rollingUpdate:
          maxSurge: 1
          maxUnavailable: 1
      minReadySeconds: 5
      template: # create pods using pod definition in this template
        metadata:
          labels:
            app: consoleservice1
        spec:
          containers:
          - name: consoleservice
            image: chintamani/insightvu:ms-console1
            readinessProbe:
              httpGet:
                path: /
                port: 8385
              initialDelaySeconds: 5
              periodSeconds: 5
              successThreshold: 1
            ports:
            - containerPort: 8384
            imagePullPolicy: Always
            volumeMounts:
              - mountPath: /deploy/config
                name: config
          volumes:
            - name: config
              configMap:
                name: console-config
</code></pre>

<p>For creating configmap I am using this command:</p>

<pre><code>kubectl create configmap console-config --from-file=deploy/config
</code></pre>

<p>While changing in configmap it doesn't reflect automatically, every time I have to restart the pod. How can I do it automatically?</p>

Chintamani
<p>thank you guys .Able to fix it ,I am using reloader to reflect on pods if any changes done inside 
kubectl apply -f <a href="https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml</a></p>

<p>then add the annotation inside your deployment.yml file .</p>

<pre><code>apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
  name: consoleservice1
  annotations:
    configmap.reloader.stakater.com/reload: "console-config"
</code></pre>

<p>It will restart your pods gradually .</p>
