Installation Guide for kubectl, oc, git, helm and ansible on MS Windows using WSL
Install WSL
- Open PowerShell as Administrator and run:
wsl --install
WSL will install a Ubuntu Linux distribution.
- Restart your computer if prompted.
Set up WSL
- Open WSL application, and provide default user and password
Ubuntu is already installed.
Starting Ubuntu...
...
Enter new UNIX username: demo
New password:
Retype new password:
passwd: password updated successfully
Install Packages
- Update and install packages
sudo apt -y update
sudo apt -y upgrade
- Install packages
sudo apt -y install ansible git openjdk-17-jre-headless python3-pip python3-kubernetes python3-requests python3-yaml
- Install kubectl and oc
curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz"
tar -xzvf openshift-client-linux.tar.gz
chmod +x oc
chmod +x kubectl
sudo mv oc kubectl /usr/local/bin/
- Install ansible kubernetes.core
ansible-galaxy collection install kubernetes.core
Install git, ansible, helm
- Add the Helm dependencies:
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt update
sudo apt install helm
Verify
- Verify the installation:
git --version
- Verify the installation:
oc version
- Verify the installation:
kubectl version
- Verify the installation:
ansible --version
- Verify the installation:
helm --version
- Verify the installation:
keytool