You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- creazione Mysql su kubernetes in locale con Minikube:
62
+
```
63
+
kubectl apply -f ./kubernetes/mysql-pvc.yaml
64
+
kubectl apply -f ./kubernetes/mysql.yaml
66
65
67
-
- comandi di verifica
68
-
```
69
-
kubectl get events -A
70
-
71
-
kubectl get services
72
-
kubectl get pods
73
-
kubectl get pods --field-selector=status.phase=Pending
74
-
kubectl describe node mysql-xxxxxxxxxxxxxxx
66
+
kubectl describe pvc mysql-pvc
67
+
kubectl describe pvc mysql-pvc
68
+
kubectl describe deployment mysql-app
69
+
kubectl describe service mysql-service
70
+
```
71
+
- creazione backend
72
+
```
73
+
kubectl apply -f ./kubernetes/springboot-app.yaml
74
+
kubectl get services
75
+
```
75
76
76
-
mysql -h"mysql-service" -p"3306" -u"root" -p"alnaoMagnifico"
77
+
- comandi di verifica
78
+
```
79
+
kubectl get events -A
80
+
81
+
kubectl get services
82
+
kubectl get pods
83
+
kubectl get pods --field-selector=status.phase=Pending
84
+
kubectl describe node mysql-xxxxxxxxxxxxxxx
77
85
78
-
minikube service springboot-app --url
79
-
> http://192.168.49.2:31081
80
-
```
81
-
- nota: endpoint è mysql-service perchè il metadata del service
82
-
- nota2: porta è 3306 NON so il perchè ma è così, *perso un sacco di tempo per questo motivo*
83
-
- creazione frontend
84
-
```
85
-
kubectl apply -f ./kubernetes/frontend.yaml
86
-
kubectl get services
87
-
kubectl get pods
86
+
mysql -h"mysql-service" -p"3306" -u"root" -p"alnaoMagnifico"
88
87
89
-
minikube service frontend-bootstrap --url
90
-
> http://192.168.49.2:31082
91
-
> http://192.168.49.2:31083/api/persone
88
+
minikube service springboot-app --url
89
+
> http://192.168.49.2:31081
90
+
```
91
+
- nota: endpoint è mysql-service perchè il metadata del service
92
+
- nota2: porta è 3306 NON so il perchè ma è così, *perso un sacco di tempo per questo motivo*
93
+
- creazione frontend
94
+
```
95
+
kubectl apply -f ./kubernetes/frontend.yaml
96
+
kubectl get services
97
+
kubectl get pods
92
98
93
-
```
94
-
- nota: nella configuazione messo l'endpoint con localhost perchè il frontend è in javascript quindi client e viene eseguito sul browser, l'immagine docker del webserver non si collega direttamente al backend
95
-
- nota: c'è un proxy per evitare che il browser chiami direttamente il backend (conoscendo l'url), cioè il browser chiama `<frontend>/api/persone` che poi viene indirizzato a `<backend>/api/persone`
- Cancellazione di tutte le componenti su minikube
111
-
```
112
-
kubectl delete configmap frontend-config
113
-
kubectl delete service frontend-bootstrap
114
-
kubectl delete deployment frontend-bootstrap
99
+
minikube service frontend-bootstrap --url
100
+
> http://192.168.49.2:31082
101
+
> http://192.168.49.2:31083/api/persone
102
+
103
+
```
104
+
- nota: nella configuazione messo l'endpoint con localhost perchè il frontend è in javascript quindi client e viene eseguito sul browser, l'immagine docker del webserver non si collega direttamente al backend
105
+
- nota: c'è un proxy per evitare che il browser chiami direttamente il backend (conoscendo l'url), cioè il browser chiama `<frontend>/api/persone` che poi viene indirizzato a `<backend>/api/persone`
- Sui file creati da HEML nel `Chart.yaml` e nelle sottocartella avevano il punto `.` al posto del nome dell'applicazione, ho dovuto sistemare i file a mano (sia Chart.yaml che tutti i file dentro template che avevano dei `..`) *ho perso ore per questo problema*.
427
+
- Funziona anche se il microservizio non parte perchè non riesce a collegarsi al DB, *semplicemente perchè non esiste nessun DB in questo esempio*.
- verificare che è stato tutto rimosso: ECR, EKS, VPC, Subnet, EC2, ALB, ASG e il cluster EKS "aws-j-es03-eks-cluster-helm"
432
441
433
442
434
443
# IA
@@ -467,6 +476,7 @@ Ciao vorrei creare un microservizio in java spring boot che esegue un crud su un
467
476
- ciao mi spieghi cosa è argo e come lo posso usare con Kubernetes?
468
477
- vorrei provare argo e helm in un mio progetto kubernetes dove ho un microservizio in java spring boot, dammi l'elenco di tutti i passi che devo fare
469
478
- immagina che voglio eseguire tutto questo su AWS, il mio repository è "https://github.com/alnao/JavaSpringBootExample/tree/master/Esempio03dbDockerAWS"
479
+
- lavorato molto su alcuni errori di Helm e AWS ma poi andato tutto
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,12 @@
8
8
# Progetti:
9
9
-**Esempio01base**: esempio base con singola API, Docker-file per eseguire il servizio in immagine docker e su Kubernetes/Minikube
10
10
-**Esempio02db**: esempio di CRUD con una tabella *articoli* su MySql, Docker-compose per eseguire il micro-servizio e il DMBS su docker
11
-
-**Esempio03dbDockerAWS**: esempio di CRUD con tabella *persone* su MySql, con microservizio e microfrontend, eseguiti con docker-compose e minikube, *a breve anche su AWS*
11
+
-**Esempio03dbDockerAWS**: esempio di CRUD con tabella *persone* su MySql, con microservizio e microfrontend in javascript di esempio
12
+
- il backend e il frontend sono disponibili su DockerHub a `https://hub.docker.com/repositories/alnao`
13
+
- esecuzione con Minikube per eseguire tutto in locale con anche MySql dentro un immagine docker
14
+
- esecuzione su cluster AWS-EKS con creato tramite AWS-CLI
15
+
- esecuzione con CloudFormation su `https://github.com/alnao/AwsCloudFormationExamples/tree/master/Esempio27eks` (con un docker-compose dedicato)
16
+
- esecuzione su cluster AWS-EKS con Heml-Chart e ArgoCD
0 commit comments