README
ΒΆ
Refresh
A Go-based CLI tool to manage and monitor AWS EKS node groups using your local kubeconfig and AWS credentials.
Features
- List all managed node groups in your EKS cluster
- See AMI status for each nodegroup (β Latest, β Outdated, β οΈ Updating)
- Detect and show nodegroups that are currently being updated
- Update the AMI for all or specific nodegroups (rolling by default, with optional force)
- Color-coded, readable CLI output
Requirements
- Go 1.23+
- AWS credentials (
~/.aws/credentialsor environment variables) - kubeconfig (
~/.kube/config)
Installation
πΊ Homebrew (Recommended)
The easiest way to install refresh is via Homebrew:
# Add the tap
brew tap dantech2000/tap
# Install refresh
brew install refresh
# Verify installation
refresh version
π¦ Download from Releases
Alternatively, download pre-built binaries from the releases page:
- Go to the latest release
- Download the appropriate binary for your platform:
refresh_v0.1.4_darwin_amd64.tar.gz(macOS Intel)refresh_v0.1.4_darwin_arm64.tar.gz(macOS Apple Silicon)refresh_v0.1.4_linux_amd64.tar.gz(Linux x64)refresh_v0.1.4_windows_amd64.tar.gz(Windows x64)
- Extract and move to your PATH:
# Example for macOS/Linux tar -xzf refresh_v0.1.4_darwin_arm64.tar.gz sudo mv refresh /usr/local/bin/ chmod +x /usr/local/bin/refresh
π§ Build from Source
If you have Go installed:
# Clone the repository
git clone https://github.com/dantech2000/refresh.git
cd refresh
# Build and install
go build -o refresh .
sudo mv refresh /usr/local/bin/
# Or install directly
go install github.com/dantech2000/refresh@latest
β Verify Installation
After installation, verify it works:
refresh version
refresh --help
You should see output showing the version and available commands.
π Updating
To update to the latest version:
# If installed via Homebrew
brew update && brew upgrade refresh
# If installed via go install
go install github.com/dantech2000/refresh@latest
# If manually installed, download the latest release and replace the binary
Usage
List Nodegroups
List all managed nodegroups in a cluster, showing their status and AMI state:
go run main.go list --cluster <cluster-name>
# Filter nodegroups using partial name matching
go run main.go list --cluster <cluster-name> --nodegroup <partial-name>
Example output:
development-blue
βββ dev-blue-groupD-20230814214633237700000007
β βββ Status: ACTIVE
β βββ Instance Type: t3a.large
β βββ Desired: 15
β βββ Current AMI: ami-0ce9a7e5952499323
β βββ AMI Status: β Outdated
βββ dev-blue-groupE-20230815204000720600000007
β βββ Status: ACTIVE
β βββ Instance Type: t3a.large
β βββ Desired: 16
β βββ Current AMI: ami-0ce9a7e5952499323
β βββ AMI Status: β Outdated
βββ dev-blue-groupF-20230815230923929900000007
βββ Status: ACTIVE
βββ Instance Type: t3a.large
βββ Desired: 14
βββ Current AMI: ami-0ce9a7e5952499323
βββ AMI Status: β Outdated
β Latest: Nodegroup is using the latest recommended AMI for the clusterβ Outdated: Nodegroup AMI is not the latestβ οΈ Updating: Nodegroup is currently being updated (status and AMI status both show this)
Update AMI for Nodegroups
Trigger a rolling update to the latest AMI for all or a specific nodegroup:
# Update all nodegroups
go run main.go update-ami --cluster <cluster-name>
# Update a specific nodegroup
go run main.go update-ami --cluster <cluster-name> --nodegroup <nodegroup-name>
# Update nodegroups using partial name matching
go run main.go update-ami --cluster <cluster-name> --nodegroup <partial-name>
# Force update (replace all nodes, even if already latest)
go run main.go update-ami --cluster <cluster-name> --force
Example output:
# Single nodegroup update
$ go run main.go update-ami --cluster development-blue --nodegroup groupF
Updating nodegroup dev-blue-groupF-20230815230923929900000007...
Update started for nodegroup dev-blue-groupF-20230815230923929900000007
# Multiple matches with confirmation
$ go run main.go update-ami --cluster development-blue --nodegroup group
Multiple nodegroups match pattern 'group':
1) dev-blue-groupD-20230814214633237700000007
2) dev-blue-groupE-20230815204000720600000007
3) dev-blue-groupF-20230815230923929900000007
Update all 3 matching nodegroups? (y/N): y
Updating nodegroup dev-blue-groupD-20230814214633237700000007...
Update started for nodegroup dev-blue-groupD-20230814214633237700000007
Updating nodegroup dev-blue-groupE-20230815204000720600000007...
Update started for nodegroup dev-blue-groupE-20230815204000720600000007
Updating nodegroup dev-blue-groupF-20230815230923929900000007...
Update started for nodegroup dev-blue-groupF-20230815230923929900000007
Partial Name Matching:
Both --cluster and --nodegroup flags support partial name matching to make it easier to work with long names:
Cluster Matching:
--cluster developmentmatchesdevelopment-blue,development-prod, etc.--cluster bluematchesdevelopment-blue,staging-blue, etc.
Nodegroup Matching:
--nodegroup groupFmatchesdev-blue-groupF-20230815230923929900000007--nodegroup monolithmatches all nodegroups containing "monolith"--nodegroup 20230815matches all nodegroups created on that date
When multiple items match, the tool will show all matches and ask for confirmation before proceeding.
List Command Filtering:
You can also filter the list output using the same partial matching:
# Show only nodegroups containing "group"
$ go run main.go list --cluster development-blue --nodegroup group
development-blue
βββ dev-blue-groupD-20230814214633237700000007
β βββ Status: ACTIVE
β βββ AMI Status: β Outdated
βββ dev-blue-groupE-20230815204000720600000007
β βββ Status: ACTIVE
β βββ AMI Status: β Outdated
βββ dev-blue-groupF-20230815230923929900000007
βββ Status: ACTIVE
βββ AMI Status: β Outdated
# Show only monolith nodegroups
$ go run main.go list --cluster development-blue --nodegroup monolith
development-blue
βββ dev-blue-monolithD-20230816000007673100000007
βββ dev-blue-monolithE-20230816002441701900000007
When multiple nodegroups match in update commands, the tool will show all matches and ask for confirmation before proceeding.
Release Process
Prerequisites
- Ensure you have push access to both repositories:
dantech2000/refresh(main repository)dantech2000/homebrew-tap(Homebrew tap)
- GitHub Personal Access Token (
GH_PAT) is configured in repository secrets - GoReleaser is installed locally for testing
Release Steps
-
Update Version Number
Update the version in
main.go:var versionInfo = VersionInfo{ Version: "v0.1.3", // <- Update this version Commit: "", BuildDate: "", } -
Run Pre-Release Checks
# Full development check (format, lint, test, build) task dev:full-check # Test GoReleaser configuration task release:test # Optional: Dry run of release process (local only) task release:dry-run -
Validate Setup
# Check if ready for release task release:check # Validate Homebrew formula syntax task tap:validate -
Create and Push Release Tag
# Create tag and push (triggers GitHub Actions) task release:tag VERSION=v0.1.3 # Or manually: git tag -a v0.1.3 -m "Release v0.1.3" git push origin v0.1.3 -
Monitor Release Process
After pushing the tag:
- GitHub Actions will automatically trigger
- GoReleaser will build binaries for all platforms
- GitHub release will be created with artifacts
- Homebrew formula will be updated in
homebrew-taprepository - Users can install with:
brew install dantech2000/tap/refresh
Useful Task Commands
# Development workflow
task dev:quick-test # Format, vet, build, test version
task dev:full-check # Full check including lint and tests
# Release workflow
task release:check # Verify ready for release
task release:test # Test GoReleaser config (no release)
task release:dry-run # Full dry run (local only)
task release:tag VERSION=v0.1.x # Create and push release tag
# Testing
task run:version # Test version command
task run:list # Test list command
task run:help # Show help
# Homebrew tap
task tap:validate # Validate formula syntax
task tap:test-local # Instructions for local testing
# Utilities
task clean # Clean build artifacts
task deps # Download and tidy dependencies
Post-Release Verification
After a successful release:
- Check GitHub Release: Verify release appears with all artifacts
- Test Homebrew Installation: Follow the Installation instructions to test the Homebrew tap
- Verify Version: Run
refresh versionto confirm the new version is available - Update Documentation: If needed, update examples in README
Troubleshooting
- Build Failures: Run
task release:testto check GoReleaser config - Permission Issues: Verify
GH_PATtoken has correct permissions - Homebrew Formula Issues: Run
task tap:validateto check syntax - Version Conflicts: Ensure version in
main.gomatches git tag
Project Status & Health
The badges at the top of this README provide a quick overview of the project's health:
| Badge | What It Shows | What to Watch For |
|---|---|---|
| Release | Latest version number | New releases, version progression |
| Build Status | GitHub Actions workflow status | β Green = builds passing, β Red = build issues |
| Go Report Card | Code quality grade (A+ to F) | Aim for A+ rating, watch for downgrades |
| Go Version | Minimum Go version required | Compatibility with current Go releases |
| License | Project license (MIT) | License compliance information |
| Stars | GitHub stars count | Community interest and growth |
| Homebrew | Homebrew installation availability | Package distribution status |
Quick Health Check
- Green Build Badge β = Latest code builds successfully, releases work
- A+ Go Report β = Code quality is excellent
- Current Go Version β = Using modern Go features and best practices
Dependency Management
This project includes automated dependency management:
- Dependabot - Automated dependency updates with security patches
Security
- Does not log or store credentials
- Sanitizes input parameters
This is a work in progress...
Documentation
ΒΆ
There is no documentation for this package.