--Task-- name: Enable_prometheus_admin_api enabled: True class_name: EnablePrometheusAdminAPI source_name: controller source_namespace: >default< target_name: controller target_namespace: >default< start: 0 stop: None timeout: no timeout loop: False interval: None dependencies: [] wait_for: [] options: {} group_name: None Current dir: /mnt/disks/data/xslou/lodestar-fork/pyrock ________________________________________________________________________________ [04/Apr/2023 21:56:45] Enable_prometheus_admin_api pre : N/A ________________________________________________________________________________ ________________________________________________________________________________ [04/Apr/2023 21:56:45] Enable_prometheus_admin_api step1 : Discover the prometheus pod ________________________________________________________________________________ [04/Apr/2023 21:56:45] - INFO: Discovering prometheus pods [loop_until]: kubectl --namespace=monitoring get pods --output json --field-selector metadata.name=prometheus-prometheus-operator-kube-p-prometheus-0 [loop_until]: (max_time=180, interval=5, expected_rc=[0] [loop_until]: OK (rc = 0) --- stdout --- [print_head_tail]: Print head (100 lines) and tail (100 lines) of input string (516 lines): ----- output ----- { "apiVersion": "v1", "items": [ { "apiVersion": "v1", "kind": "Pod", "metadata": { "annotations": { "kubectl.kubernetes.io/default-container": "prometheus" }, "creationTimestamp": "2023-03-29T06:20:09Z", "generateName": "prometheus-prometheus-operator-kube-p-prometheus-", "labels": { "app.kubernetes.io/instance": "prometheus-operator-kube-p-prometheus", "app.kubernetes.io/managed-by": "prometheus-operator", "app.kubernetes.io/name": "prometheus", "app.kubernetes.io/version": "2.42.0", "controller-revision-hash": "prometheus-prometheus-operator-kube-p-prometheus-8594559c46", "operator.prometheus.io/name": "prometheus-operator-kube-p-prometheus", "operator.prometheus.io/shard": "0", "prometheus": "prometheus-operator-kube-p-prometheus", "statefulset.kubernetes.io/pod-name": "prometheus-prometheus-operator-kube-p-prometheus-0" }, "name": "prometheus-prometheus-operator-kube-p-prometheus-0", "namespace": "monitoring", "ownerReferences": [ { "apiVersion": "apps/v1", "blockOwnerDeletion": true, "controller": true, "kind": "StatefulSet", "name": "prometheus-prometheus-operator-kube-p-prometheus", "uid": "16dfd524-7c1c-48c4-8fe5-563693a1d30b" } ], "resourceVersion": "8056533", "uid": "64f92dbf-5947-4768-bf7f-d554eba307a5" }, "spec": { "automountServiceAccountToken": true, "containers": [ { "args": [ "--web.console.templates=/etc/prometheus/consoles", "--web.console.libraries=/etc/prometheus/console_libraries", "--storage.tsdb.retention.time=10d", "--config.file=/etc/prometheus/config_out/prometheus.env.yaml", "--storage.tsdb.path=/prometheus", "--web.enable-lifecycle", "--web.external-url=http://prometheus-operator-kube-p-prometheus.monitoring:9090", "--web.route-prefix=/", "--storage.tsdb.wal-compression", "--web.config.file=/etc/prometheus/web_config/web-config.yaml" ], "image": "quay.io/prometheus/prometheus:v2.42.0", "imagePullPolicy": "IfNotPresent", "livenessProbe": { "failureThreshold": 6, "httpGet": { "path": "/-/healthy", "port": "http-web", "scheme": "HTTP" }, "periodSeconds": 5, "successThreshold": 1, "timeoutSeconds": 3 }, "name": "prometheus", "ports": [ { "containerPort": 9090, "name": "http-web", "protocol": "TCP" } ], "readinessProbe": { "failureThreshold": 3, "httpGet": { "path": "/-/ready", "port": "http-web", "scheme": "HTTP" }, "periodSeconds": 5, "successThreshold": 1, "timeoutSeconds": 3 }, "resources": {}, "securityContext": { "allowPrivilegeEscalation": false, "capabilities": { "drop": [ "ALL" ] }, "readOnlyRootFilesystem": true }, "startupProbe": { "failureThreshold": 60, "httpGet": { "path": "/-/ready", [...] ] }, "status": { "conditions": [ { "lastProbeTime": null, "lastTransitionTime": "2023-04-04T21:40:36Z", "status": "True", "type": "Initialized" }, { "lastProbeTime": null, "lastTransitionTime": "2023-04-04T21:40:51Z", "status": "True", "type": "Ready" }, { "lastProbeTime": null, "lastTransitionTime": "2023-04-04T21:40:51Z", "status": "True", "type": "ContainersReady" }, { "lastProbeTime": null, "lastTransitionTime": "2023-04-04T21:40:07Z", "status": "True", "type": "PodScheduled" } ], "containerStatuses": [ { "containerID": "containerd://3fc58fc8f639733d4bea7692cf3626c96b7b5f2bd53e59cc695fd45110fb3e57", "image": "quay.io/prometheus-operator/prometheus-config-reloader:v0.63.0", "imageID": "quay.io/prometheus-operator/prometheus-config-reloader@sha256:3f976422884ec7744f69084da7736927eb634914a0c035d5a865cf6a6b8eb1b0", "lastState": {}, "name": "config-reloader", "ready": true, "restartCount": 0, "started": true, "state": { "running": { "startedAt": "2023-04-04T21:40:41Z" } } }, { "containerID": "containerd://28910c0bc49e6812f55fc13f35ed8ad78450f43c784720df6994732531104f00", "image": "quay.io/prometheus/prometheus:v2.42.0", "imageID": "quay.io/prometheus/prometheus@sha256:d2ab0a27783fd4ad96a8853e2847b99a0be0043687b8a5d1ebfb2dd3fa4fd1b8", "lastState": {}, "name": "prometheus", "ready": true, "restartCount": 0, "started": true, "state": { "running": { "startedAt": "2023-04-04T21:40:41Z" } } } ], "hostIP": "10.142.0.141", "initContainerStatuses": [ { "containerID": "containerd://55e0a425ebbd1a24626783a8b18139a2f1ac8ef654e62b225d75e3b849d49821", "image": "quay.io/prometheus-operator/prometheus-config-reloader:v0.63.0", "imageID": "quay.io/prometheus-operator/prometheus-config-reloader@sha256:3f976422884ec7744f69084da7736927eb634914a0c035d5a865cf6a6b8eb1b0", "lastState": {}, "name": "init-config-reloader", "ready": true, "restartCount": 0, "state": { "terminated": { "containerID": "containerd://55e0a425ebbd1a24626783a8b18139a2f1ac8ef654e62b225d75e3b849d49821", "exitCode": 0, "finishedAt": "2023-04-04T21:40:32Z", "reason": "Completed", "startedAt": "2023-04-04T21:40:32Z" } } } ], "phase": "Running", "podIP": "10.106.43.19", "podIPs": [ { "ip": "10.106.43.19" } ], "qosClass": "Burstable", "startTime": "2023-04-04T21:40:07Z" } } ], "kind": "List", "metadata": { "resourceVersion": "", "selfLink": "" } } --- stderr --- ________________________________________________________________________________ [04/Apr/2023 21:56:46] Enable_prometheus_admin_api step2 : Enable the API if disabled ________________________________________________________________________________ [04/Apr/2023 21:56:46] - INFO: REST API is enabled: False [04/Apr/2023 21:56:46] - INFO: Enabling the API [loop_until]: kubectl --namespace=monitoring patch prometheus prometheus-operator-kube-p-prometheus --type merge --patch '{"spec":{"enableAdminAPI":true}}' [loop_until]: (max_time=180, interval=5, expected_rc=[0] [loop_until]: OK (rc = 0) --- stdout --- prometheus.monitoring.coreos.com/prometheus-operator-kube-p-prometheus patched --- stderr --- ________________________________________________________________________________ [04/Apr/2023 21:56:46] Enable_prometheus_admin_api post : Post method ________________________________________________________________________________ Setting result to PASS Task has been successfully stopped