Unfortunately there is no kubectl package under apk
alpine package manager but still, there is a way to install it. Let’s install kubectl on Alpine Linux.
Prerequisites
- Alpine Linux
- sudo privileges
Install Kubectl on Alpine Linux
Step 1. To download the latest version run.
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
Step 2. To download specific version change ${version}
part with your desired version.
curl -LO https://storage.googleapis.com/kubernetes-release/release/${version}/bin/linux/amd64/kubectl
Step 3. Give kubectl executable permissions.
chmod +x ./kubectl
Step 4. Move the binary in to the Alpine PATH.
mv ./kubectl /usr/bin/kubectl
Conclusion
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.