Add support for k8s StatefulSet

Currently collector doesn't recognize k8s StatefulSet.

Change-Id: If111279dc204704ac5e73d9f880eb4ecdd925297
Story: 2001757
Task: 12155
This commit is contained in:
Tobias Johansson 2018-04-11 12:30:01 +02:00
parent 2fdcc08875
commit 52643b7a7c
2 changed files with 4 additions and 0 deletions

View File

@ -1769,6 +1769,7 @@ There is also additional Kubernetes dimensions for the Container and Pod metrics
| ReplicationController | replication_controller |
| ReplicaSet | replica_set |
| DaemonSet | daemon_set |
| StatefulSet | stateful_set |
| Deployment| deployment | Only will be set if derive_host is set to true as it needs to connect to the API to see if the ReplicaSet is under a deployment
| Job | job |

View File

@ -1,5 +1,6 @@
# (C) Copyright 2015,2017-2018 Hewlett Packard Enterprise Development LP
# (C) Copyright 2017 KylinCloud
# Copyright 2018 OP5 AB
import base64
import json
@ -815,6 +816,8 @@ def _get_pod_owner_pair(kubernetes_connector, pod_owner_type, pod_owner_name, po
return 'deployment', deployment_name
elif pod_owner_type == "DaemonSet":
return 'daemon_set', pod_owner_name
elif pod_owner_type == "StatefulSet":
return 'stateful_set', pod_owner_name
elif pod_owner_type == "Job":
if not kubernetes_connector:
log.info("Can not set cronjob name as connection information to API is not set. "