Skip to content

Conversation

@rackerchris
Copy link
Contributor

feat: Add install_kubectl.sh script with version override, dry-run, and persistence

This commit introduces a new utility script, install_kubectl.sh, designed to simplify and standardize the installation and management of the kubectl binary across different environments.

The script ensures the version of kubectl used matches the target Kubernetes cluster version by:

  1. Auto-Detection: Automatically determining the cluster version via the API server if a functional kubectl is available.
  2. Version Override: Allowing the target version (e.g., 1.29.1 or v1.29.1) to be explicitly passed as a command-line argument.
  3. Permission Persistence: Reading and preserving the owner, group, and file permissions of an existing /usr/local/bin/kubectl binary upon replacement, falling back to root:root and 0755 for new installations.
  4. Safety: Including a Dry-Run Mode (`--dry-run') to simulate all installation steps before making system changes.

@cloudnull cloudnull merged commit 4ece0e1 into rackerlabs:main Nov 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants