From e7affdd106d56eade1cafc6d8d21789dbb56949c Mon Sep 17 00:00:00 2001 From: FelixFehse Date: Wed, 10 Apr 2024 17:27:20 +0200 Subject: [PATCH] IL-421 Kubernetes notes --- .../issue_classification_user_journey.ipynb | 21 ++++++++++++++++-- .../requirements.txt | Bin 26862 -> 26512 bytes 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/examples/issue_classification_user_journey.ipynb b/src/examples/issue_classification_user_journey.ipynb index e011c0708..647e74858 100644 --- a/src/examples/issue_classification_user_journey.ipynb +++ b/src/examples/issue_classification_user_journey.ipynb @@ -743,7 +743,7 @@ "- Setup Pulumi\n", "- Check that it is working\n", "\n", - "### Enviroment variables\n", + "### Environment variables\n", "TODO: Describe how to set environment variables \n", "\n", "### FastAPI service\n", @@ -770,8 +770,25 @@ "poetry export --without-hashes --format=requirements.txt > requirements.txt\n", "\n", "### Kubernetes\n", - "\n" + "\n", + "- Install `minikube`, see e.g. [here](https://minikube.sigs.k8s.io/docs/start/)\n", + "- `minikube start`\n", + "- Setup current shell to use minikube's docker daemon: `eval $(minikube -p minikube docker-env)`\n", + "- build docker container as above\n", + " - check if docker image exists:\n", + " - `minikube ssh`\n", + " - `docker image ls`, you should see it listed.\n", + "- Start Kubernetes : `kubectl apply -f classification_deployment.yaml`\n", + "- list all Kubernetes pods: `kubectl get pods -A`\n", + "- forward port: `kubectl port-forward banana-7f84bb87d9-dk4ww 8000:80` Note: you will have to specify the exact pod name (here: `banana-7f84bb87d9-dk4ww`)\n", + "- Check, if you can access `localhost:8000`.\n", + " - check `curl -X POST localhost:8000/classify --json '{\"chunk\": \"long text\", \"labels\": [\"abc\", \"def\"]}'`\n" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] } ], "metadata": { diff --git a/src/examples/issue_classification_user_journey/requirements.txt b/src/examples/issue_classification_user_journey/requirements.txt index 6c27f5a4d34ace0d50f8618352abff806b61aaa2..69815505dc5219443552d5d71cca45583af0cfcf 100644 GIT binary patch delta 768 zcmXAnUr19?9LJfNm5SA>X=ZDhnU!#c3tKgM zw^^)ilbEg;<+-DL&9!-!XOOX7!`vRinJkR4~BL0t;Au)l>KG@^VhPF$|E@U#~9sj;42?gx_l&&oKZ zRf0EF2L5WvTy>PbL(;0T2-iqT4o8?ctP$|qEO<>G9npDw%uW8$e&qn)j{eItsl7YL zMamf`{>|LHJ~2eoNy*|#lP9Ni%V!hyiLv6->MJV!1{3}WEwy2mY7@vaF)HdLlXd#o zrL$fK{pTdEK!lNiiSN9@%=rl2^(MdSqsR*;o(9RAhGB(zmx~%J7ZXG;Me$x1W0RK? z4!W<5> z9CjBcV`^@KxWGAx#sjm&?E^E!A)%cp6n!FYh~{}J+0?tQIEQ>?^THGA*YCIUKS|@I)P;(^# z4*Lnvb~QibL^#hU!ZRlcT;W-fjBJw{1=~x0!7Fr#XG6*}QtmW4`;ju{S0kzP*7&vf zwEMh5PpGL&A0f4w{+g$X^<@OIS4XbXQ>+$UI&=#5Ui-+eIx`;nl}Pu04M~$S!KF;h z)tm*rljSB3A4PVF9zISz@@leCvziTU&fzO_p!<(KA&PS`(TQAs#(9{8HxC`F4Jy`} zkK9my^WXT@=i`fh_4EWfRU7bus10iN&G3@c=t+1h3g9$X0H-V?yw{AB%WFO*<>WYKvjvD;}5NW9t(P2nLxxTj?DuiNfKTQf%wWaQH(R?x`<_ zov$1#*DA2WRibCEQqC4DZwtwWt!g7#QPnM4wN=X>x5u-eRX6zug!^5M+owiBxOr;pTw=uP7YwlBR5|-v2OCR0rud~E33|_B#+(Hy9TvP3eFM1J zfHz}p1a}&dviIBqF}4Zy3r!e+E&L*{@{%tGV3NL_b zJk4#W*=c)6oNh;3#t!(bcOYB44SLrGhrv!z+yy$ju&eFHpR?YLKcwd(dfw+bd