<p>I am trying to implement Kubernetes resource deployment. For this I created <code>deployment.yaml</code> and <code>service.yaml</code> as my Kubernetes reources. And refering the dockerhub registry image with <code>latest</code> tag in my <code>deployment.yaml. When I am doing like this, latest image is not pulling with</code>latest` tag.</p>

<p>So I added the time stamp in deployment like following:</p>

<pre><code>template:
 metadata:
  labels:
    app: test-kube-deployment
    date: date "+%H:%M:%S   %d/%m/%y"
spec:
  imagePullSecrets:
    - name: "regcred"
  containers:
   - name: test-kube-deployment-container
     image: spacestudymilletech010/spacestudykubernetes:latest
     imagePullPolicy: Always
     ports:
        - name: http
          containerPort: 8085
          protocol: TCP
</code></pre>

<p>When I added time here , I am getting the error like the following,</p>

<pre><code>The Deployment "test-kube-deployment" is invalid: spec.template.labels: Invalid value: "date \"+%H:%M:%S   %d/%m/%y\"": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character 
</code></pre>

<p>Here what modification that I need to do to define my time stamp for uniquely identify my Docker image?</p>

Mr.DevEng
<p>Don't add it as a label, but rather as an annotation. </p>

<pre><code>template: 
  metadata: 
    labels: 
      app: test-kube-deployment 
    annotations: 
      date: "+%H:%M:%S %d/%m/%y"
</code></pre>

<p>PD.- You are getting the error because labels don't accept the +, % and : characters. </p>
