Installation Guide for kubectl, oc, git, helm and ansible on Redhat Linux/Fedora/CentOS
Install kubectl and oc
- Download the latest release:
curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz"
- Extract the tar file:
tar -xzvf openshift-client-linux.tar.gz
- Move the binaries to your PATH:
chmod +x oc
chmod +x kubectl
sudo mv oc kubectl /usr/local/bin/
- Install the dependencies:
sudo dnf install -y python3.13 python3.13-pip helm java-21-openjdk git
- Change default python in
sudo alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1
sudo alternatives --set python3 /usr/bin/python3.13
- Install the ansible:
sudo dnf install -y ansible-core
- Install Python Libraries
pip3.13 install kubernetes requests ansible-core
- Install kubernetes.core module
ansible-galaxy collection install kubernetes.core
Verify
- Verify the installation:
git --version
- Verify the installation:
oc version
- Verify the installation:
kubectl version
- Verify the installation:
ansible --version
- Verify the installation:
keytool