diff options
author | shreyagupta30 <shreyagupta3011@gmail.com> | 2021-09-27 14:35:36 +0530 |
---|---|---|
committer | shreyagupta30 <shreyagupta3011@gmail.com> | 2021-10-11 23:16:53 +0530 |
commit | eef9fef1141c6295b824b884ad86d645cd1c094f (patch) | |
tree | 1d1b6a8b08015eb190bb6cfbd56536ac4f10ad2d /docs/k8s | |
parent | 17e20bfa70d1a9ce5e6ee6687245e3e22f3633a8 (diff) |
Automated deployment of helm charts with python
This patch adds demo helm charts and a python script that automatically deploys any helm chart of user's choice and print all the useful information about the chart.
Signed-off-by: Shreya Gupta <shreyagupta3011@gmail.com>
Change-Id: I06e3a8012602e09f601f70def386ef267c870e94
Diffstat (limited to 'docs/k8s')
-rw-r--r-- | docs/k8s/helm.rst | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/docs/k8s/helm.rst b/docs/k8s/helm.rst new file mode 100644 index 00000000..add15a7b --- /dev/null +++ b/docs/k8s/helm.rst @@ -0,0 +1,137 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) Anuket, Spirent, AT&T, Ixia and others. + +.. Anuket ViNePerf Documentation master file. + +============================================================ +Automated deployment of helm charts with python +============================================================ + +******************** +Directory Structure +******************** +.. code-block:: console + + + ├── charts + │ ├── mynet.yaml + │ ├── pod.yaml + │ ├── proxchart + │ │ ├── Chart.yaml + │ │ ├── templates + │ │ │ ├── daemonset.yaml + │ │ │ ├── deployment.yaml + │ │ │ └── service.yaml + │ │ └── values.yaml + │ ├── testpmdchart + │ │ ├── Chart.yaml + │ │ ├── templates + │ │ │ ├── daemonset.yaml + │ │ │ ├── deployment.yaml + │ │ │ └── service.yaml + │ │ └── values.yaml + │ └── trexchart + │ ├── Chart.yaml + │ ├── templates + │ │ ├── daemonset.yaml + │ │ ├── deployment.yaml + │ │ └── service.yaml + │ └── values.yaml + └── pyscript + ├── Pipfile + ├── Pipfile.lock + └── main.py + + +*************** +Using the tool +*************** + +Charts folder contains three different charts - ``proxchart, testpmd chart and trex chart``. Any of the one can be used for testing. +Pyscript folder contains ``main.py`` - the main python script that depploys the helm chart of user's choice and returns important configuration of the charts, such as PodIP, Cluster IP, Interface IPs etc. + +************************ +Important Configurations +************************ + +In order to run the python script, we need to install Pipenv to create virtual environment. + +Steps: + +1. Install + +.. code-block:: console + + pip install --user pipenv + +2. To activate the environment + +.. code-block:: console + + pipenv shell + +The last command will automatically read Pipfile.lock and will create an virtual environment. + +Once this configuration is done. We can move on to run our python script. + +************************************************* +Procedure to automatically deploy the helm chart +************************************************* + +Steps: + +1. After activating your virtual environment, run the ``main.py``. + +.. code-block:: console + + python main.python + +2. Enter the location of the chart you want to deploy. + +For example, lets deploy proxchart + +.. code-block:: console + + Enter the location of helm chart: ../charts/proxchart + +3. The last command will execute the entire ``main.py`` and will return all the required information about the chart. + +******* +Output +******* + +.. code-block:: console + + Status of helm charts + + NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION + proxchart default 1 2021-09-27 13:22:21.864816 +0530 IST deployed proxchart-0.1.0 1.0 + ---------------------------------------------------------------------------------------------------- + + POD DETAILS + + ┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳ + ┃ POD NAME ┃ NAMESPACE ┃ HOST-IP ┃ PHASE ┃ POD-IP ┃ POD-IPs ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ prox-6db7c6dc9b-l42v4 │ default │ 192.168.49.2 │ Running │ 172.17.0.4 │ [{'ip': '172.17.0.4'}] │ + └───────────────────────┴───────────┴──────────────┴─────────┴────────────┴────────────────────────┴ + ┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ POD NAME ┃ INTERFACE IPs ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ prox-6db7c6dc9b-l42v4 │ 127.0.0.1/8, 172.17.0.4/16, 127.0.0.1, 172.17.0.4, 172.17.255.255 │ + └───────────────────────┴───────────────────────────────────────────────────────────────────┘ + + DEPLOYMENT DETAILS + + ┏━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓ + ┃ NAME ┃ Type ┃ CLUSTER-IP ┃ EXTERNAL-IP ┃ PORT(S) ┃ + ┡━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩ + │ proxchart │ NodePort │ 10.103.156.83 │ {} │ 8081:31036/TCP │ + └───────────┴──────────┴───────────────┴─────────────┴────────────────┘ + +******************** +Future Enhancements +******************** + +In future, more information can be extracted by adding new functions to the file. The process of getting interfaces using regex can be made more proficient.
\ No newline at end of file |