Skip to content

Commit

Permalink
chore: add kubernetes samples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
italopessoa committed Jul 29, 2024
1 parent 49da9f3 commit fb33142
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 8 deletions.
8 changes: 0 additions & 8 deletions FIAP.TechChallenge.ByteMeBurger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FIAP.TechChallenge.ByteMeBu
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "kubernetes", "kubernetes", "{5858E02C-014F-4A1C-8A4A-2DFAF0D33BAB}"
ProjectSection(SolutionItems) = preProject
kubernetes\pod-api.yaml = kubernetes\pod-api.yaml
kubernetes\pod-mysql.yaml = kubernetes\pod-mysql.yaml
kubernetes\svc-mysql.yaml = kubernetes\svc-mysql.yaml
kubernetes\svc-api.yaml = kubernetes\svc-api.yaml
kubernetes\svc-api-lb.yaml = kubernetes\svc-api-lb.yaml
kubernetes\replicaset-api.yaml = kubernetes\replicaset-api.yaml
kubernetes\deployment-api.yaml = kubernetes\deployment-api.yaml
kubernetes\configmap-api.yaml = kubernetes\configmap-api.yaml
kubernetes\configmap-db.yaml = kubernetes\configmap-db.yaml
kubernetes\pv-db.yaml = kubernetes\pv-db.yaml
kubernetes\pvc-db.yaml = kubernetes\pvc-db.yaml
kubernetes\sc-slow.yaml = kubernetes\sc-slow.yaml
kubernetes\pvc-slow.yaml = kubernetes\pvc-slow.yaml
kubernetes\pod-db-sc.yaml = kubernetes\pod-db-sc.yaml
kubernetes\stress.sh = kubernetes\stress.sh
kubernetes\deploy.ps1 = kubernetes\deploy.ps1
kubernetes\rollback.ps1 = kubernetes\rollback.ps1
kubernetes\svc-seq.yaml = kubernetes\svc-seq.yaml
kubernetes\pod-seq.yaml = kubernetes\pod-seq.yaml
kubernetes\secret-db.yaml = kubernetes\secret-db.yaml
kubernetes\secret-mercadopago.yaml = kubernetes\secret-mercadopago.yaml
kubernetes\hpa-api.yaml = kubernetes\hpa-api.yaml
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions kubernetes/samples/expose-deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Define a variável para o processo a ser iniciado
$processApi = Start-Process -FilePath "kubectl.exe" -ArgumentList "port-forward svc/svc-api 30000:80" -NoNewWindow
$processSeq = Start-Process -FilePath "kubectl.exe" -ArgumentList "port-forward svc/svc-seq 30008:80" -NoNewWindow
# Verifica se o processo foi iniciado com sucesso
if ($processApi.ExitCode -eq 0) {

# Adiciona um manipulador de eventos para o evento de encerramento do prompt
Register-ObjectEvent -InputObject $Host -EventName SessionEnding -Action {

# Encerra o processo minikube
Stop-Process -Id $processApi.Id -Force
Stop-Process -Id $processSeq.Id -Force
# Remove o manipulador de eventos
Remove-Event -SourceIdentifier $event.SourceIdentifier
}

Write-Host "htto://localhost:30000/swagger"
Write-Host "htto://localhost:30008"
Write-Host "Servicos iniciados em segundo plano. Pressione Ctrl+C para encerrar."

# Exibe uma mensagem informando que o minikube está sendo executado em segundo plano
Write-Host "Servicos iniciados em segundo plano. Pressione Ctrl+C para encerrar."

# Mantém o prompt aberto até que o usuário pressione Ctrl+C
while ($true) {
# Aguarda um evento de entrada do usuário
$null = Read-Host -Prompt ""
}
} else {
# Exibe uma mensagem de erro se o processo não foi iniciado com sucesso
Write-Host "Erro ao iniciar kubectl."
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fb33142

Please sign in to comment.