Kubernetes CLI (Kubectl)
MacOS
Linux
Microsoft Windows
-
Using Homebrew (recommended):
-
Manual installation:
-
Make kubectl executable
-
Move kubectl to a directory in your PATH
-
Using package manager (Ubuntu/Debian):
-
Manual installation:
-
Make kubectl executable
Move kubectl to a directory in your PATH
-
Using Chocolatey® (recommended):
-
Manual installation:
-
Download kubectl
-
Move kubectl to the created directory
-
Add to PATH
Red Hat OpenShift® CLI (oc)
-
Using web console:
- Log into your OpenShift web console
- Click ? icon in the top right
- Select “Command Line Tools”
- Download Windows oc client
- Extract the archive
-
Create directory for OpenShift CLI
-
Move oc.exe to the created directory
-
Add to PATH
-
Using Homebrew:
-
Manual installation:
-
Log into your OpenShift web console
-
Click ? icon in the top right
-
Select “Command Line Tools”
-
Download macOS oc client
-
Extract the downloaded archive
- Manual installation:
- Log into your OpenShift web console
- Click ? icon in the top right
- Select “Command Line Tools”
- Download Linux oc client
- Extract the downloaded archive
Verification and Configuration
Verify the installations:
kubectl Configuration
Red Hat OpenShift Login
Store your OpenShift login token securely. You can get a new token from the OpenShift web console under your profile → Copy login command.
Shell Completion
Common Issues and Troubleshooting
If you’re behind a corporate proxy, you might need to configure proxy settings for both kubectl and oc.
Common troubleshooting steps:
Keep your CLI tools up to date with the cluster version to avoid compatibility issues. You can check the required versions in your cluster’s documentation.