Skip to content

Proyecto de la asignatura de Administración de Sistemas

License

Notifications You must be signed in to change notification settings

Xabierland/AS-Proyecto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AS-Proyecto

Proyecto de la asignatura de Administración de Sistemas 2023-2024

Indice

Introducción

La tarea propuesta es la de crear una aplicación web funcional con temática libre.

En mi caso he decidido crear una aplicación web que permita publicar y ver anuncios de autos de segunda mano.

Tareas

  • Desarrollar una aplicacion web.
    • Usable desde un navegador.
    • Los datos de la BBDD deben almacenarse fuera, en un contenedor.
  • Crear imágenes Docker propias.
    • Se deben subir a Docker Hub.
  • Crear un entorno Docker Compose.
  • Despliegue Kubernetes equivalente
  • Incluir más funcionalidades en la aplicación mediante imágenes adicionales
  • Utilizar funcionalidades Docker/Kubernetes no vistas en clase

Funcionamiento

Docker

Iniciamos el entorno

docker-compose up -d --build

Subir la imagenes a Docker Hub

# Web
docker tag docker-web xabierland/web
docker push xabierland/web
# Postgres
docker tag docker-sgbd xabierland/sgbd
docker push xabierland/sgbd
# Adminer
docker tag adminer xabierland/sabd
docker push xabierland/sabd
# Robot
docker tag docker-robot xabierland/robot
docker push xabierland/robot
# Vault
docker tag docker-vault xabierland/vault
docker push xabierland/vault

Kubernetes

Iniciar el cluster

minikube start

Colocarnos en el contexto

docker context use default

Instalar Addons

minikube addons enable ingress
minikube addons enable metrics-server

Ejecutar el dashboard

minikube dashboard

Crear los objetos

#Network
kubectl apply -f ingress.yaml
#Web
kubectl apply -f web-deployment.yaml
kubectl apply -f web-service.yaml
kubectl apply -f web-volume.yaml
kubectl apply -f web-rvolume.yaml
#SGBD
kubectl apply -f sgbd-deployment.yaml
kubectl apply -f sgbd-service.yaml
kubectl apply -f sgbd-volume.yaml
kubectl apply -f sgbd-rvolume.yaml
#Robot
kubectl apply -f robot-deployment.yaml
#SABD
kubectl apply -f sabd-deployment.yaml
kubectl apply -f sabd-service.yaml
#Vault
kubectl apply -f vault-deployment.yaml
kubectl apply -f vault-service.yaml

Borrar los objetos

#Network
kubectl delete -f ingress.yaml
#Web
kubectl delete -f web-deployment.yaml
kubectl delete -f web-service.yaml
kubectl delete -f web-volume.yaml
kubectl delete -f web-rvolume.yaml
#SGBD
kubectl delete -f sgbd-deployment.yaml
kubectl delete -f sgbd-service.yaml
kubectl delete -f sgbd-volume.yaml
kubectl delete -f sgbd-rvolume.yaml
#Robot
kubectl delete -f robot-deployment.yaml
#SABD
kubectl delete -f sabd-deployment.yaml
kubectl delete -f sabd-service.yaml
#Vault
kubectl delete -f vault-deployment.yaml
kubectl delete -f vault-service.yaml

Creamos el tunnel

minikube tunnel

Claves

Vault

Root token

hvs.jV0Y7m6ImuCwy9TXKuXCR5G5

Key

bNu6he+xaP510PFl7VALlZg2VSHgIGtcmFcUEIxwgCc=

APICAR

API Tokem

4d9d4ae7-2417-40ff-a602-03de4ec72a7a

API Secret

66b013d96ec7b28c526ebaf6da65dd44

SGBD

Host

sgbd

Database

db

Usuario

xabier

Contraseña

D#ZnA3qM@58kK%g!TyWAQUrt