Bird
0
0

Which of the following commands correctly downloads the latest stable kubectl binary for Linux and makes it executable?

easy📝 Syntax Q12 of 15
Kubernetes - Fundamentals
Which of the following commands correctly downloads the latest stable kubectl binary for Linux and makes it executable?
Acurl -O https://kubernetes.io/download/kubectl && chmod +x kubectl
Bwget https://kubectl.io/latest && chmod 777 kubectl
Ccurl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
Dapt-get install kubectl && chmod +x /usr/bin/kubectl
Step-by-Step Solution
Solution:
  1. Step 1: Identify the official download URL and command

    curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl uses the official Kubernetes release URL with a command to get the latest stable version dynamically and downloads the Linux amd64 binary.
  2. Step 2: Check command correctness and permissions

    curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl also correctly applies chmod +x to make the binary executable. Other options use incorrect URLs or commands.
  3. Final Answer:

    curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl -> Option C
  4. Quick Check:

    Official URL + chmod +x = A [OK]
Quick Trick: Use official Kubernetes URLs with curl and chmod +x [OK]
Common Mistakes:
  • Using wrong URLs that don't point to kubectl binaries
  • Forgetting to make the binary executable
  • Using package managers that don't have kubectl

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes