Open alfredking12 opened 2 years ago
问题现象和步骤:
spec: template: metadata: annotations: prometheus.io/path: /actuator/prometheus prometheus.io/scrape: 'true'
问题分析: 使用kuboard编辑服务并保存后,会导致Deployment丢失pod template的注解。查看对应的HTTP请求如下:
发送Deployment查询请求
GET http://ip:32567/k8s-api/apis/apps/v1/namespaces/{namespace}/deployments/{name}
应答如下(对原数据做过精简)
{ "kind": "Deployment", "apiVersion": "apps/v1", "metadata": { "name": "name", "namespace": "namespace" }, "spec": { "replicas": 1, "selector": { "matchLabels": { "k8s.kuboard.cn/name": "name" } }, "template": { "metadata": { "creationTimestamp": null, "labels": { "k8s.kuboard.cn/name": "name" }, "annotations": { "prometheus.io/path": "/actuator/prometheus", "prometheus.io/scrape": "true" } }, "spec": { "containers": [ { "name": "name", "image": "image:latest" } ] } } } }
发送Deployment更新请求(注意:丢失了annotation)
{ "kind": "Deployment", "apiVersion": "apps/v1", "metadata": { "name": "name", "namespace": "namespace" }, "spec": { "replicas": 1, "selector": { "matchLabels": { "k8s.kuboard.cn/name": "name" } }, "template": { "metadata": { "creationTimestamp": null, "labels": { "k8s.kuboard.cn/name": "name" } }, "spec": { "containers": [ { "name": "name", "image": "image:latest" } ] } } } }
K8S版本: v1.23.6+k3s1
希望能够帮处理一下,便于使用
kuboard版本:2.0.5.5
问题现象和步骤:
问题分析: 使用kuboard编辑服务并保存后,会导致Deployment丢失pod template的注解。查看对应的HTTP请求如下:
发送Deployment查询请求
应答如下(对原数据做过精简)
发送Deployment更新请求(注意:丢失了annotation)
K8S版本: v1.23.6+k3s1