Kubernetes: Find when a ConfigMap was patched

1/16/2020

I can easily find when a ConfigMap was created but how do you find out when a ConfigMap was last patched (edited)?

That information does not appear in any of the metadata when I export as YAML.

Deployments have a lastUpdateTime field that we can see, ConfigMaps don't appear to have the same, is that true?

status:
  availableReplicas: 2
  conditions:
  - lastTransitionTime: "2020-01-16T17:48:17Z"
    lastUpdateTime: "2020-01-16T17:48:17Z"
-- matt
kubernetes

2 Answers

1/17/2020

By current design config maps are not versioned and so there is no preserving the history and at a given point in time there can be only one version of a ConfigMap in kubernetes. Deployments are versioned and needs history and timestamps for rollout and rollback.

-- Arghya Sadhu
Source: StackOverflow

1/17/2020

As @ArghyaSadhu said, configmaps are not versioned in kubernetes.

If you want to take control of your configmaps versions, you could create a simple entry in the data field like:

apiVersion: v1
kind: ConfigMap
data: 
  config.version: "001" <== HERE
...

and increase/modify the version number of this specific data when you do some adjustment or just let your CI/CD process modify it for you.

But it is the only for your control, if you want to implement 'rollback' functionality to your configmaps this must be done using some script from your side.

-- KoopaKiller
Source: StackOverflow