prometheus-operator: Creation/Update of Prometheus object throws error on volume claime template creationTimeStamp being null
What happened? Writing a container that deploys our monitoring stack. Updated to Operator version 0.33.0 from 0.29.0 so i can deploy on K8S 1.16 We allow users to select our product as a Persistent Volume underneath so we can persist historical data.
in 0.29.0 this deployed fine. creation and update went through and prometheus comes up. in 0.31.0 this barfs on creation / updating of the prometheus object saying:
validation failure list:\nspec.storage.volumeClaimTemplate.metadata.creationTimestamp in body must be of type string: "null""
As far as i know, you should never pass in this field as it’s generated by the system.
Did you expect to see some different? I expected to see my prometheus pods coming online.
How to reproduce it (as minimally and precisely as possible): I can’t give you my container yet but in my estimation. Create a Prometheus object with a persistent volume claim template. Don’t pass a creationDate in the metadata.
Environment 4 Node k8s cluster K8S 1.14.7 Ubuntu 18.04
-
Prometheus Operator version: v0.31.0
-
Kubernetes version information: 1.14.7
-
Kubernetes cluster kind: kubeadm
-
Manifests:
VolumeClaimTemplate without a creation date timestamp.
- Prometheus Operator Logs:
2019/10/21 17:22:23 Prometheus.monitoring.coreos.com "px-prometheus" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"monitoring.coreos.com/v1", "kind":"Prometheus", "metadata":map[string]interface {}{"creationTimestamp":"2019-10-21T17:22:23Z", "generation":1, "name":"px-prometheus", "namespace":"kube-system", "ownerReferences":[]interface {}{map[string]interface {}{"apiVersion":"v1", "blockOwnerDeletion":true, "controller":true, "kind":"Deployment", "name":"px-prometheus-operator", "uid":"d45c04fa-f425-11e9-8092-0800271d1d4b"}}, "uid":"584c4eda-f427-11e9-8092-0800271d1d4b"}, "spec":map[string]interface {}{"alerting":map[string]interface {}{"alertmanagers":[]interface {}{map[string]interface {}{"name":"px-alertmanager", "namespace":"kube-system", "port":"web"}}}, "logLevel":"debug", "replicas":2, "resources":map[string]interface {}{"requests":map[string]interface {}{"memory":"400Mi"}}, "ruleSelector":map[string]interface {}{"matchLabels":map[string]interface {}{"prometheus":"px-prometheus"}}, "rules":map[string]interface {}{"alert":map[string]interface {}{}}, "securityContext":map[string]interface {}{"fsGroup":0, "runAsNonRoot":false, "runAsUser":0}, "serviceAccountName":"px-monitor", "serviceMonitorSelector":map[string]interface {}{"matchLabels":map[string]interface {}{"name":"px-prometheus-sm"}}, "storage":map[string]interface {}{"volumeClaimTemplate":map[string]interface {}{"metadata":map[string]interface {}{"annotations":map[string]interface {}{"openstorage.io/auth-secret-name":"px-secret", "openstorage.io/auth-secret-namespace":"default"}, "creationTimestamp":interface {}(nil), "name":"data"}, "spec":map[string]interface {}{"accessModes":[]interface {}{"ReadWriteOnce"}, "resources":map[string]interface {}{"requests":map[string]interface {}{"storage":"10Gi"}}, "storageClassName":"px-prometheus-sc"}, "status":map[string]interface {}{}}}}}: validation failure list: spec.storage.volumeClaimTemplate.metadata.creationTimestamp in body must be of type string: "null" Next retry in: 10s
Anything else we need to know?:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 17 (9 by maintainers)
I just found that issue on a rollout as well, to workaround this issue I just set the spec.storage.volumeClaimTemplate.metadata.creationTimestamp to the creation timestamp of the pvc and redeploy with terraform.
@s-urbaniak is the workaround in the linked issue viable for my case? is there any plans for fixes in this area?