Skip to content
Snippets Groups Projects
Commit ea89e464 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

Add new fileAdd instructions for creating a virtual environment for working...

Add new fileAdd instructions for creating a virtual environment for working with Kubernetes using Python and kubectl to README file.
parent 7962daab
Branches main
No related tags found
No related merge requests found
README
======
This repository provides instructions for creating a virtual environment for working with Kubernetes using Python and `kubectl`.
Prerequisites
-------------
Before you begin, make sure you have the following installed:
- Python 3
- `pip` package manager
- `curl` command-line tool
Installation
------------
1. Open a terminal and navigate to the directory where you want to create your virtual environment.
2. Run the following command to create a new virtual environment named `k8s-env`:
bashCopy code
`python -m venv k8s-env`
3. Activate the virtual environment:
bashCopy code
`source k8s-env/bin/activate`
4. Install the kubernetes package with pip:
bashCopy code
`pip install kubernetes`
5. Download and install kubectl with the following commands:
bashCopy code
`curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/$(uname | tr '[:upper:]' '[:lower:]')/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/`
After following these steps, you should have a working environment for interacting with Kubernetes using Python and kubectl. To verify that your installation was successful, run the following command:
bashCopy code
`kubectl version`
This should display the version of kubectl that you just installed.
Usage
-----
To use the virtual environment, make sure it is activated:
bashCopy code
`source k8s-env/bin/activate`
You can then use the kubernetes package within Python, as well as the kubectl command-line tool, to interact with Kubernetes.
When you are finished working with the virtual environment, you can deactivate it with the following command:
bashCopy code
`deactivate`
This will return you to your normal shell environment.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment