Code Monkey home page Code Monkey logo

k8s-diag-utilities's Introduction

New Relic Experimental header

Kubernetes Diag Utilities

A repository of utilities related to troubleshooting Kubernetes and Pixie installation issues.

Support

New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.

We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.

Contributing

We encourage your contributions to improve k8s-diag-utilities! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

License

k8s-diag-utilities is licensed under the Apache 2.0 License.

[If applicable: [Project Name] also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.]

k8s-diag-utilities's People

Contributors

bpschmitt avatar cliftondobrich avatar maxlemieux avatar nr-jtc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-diag-utilities's Issues

[kube-diag] Logs not working for nrk8s-ksm and nri-kube-events containers

Description

This bug affects gathering logs from nrk8s-ksm and nri-kube-events pods.

This script was originally written back when these pods had just one container. They now each have two containers, and so we need to specify which container to get logs from (both containers). Otherwise kubectl returns an error.

Steps to Reproduce

Install the New Relic chart bundle with newrelic-infrastructure and kube-events enabled.

Run kube-diag on the newrelic namespace.

Result: kube-diag tries to pull logs from certain pods that have sidecars, and fails because it doesn't pass container names.

Expected Behavior

kube-diag pulls logs from all the containers on these pods instead of failing to pull any

Relevant Logs / Console output

Logs from newrelic-bundle-nrk8s-ksm
*****************************************************
error: a container name must be specified for pod newrelic-bundle-nrk8s-ksm-1234, choose one of: [ksm forwarder]

*****************************************************

Logs from newrelic-bundle-nri-kube-events
*****************************************************
error: a container name must be specified for pod newrelic-bundle-nri-kube-events-1234, choose one of: [kube-events forwarder]

Your Environment

Kubernetes 1.26 (any supported Kubernetes with current nri-bundle will reproduce this)

[feature] Warn on kube-system installations

Summary

kube-diag should warn if it sees that New Relic is installed to kube-system namespace. This is an antipattern - many direct references on internet including our blog post: https://newrelic.com/blog/how-to-relic/how-to-organize-kubernetes-clusters

Desired Behavior

Print a single warning line if kube-diag detects it is running against kube-system namespace (or if kube-diag autodetects that the chart was installed there).

Possible Solution

Parse namespace name.

Additional context

Beyond difficulty in maintenance of New Relic chart in system namespace, Installations here may experience unknown problems if cluster has special security on this system namespace.

[bug] Cluster flavor detection not working for EKS

Description

kube-diag is detecting EKS as 'self hosted'.

Steps to Reproduce

Run kube-diag against an EKS 1.25 cluster (maybe other versions too?)

Expected Behavior

kube-diag should report EKS for an EKS cluster.

Relevant Logs / Console output

Running kubediag on a EKS 1.25 cluster, it reports:

Kubernetes cluster flavor: Self-hosted

Additional context

Possible data to key off of:

  • String eks appears clearly in kubelet version string,
  • k8s.io/cloud-provider-aws= label name is present on node descriptions.

[kube-diag] Check for ingress controllers and NetworkPolicy

Summary

Check for ingress controllers and NetworkPolicy on cluster

Desired Behavior

kube-diag should be able to spot any installed ingress controllers, such as: Calico, nginx-ingress

We should also be able to see a list of NetworkPolicy names, so we can see if there are customizations on the cluster.

Possible Solution

  • Check cluster for unique CRDs belonging to these packages (medium)
  • kubectl get -A networkpolicy (easy)

Additional context

Issues with network configuration can be difficult to troubleshoot, this will help illuminate the presence of an ingress controller in the cluster, or any network policies beyond the norm.

[kube-diag, pixie-diag] Auto detect namespace

Summary

kube-diag and pixie-diag should auto detect the New Relic and/or Pixie namespaces

Desired Behavior

The script should auto detect the namespace. If it cannot detect the namespace, it should prompt for input.

Possible Solution

Check newrelic and if it's not there, prompt for input.

Check for Pixie at: olm, px-operator, newrelic and pl.

Search for resources on the cluster and parse the namespace out.

Additional context

Sometimes the wrong namespace is targeted, this should help with that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.