From 654fa6e4b1a9dde07aa5007f78af6b61189e54cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 23 Oct 2024 12:33:51 +0200 Subject: [PATCH] Add info to deploy README --- README.md | 23 ++++++++++- deploy_sample/README.md | 41 +++++++++++++++++++ ...loyment.yaml => 01-my-app-deployment.yaml} | 0 ....yaml => 02-my-app-service-node-port.yaml} | 0 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 deploy_sample/README.md rename deploy_sample/yaml/{01-hello-app-deployment.yaml => 01-my-app-deployment.yaml} (100%) rename deploy_sample/yaml/{02-hello-app-service-node-port.yaml => 02-my-app-service-node-port.yaml} (100%) diff --git a/README.md b/README.md index a1feb03..6a4c65f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # kubernetes-samples -Kubernetes use case samples \ No newline at end of file +Kubernetes use case samples + +All the samples are done using [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download) + +## Install minikube + +```bash +curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm +sudo rpm -Uvh minikube-latest.x86_64.rpm +``` + +## Install kubernetes client tools + +```bash +sudo dnf install kubernetes-client +``` + +### In Fedora is needed the dockerx plugin + +```bash +sudo dnf install docker-buildx-plugin +``` \ No newline at end of file diff --git a/deploy_sample/README.md b/deploy_sample/README.md new file mode 100644 index 0000000..ae77341 --- /dev/null +++ b/deploy_sample/README.md @@ -0,0 +1,41 @@ +# Deploy Sample + +## Set up + +```bash +minikube start +``` + +## Build and publish image + +```bash +cd app +./create_image.sh +docker image ls +cd .. +``` + +## Deploy + +```bash +cd yaml +kubectl apply -f 01-my-app-deployment.yaml +kubectl get all # This should show the 3 pods with status Running +``` + +## Start service and connect + +```bash +kubectl apply -f 02-my-app-service-node-port.yaml +kubectl get all # There should be a service called my-app-service as LoadBalancer +minikube service my-app-service # This should open a browser window with Hello World message +# If end the url with /ip the message should show the ip of the server that answered the petition +``` + +## Stop everything + +```bash +kubectl delete service my-app-service +kubectl delete deploy my-app-deployment +minikube stop +``` diff --git a/deploy_sample/yaml/01-hello-app-deployment.yaml b/deploy_sample/yaml/01-my-app-deployment.yaml similarity index 100% rename from deploy_sample/yaml/01-hello-app-deployment.yaml rename to deploy_sample/yaml/01-my-app-deployment.yaml diff --git a/deploy_sample/yaml/02-hello-app-service-node-port.yaml b/deploy_sample/yaml/02-my-app-service-node-port.yaml similarity index 100% rename from deploy_sample/yaml/02-hello-app-service-node-port.yaml rename to deploy_sample/yaml/02-my-app-service-node-port.yaml