An open API service indexing awesome lists of open source software.

https://github.com/guessi/eks-node-diagnostic

Friendly `NodeDiagnostic` apply with no dependency required
https://github.com/guessi/eks-node-diagnostic

amazon-eks github-actions golang

Last synced: 2 months ago
JSON representation

Friendly `NodeDiagnostic` apply with no dependency required

Awesome Lists containing this project

README

          

# eks-node-diagnostic

[![GitHub Actions](https://github.com/guessi/eks-node-diagnostic/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/guessi/eks-node-diagnostic/actions/workflows/go.yml)
[![GoDoc](https://godoc.org/github.com/guessi/eks-node-diagnostic?status.svg)](https://godoc.org/github.com/guessi/eks-node-diagnostic)
[![Go Report Card](https://goreportcard.com/badge/github.com/guessi/eks-node-diagnostic)](https://goreportcard.com/report/github.com/guessi/eks-node-diagnostic)
[![GitHub release](https://img.shields.io/github/release/guessi/eks-node-diagnostic.svg)](https://github.com/guessi/eks-node-diagnostic/releases/latest)
[![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/guessi/eks-node-diagnostic)](https://github.com/guessi/eks-node-diagnostic/blob/main/go.mod)

Friendly `NodeDiagnostic` apply with no dependency required

## 🤔 Why we need this? what it is trying to resolve?

Back on December 3, 2024, Amazon EKS announced [Amazon EKS Auto Mode](https://aws.amazon.com/blogs/containers/getting-started-with-amazon-eks-auto-mode/) and how to use [NodeDiagnostic](https://docs.aws.amazon.com/eks/latest/userguide/auto-get-logs.html) for troubleshooting. However, not all computers have a pre-set Python environment, and it may be difficult for people who are not familiar with Python, let alone solving package dependencies, version conflicts, and virtual environment setting issues.

To remove these obstacles, [eks-node-diagnostic](https://github.com/guessi/eks-node-diagnostic) comes to solve this complex problem, aiming to simplify the entire process into executing binaries, easy to install without having to deal with Python dependencies.

## 🔢 Prerequisites

* An existing [Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html) AutoMode cluster or a cluster with the [Node Monitoring Agent](https://docs.aws.amazon.com/eks/latest/userguide/node-health-nma.html) installed.
* An existing [kubeconfig](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html).
* [Grant IAM users and roles access to Kubernetes APIs](https://docs.aws.amazon.com/eks/latest/userguide/grant-k8s-access.html).
* (Only required for `destinationType: s3`) An existing [Amazon S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) for storing node logs generated by `NodeDiagnostic`.
* (Only required for `destinationType: s3`) An IAM Role/User with [s3:PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) permission (to generate presigned S3 url).

## 👀 Key differences with [official guidance](https://docs.aws.amazon.com/eks/latest/userguide/auto-get-logs.html)

* Single executable binary only, no Python and no AWS SDK required.
* Run anywhere, compatible with Linux (amd64/arm64), Windows (amd64 only), macOS (amd64/arm64).
* Friendly setup with [Homebrew](https://brew.sh/) for mac users.

## 🚀 Quick start

Get `config.yaml` ready, you may find examples at [examples/](./examples/) folder.

Execute

```bash
eks-node-diagnostic [--config-file config.yaml]
```

```bash
nodediagnostic.eks.amazonaws.com/i-EXAMPLE1111111111 created
nodediagnostic.eks.amazonaws.com/i-EXAMPLE2222222222 created
nodediagnostic.eks.amazonaws.com/i-EXAMPLE3333333333 created
...
```

Check

```bash
kubectl describe nodediagnostics
```

## :accessibility: FAQ

Where can I find log archive generated by `NodeDiagnostic` when `destinationType` set as `s3`?

* Log archive generated by `NodeDiagnostic` would be placed at path below,

> `s3://{{ BUCKET }}/node-diagnostic/log__{{ REGION }}__{{ NODE_NAME }}__{{ TIMESTAMP }}.tar.gz`

Where can I find log archive generated by `NodeDiagnostic` when `destinationType` set as `node`?

* Generic Linux: Log should be available at `/var/log/support/${NODE_NAME}$-logs.tar.gz`
* Bottlerocket: Log should be available at `/.bottlerocket/support/${NODE_NAME}$-logs.tar.gz`

How do I report an issue or submit a feature request?

* Please go for project's [issue page](https://github.com/guessi/eks-node-diagnostic/issues) and describe your idea in detail.

What is the version requirement for `destinationType: node`?

* The `"node"` destination type requires [Node Monitoring Agent](https://docs.aws.amazon.com/eks/latest/userguide/node-health-nma.html) >= v1.6.1.

## 👷 Install

### For macOS/Linux users (Recommended)

Brand new install

```bash
brew tap guessi/tap && brew update && brew install eks-node-diagnostic
```

To upgrade version

```bash
brew update && brew upgrade eks-node-diagnostic
```

### Manually setup (Linux, Windows, macOS)

Click to expand!

#### For Linux users

```bash
curl -fsSL https://github.com/guessi/eks-node-diagnostic/releases/latest/download/eks-node-diagnostic-Linux-$(uname -m).tar.gz -o - | tar zxvf -
mv -vf ./eks-node-diagnostic /usr/local/bin/eks-node-diagnostic
```

#### For macOS users

```bash
curl -fsSL https://github.com/guessi/eks-node-diagnostic/releases/latest/download/eks-node-diagnostic-Darwin-$(uname -m).tar.gz -o - | tar zxvf -
mv -vf ./eks-node-diagnostic /usr/local/bin/eks-node-diagnostic
```

#### For Windows users

```powershell
$SRC = 'https://github.com/guessi/eks-node-diagnostic/releases/latest/download/eks-node-diagnostic-Windows-x86_64.tar.gz'
$DST = 'C:\Temp\eks-node-diagnostic-Windows-x86_64.tar.gz'
Invoke-RestMethod -Uri $SRC -OutFile $DST
```

## ⚖️ License

[Apache-2.0](LICENSE)