Skip to content

Commit

Permalink
subir a aplicacao azure gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
luisferrarezi committed May 10, 2024
1 parent a415975 commit 6ac3449
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 233 deletions.
188 changes: 0 additions & 188 deletions kubernetes/azure/metrics.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions kubernetes/azure/tiulanches-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: tiulanches-config
labels:
app: tiulanches-config
data:
ds_url: jdbc:mysql://tiulanchessrv.mysql.database.azure.com:3306/tiulanches?createDatabaseIfNotExist=true&useSSL=true&requireSSL=false
ds_pass: V$!d4rmysql
ds_username: tiulanches@tiulanchessrv
conexao_kafka: 10.0.132.224:9092

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
name: tiulanches-deployment
labels:
app: app-deployment
app: tiulanches-deployment
spec:
selector:
matchLabels:
app: app
app: tiulanches
replicas: 1
template:
metadata:
labels:
app: app
app: tiulanches
spec:
containers:
- name: tiulanches
Expand All @@ -26,50 +26,50 @@ spec:
cpu: "1.0"
ports:
- containerPort: 8080
name: app-port
name: tiulanches-port
env:
- name: DATASOURCE_URL
valueFrom :
configMapKeyRef:
name: app-config
name: tiulanches-config
key: ds_url
- name: DATASOURCE_PASSWORD
valueFrom:
configMapKeyRef:
name: app-config
name: tiulanches-config
key: ds_pass
- name: DATASOURCE_USERNAME
valueFrom:
configMapKeyRef:
name: app-config
name: tiulanches-config
key: ds_username
- name: ACCESS_TOKEN_MP
valueFrom:
configMapKeyRef:
name: app-config
key: mp_token
- name: CONEXAO_KAFKA
valueFrom :
configMapKeyRef :
name : tiulanches-config
key : conexao_kafka
readinessProbe:
httpGet:
path: /actuator/health
port: app-port
port: tiulanches-port
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health
port: app-port
port: tiulanches-port
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
---
apiVersion: v1
kind: Service
metadata:
name: app-svc
name: tiulanches-svc
spec:
selector:
app: app
app: tiulanches
ports:
- port: 8080
targetPort: 8080
Expand Down
9 changes: 1 addition & 8 deletions kubernetes/local/startapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,5 @@ sleep 60
echo 'Subindo aplicação...'
kubectl apply -f tiulanches-deployment.yaml

https=http://localhost:31200/actuator/health
status=0
while [ $status -eq 0 ]
do
sleep 5
status=`curl $https -k -s -f -o /dev/null && echo 1 || echo 0`
done

sleep 60
echo 'Aplicação pronta, divirta-se ;)'
49 changes: 29 additions & 20 deletions kubernetes/local/tiulanches-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
data:
ds_url: jdbc:mysql://mysql-svc/tiulanches?&createDatabaseIfNotExist=true
ds_username: root
conexao_kafka: 10.105.69.241:9092
conexao_kafka: 10.110.5.216:9092
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -66,20 +66,6 @@ spec:
configMapKeyRef :
name : db-config
key : ds_username
readinessProbe:
httpGet:
path: /actuator/health
port: tiulanches-port
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health
port: tiulanches-port
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
---
apiVersion: v1
kind: Service
Expand All @@ -89,8 +75,31 @@ spec:
selector:
app: tiulanches
ports:
- protocol: TCP
port: 8080
nodePort: 31200
type: NodePort

- port: 80
targetPort: 8080
protocol: TCP
name: http
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tiulanches-ingress
spec:
ingressClassName: nginx
rules:
- http:
paths:
- pathType: Prefix
path: /produtos
backend:
service:
name: tiulanches-svc
port:
number: 80
- pathType: Prefix
path: /clientes
backend:
service:
name: tiulanches-svc
port:
number: 80

0 comments on commit 6ac3449

Please sign in to comment.