-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add kubernetes samples folder
- Loading branch information
1 parent
49da9f3
commit fb33142
Showing
12 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.