Add info to deploy README
This commit is contained in:
23
README.md
23
README.md
@@ -1,3 +1,24 @@
|
|||||||
# kubernetes-samples
|
# kubernetes-samples
|
||||||
|
|
||||||
Kubernetes use case samples
|
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
|
||||||
|
```
|
41
deploy_sample/README.md
Normal file
41
deploy_sample/README.md
Normal file
@@ -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
|
||||||
|
```
|
Reference in New Issue
Block a user