Skip to content

Commit

Permalink
feat(chart): adding new openshift endpoint (#525)
Browse files Browse the repository at this point in the history
* feat(chart): adding new open shift endpoints

* fix(chart): bump image versions
  • Loading branch information
paologallinaharbur authored Aug 1, 2022
1 parent 92315ff commit 7f5a261
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/newrelic-infrastructure/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ sources:
- https://github.com/newrelic/nri-kubernetes/tree/master/charts/newrelic-infrastructure
- https://github.com/newrelic/infrastructure-agent/

version: 3.7.4
appVersion: 3.4.0
version: 3.8.0
appVersion: 3.4.1

dependencies:
- name: common-library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ tests:
matchNode: true
namespace: kube-system
selector: k8s-app=kube-scheduler
- endpoints:
- auth:
type: bearer
insecureSkipVerify: true
url: https://localhost:10259
matchNode: true
namespace: openshift-kube-scheduler
selector: app=openshift-kube-scheduler,scheduler=true
- endpoints:
- auth:
type: bearer
Expand Down
44 changes: 36 additions & 8 deletions charts/newrelic-infrastructure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ images:
# @default -- See `values.yaml`
forwarder:
pullPolicy: IfNotPresent
tag: 1.27.4
tag: 1.28.0
repository: newrelic/k8s-events-forwarder
registry: ""
# -- Image for the New Relic Infrastructure Agent plus integrations.
# @default -- See `values.yaml`
agent:
pullPolicy: IfNotPresent
tag: 2.8.20
tag: 2.8.22
repository: newrelic/infrastructure-bundle
registry: ""
# -- Image for the New Relic Kubernetes integration.
# @default -- See `values.yaml`
integration:
pullPolicy: IfNotPresent
tag: 3.4.0
tag: 3.4.1
repository: newrelic/nri-kubernetes
registry: ""

Expand Down Expand Up @@ -274,8 +274,8 @@ controlPlane:
type: bearer
# Openshift users might want to remove previous autodiscover entries and add this one instead.
# Manual steps are required to create a secret containing the required TLS certificates to connect to etcd.
# - selector: "k8s-app=etcd"
# namespace: kube-system
# - selector: "app=etcd,etcd=true,k8s-app=etcd"
# namespace: openshift-etcd
# matchNode: true
# endpoints:
# - url: https://localhost:9979
Expand Down Expand Up @@ -317,6 +317,14 @@ controlPlane:
insecureSkipVerify: true
auth:
type: bearer
- selector: "app=openshift-kube-scheduler,scheduler=true"
namespace: openshift-kube-scheduler
matchNode: true
endpoints:
- url: https://localhost:10259
insecureSkipVerify: true
auth:
type: bearer
- selector: "app=openshift-kube-scheduler,scheduler=true"
namespace: kube-system
matchNode: true
Expand Down Expand Up @@ -356,6 +364,14 @@ controlPlane:
insecureSkipVerify: true
auth:
type: bearer
- selector: "app=kube-controller-manager,kube-controller-manager=true"
namespace: openshift-kube-controller-manager
matchNode: true
endpoints:
- url: https://localhost:10257
insecureSkipVerify: true
auth:
type: bearer
- selector: "app=kube-controller-manager,kube-controller-manager=true"
namespace: kube-system
matchNode: true
Expand All @@ -364,9 +380,6 @@ controlPlane:
insecureSkipVerify: true
auth:
type: bearer
# mtls:
# secretName: secret-name
# secretNamespace: secret-namespace
- selector: "app=controller-manager,controller-manager=true"
namespace: kube-system
matchNode: true
Expand All @@ -375,6 +388,9 @@ controlPlane:
insecureSkipVerify: true
auth:
type: bearer
# mtls:
# secretName: secret-name
# secretNamespace: secret-namespace
# -- staticEndpoint configuration.
# It is possible to specify static endpoint to scrape. If specified 'autodiscover' section is ignored.
# If set the static endpoint should be reachable, otherwise an error will be returned and the integration stops.
Expand Down Expand Up @@ -413,6 +429,18 @@ controlPlane:
auth:
type: bearer
- url: http://localhost:8080
- selector: "app=openshift-kube-apiserver,apiserver=true"
namespace: openshift-kube-apiserver
matchNode: true
endpoints:
- url: https://localhost:8443
insecureSkipVerify: true
auth:
type: bearer
- url: https://localhost:6443
insecureSkipVerify: true
auth:
type: bearer
- selector: "app=openshift-kube-apiserver,apiserver=true"
namespace: kube-system
matchNode: true
Expand Down
2 changes: 1 addition & 1 deletion src/controlplane/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (s *Scraper) autodiscover(c component) (*scrape.Job, error) {
for _, autodiscover := range c.AutodiscoverConfigs {
pod, err := s.podDiscoverer.Discover(autodiscover)
if errors.Is(err, discoverer.ErrPodNotFound) {
s.logger.Debugf("No pod found for %q with labels %q", c.Name, autodiscover.Selector)
s.logger.Debugf("No pod found for %q with labels %q in namespace %q", c.Name, autodiscover.Selector, autodiscover.Namespace)
continue
}

Expand Down
5 changes: 3 additions & 2 deletions src/metric/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,15 @@ var KubeletSpecs = definition.SpecGroups{
// /metrics/cadvisor endpoint
{Name: "containerID", ValueFunc: definition.FromRaw("containerID"), Type: sdkMetric.ATTRIBUTE},
{Name: "containerImageID", ValueFunc: definition.FromRaw("containerImageID"), Type: sdkMetric.ATTRIBUTE},
{Name: "containerMemoryMappedFileBytes", ValueFunc: definition.FromRaw("container_memory_mapped_file"), Type: sdkMetric.GAUGE, Optional: true},
{Name: "containerOOMEventsDelta", ValueFunc: definition.FromRaw("container_oom_events_total"), Type: sdkMetric.PDELTA, Optional: true},
// In openshift (and possibly in other environments) these metrics were missing at first for pods that were not throttled.
{Name: "containerCpuCfsPeriodsDelta", ValueFunc: definition.FromRaw("container_cpu_cfs_periods_total"), Type: sdkMetric.DELTA, Optional: true},
{Name: "containerCpuCfsThrottledPeriodsDelta", ValueFunc: definition.FromRaw("container_cpu_cfs_throttled_periods_total"), Type: sdkMetric.DELTA, Optional: true},
{Name: "containerCpuCfsThrottledSecondsDelta", ValueFunc: definition.FromRaw("container_cpu_cfs_throttled_seconds_total"), Type: sdkMetric.DELTA, Optional: true},
{Name: "containerCpuCfsPeriodsTotal", ValueFunc: definition.FromRaw("container_cpu_cfs_periods_total"), Type: sdkMetric.GAUGE, Optional: true},
{Name: "containerCpuCfsThrottledPeriodsTotal", ValueFunc: definition.FromRaw("container_cpu_cfs_throttled_periods_total"), Type: sdkMetric.GAUGE, Optional: true},
{Name: "containerCpuCfsThrottledSecondsTotal", ValueFunc: definition.FromRaw("container_cpu_cfs_throttled_seconds_total"), Type: sdkMetric.GAUGE, Optional: true},
{Name: "containerMemoryMappedFileBytes", ValueFunc: definition.FromRaw("container_memory_mapped_file"), Type: sdkMetric.GAUGE, Optional: true},
{Name: "containerOOMEventsDelta", ValueFunc: definition.FromRaw("container_oom_events_total"), Type: sdkMetric.PDELTA, Optional: true},

// /pods endpoint
{Name: "containerName", ValueFunc: definition.FromRaw("containerName"), Type: sdkMetric.ATTRIBUTE},
Expand Down

0 comments on commit 7f5a261

Please sign in to comment.