Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/
sudo apt-get update
sudo apt-get install -y python3-pip apt-transport-https kubectl
```
# 1. Download the latest version of kubectl
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

# 2. Make it executable
chmod +x kubectl

# 3. Move it to a directory in your PATH
sudo mv kubectl /usr/local/bin/

# 4. Verify installation
kubectl version --client
Comment on lines +28 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid double-installing kubectl & add checksum verification

The manual install block downloads a second copy of kubectl right after the one that apt-get install kubectl pulled in (line 26). Keeping both copies introduces version drift and can break future apt upgrade operations. Pick one installation path (apt or manual), or clearly mark the second as an alternative.

If you keep the manual route, follow the upstream docs and verify the SHA-256 (or GPG) signature before moving the binary into a privileged directory:

-# 1. Download the latest version of kubectl
-curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
-# 2. Make it executable
-chmod +x kubectl
-# 3. Move it to a directory in your PATH
-sudo mv kubectl /usr/local/bin/
-# 4. Verify installation
-kubectl version --client
+# Alternative: manual install of the latest binary
+# Comment out the `apt-get install kubectl` line above if you use this path.
+RELEASE=$(curl -Ls https://dl.k8s.io/release/stable.txt)
+curl -LO "https://dl.k8s.io/$RELEASE/bin/$(uname -s | tr '[:upper:]' '[:lower:]')/$(uname -m)/kubectl"
+curl -LO "https://dl.k8s.io/$RELEASE/bin/$(uname -s | tr '[:upper:]' '[:lower:]')/$(uname -m)/kubectl.sha256"
+echo "$(cat kubectl.sha256)  kubectl" | sha256sum --check
+chmod +x kubectl
+sudo mv kubectl /usr/local/bin/
+kubectl version --client

This removes the duplicate install and ensures integrity of the downloaded binary.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# 1. Download the latest version of kubectl
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
# 2. Make it executable
chmod +x kubectl
# 3. Move it to a directory in your PATH
sudo mv kubectl /usr/local/bin/
# 4. Verify installation
kubectl version --client
# Alternative: manual install of the latest binary
# Comment out the `apt-get install kubectl` line above if you use this path.
RELEASE=$(curl -Ls https://dl.k8s.io/release/stable.txt)
curl -LO "https://dl.k8s.io/$RELEASE/bin/$(uname -s | tr '[:upper:]' '[:lower:]')/$(uname -m)/kubectl"
curl -LO "https://dl.k8s.io/$RELEASE/bin/$(uname -s | tr '[:upper:]' '[:lower:]')/$(uname -m)/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

29-29: Bare URL used

(MD034, no-bare-urls)


29-29: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In README.md lines 28 to 38, the current instructions manually download kubectl
even if it was installed via apt-get, causing duplicate installations and
potential version conflicts. To fix this, either remove the manual download
steps if apt-get is used or clearly label the manual installation as an
alternative method. If keeping the manual method, add a step to verify the
SHA-256 checksum or GPG signature of the downloaded kubectl binary before moving
it to /usr/local/bin to ensure its integrity.


```
pip3 install awscli --upgrade
Expand Down