- Es una app que nace con el fin de practicar la dockerizacion, la orquestacion y el CI/CD.
- La app esta compuesta de ReactJs - NodeJS - Mongo - Nginx - Docker - K8S - CI/CD
- Se puede correr la app con
docker-compose
y/ominikube
- Al correrla con
docker-compose
cuenta con un contenedor Nginx con el objectivo de hacerreverse-proxy
hacia los contenedores ReactJs o NodeJs; de esta manera se asegura la convivencia de los distintos request, bien sea condocker-compose
y/ominikube
- La base de dato Mongo, importa automatico bien sea en el
docker-compose
y/ominikube
, datos de prueba. - Al usar minikube, se puede tener acceso al Kubernetes Dashboard , en el se puede visualizar todos los services, pods, namespaces, configmap, dinamicas, etc... se puede utilizar el boton 'skip' para saltarse el token del login.
- El CI/CD se utiliza con github actions, el cual cumple la funcion de hacer login en dockerhub y actualizar las imagenes, siempre y cuando exista cambio en la carpeta respectiva.
- Instalarse Docker Engine 🔥
- Ir a la raiz del proyecto y ejecutar =>
docker-compose build
- Ir a la raiz del proyecto y ejecutar =>
docker-compose up -d
- Ir a la app App
- Empezar a leer código, interpretar funcionalidades y programar 😄
- Instalarse Docker Engine 🔥
- Instalarse Minikube 🔥
- Ir a la raiz del proyecto y ejecutar =>
minikube start
- Ir a la raiz del proyecto y ejecutar =>
minikube addons enable ingress
(Habilita el usar ingress para redirigir el trafico a los distintos servicios) - Ejecutar
minikube ip
, retorna la ip del cluster de K8S (Ej: 192.168.49.2). Copiarla e ir al archivohosts
y anadir el DNS para poder probar la app y el DNS para el dashboard, ya que el servicio ingress no funciona por IP sino por DNS.cd /etc/
luegosudo nano hosts
. Agregar<IP COPIADA> rnmn.dev
y<IP COPIADA> kb.dev
- Ir a la raiz del proyecto y ejecutar en el siguiente orden:
kubectl apply -f configmap.yaml
kubectl apply -f mongo-depl.yaml
kubectl apply -f node-depl.yaml
kubectl apply -f react-depl.yaml
kubectl apply -f dashboard-depl.yaml
kubectl apply -f ingress-srv.yaml
kubectl apply -f dashboard-ingress-srv.yaml
- Ejecutar
kubectl get all
, se veran todos los deployments, pods, services y replicas. - Ir a la app App
- Empezar a leer código, interpretar funcionalidades y programar 😄
- It is an app that was created in order to practice dockerization and orchestration CI/CD.
- The app is made up of ReactJs - NodeJS - Mongo - Nginx - Docker - K8S - CI/CD
- You can run the application with
docker-compose
and / orminikube
- When running with
docker-compose
it has an Nginx container with the objective of doingreverse-proxy
towards the ReactJs or NodeJs containers; in this way the coexistence of the different requests is ensured, either withdocker-compose
and / orminikube
- The Mongo database, imports automatically either in the
docker-compose
and / orminikube
, test data. - By using minikube, you can access the Kubernetes Dashboard, where you can view all the services, pods, namespaces, configmap, dynamics, etc ... you can use the 'skip' button to skip the login token.
- The CI / CD is used with github actions, which fulfills the function of logging into dockerhub and updating the images, as long as there is a change in the respective folder.
- Install Docker Engine 🔥
- Go to the root of the project and run =>
docker-compose build
- Go to the root of the project and run =>
docker-compose up -d
- Go to the app App
- Start reading code, interpreting functionalities and programming: smile:
- Install Docker Engine: fire:
- Install Minikube: fire:
- Go to the root of the project and execute =>
minikube start
- Go to the root of the project and execute =>
minikube addons enable ingress
(Enables using ingress to redirect traffic to the different services) - Execute
minikube ip
, it returns the IP of the K8S cluster (Ex: 192.168.49.2). Copy it and go to thehosts
file and add the DNS to be able to test the app and the DNS for the dashboard, since the ingress service does not work by IP but by DNS.cd / etc /
thensudo nano hosts
. Add<COPIED IP> rnmn.dev
and<COPIED IP> kb.dev
- Go to the root of the project and execute in the following order:
kubectl apply -f configmap.yaml
kubectl apply -f mongo-depl.yaml
kubectl apply -f node-depl.yaml
kubectl apply -f react-depl.yaml
kubectl apply -f dashboard-depl.yaml
kubectl apply -f ingress-srv.yaml
kubectl apply -f dashboard-ingress-srv.yaml
- Run
kubectl get all
, you will see all the deployments, pods, services and replicas. - Go to the app App
- Start reading code, interpreting functionalities and programming: smile: