Skip to content

Commit 3a71a00

Browse files
committed
Add partial translation
1 parent 465d5dc commit 3a71a00

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

content/pt/docs/concepts/containers/container-lifecycle-hooks.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,50 +28,52 @@ This hook is executed immediately after a container is created.
2828
However, there is no guarantee that the hook will execute before the container ENTRYPOINT.
2929
No parameters are passed to the handler.
3030

31+
Este _hook_ é executado imediatamente após um contêiner ser criado.
32+
Entretanto, não há garantia que o _hook_ será executado antes do ENTRYPOINT do contêiner.
33+
Nenhum parâmetro é passado para o manipulador.
34+
3135
`PreStop`
3236

33-
This hook is called immediately before a container is terminated due to an API request or management
34-
event such as a liveness/startup probe failure, preemption, resource contention and others. A call
35-
to the `PreStop` hook fails if the container is already in a terminated or completed state and the
36-
hook must complete before the TERM signal to stop the container can be sent. The Pod's termination
37+
The Pod's termination
3738
grace period countdown begins before the `PreStop` hook is executed, so regardless of the outcome of
3839
the handler, the container will eventually terminate within the Pod's termination grace period. No
3940
parameters are passed to the handler.
4041

4142
A more detailed description of the termination behavior can be found in
4243
[Termination of Pods](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination).
4344

44-
### Hook handler implementations
45+
Esse _hook_ é chamado imediatamente antes de um contêiner ser encerrado devido a uma solicitação de API ou um gerenciamento de evento como liveness/startup probe failure, preemption, resource contention e outros.
46+
Uma chamada ao _hook_ `PreStop` falha se o contêiner já está em um estado finalizado ou concluído e o _hook_ deve ser concluído antes que o sinal TERM seja enviado para parar o contêiner.
47+
48+
49+
### Implementações de manipulador de hook
4550

46-
Containers can access a hook by implementing and registering a handler for that hook.
47-
There are two types of hook handlers that can be implemented for Containers:
51+
Os contêineres podem acessar um _hook_ implementando e registrando um manipulador para esse _hook_.
52+
Existem dois tipos de manipuladores de _hooks_ que podem ser implementados para contêineres:
4853

49-
* Exec - Executes a specific command, such as `pre-stop.sh`, inside the cgroups and namespaces of the Container.
50-
Resources consumed by the command are counted against the Container.
51-
* HTTP - Executes an HTTP request against a specific endpoint on the Container.
54+
* Exec - Executa um comando específico, como `pre-stop.sh`, dentro do cgroups e Namespaces do contêiner.
55+
* HTTP - Executa uma requisição HTTP em um endpoint específico do contêiner.
5256

53-
### Hook handler execution
57+
### Execução do manipulador de hook
5458

55-
When a Container lifecycle management hook is called,
56-
the Kubernetes management system execute the handler according to the hook action,
57-
`httpGet` and `tcpSocket` are executed by the kubelet process, and `exec` is executed in the container.
5859

59-
Hook handler calls are synchronous within the context of the Pod containing the Container.
60-
This means that for a `PostStart` hook,
61-
the Container ENTRYPOINT and hook fire asynchronously.
62-
However, if the hook takes too long to run or hangs,
63-
the Container cannot reach a `running` state.
60+
Quando um _hook_ de gerenciamento de ciclo de vida do contêiner é chamado, o sistema de gerenciamento do Kubernetes executa o manipulador de acordo com a ação do _hook_, `httpGet` e `tcpSocker` são executados pelo processo kubelet e `exec` é executado pelo contêiner.
6461

65-
`PreStop` hooks are not executed asynchronously from the signal to stop the Container; the hook must
66-
complete its execution before the TERM signal can be sent. If a `PreStop` hook hangs during
67-
execution, the Pod's phase will be `Terminating` and remain there until the Pod is killed after its
68-
`terminationGracePeriodSeconds` expires. This grace period applies to the total time it takes for
62+
As chamadas do manipulador do _hook_ são síncronas no contexto do Pod que contém o contêiner.
63+
Isso significa que para um _hook_ `PostStart`, o ENTRYPOINT do contêiner e o _hook_ disparam de forma assíncrona.
64+
No entanto, se o _hook_ demorar muito para ser executado ou travar, o contêiner não consegue atingir o estado `running`.
65+
66+
This grace period applies to the total time it takes for
6967
both the `PreStop` hook to execute and for the Container to stop normally. If, for example,
7068
`terminationGracePeriodSeconds` is 60, and the hook takes 55 seconds to complete, and the Container
7169
takes 10 seconds to stop normally after receiving the signal, then the Container will be killed
7270
before it can stop normally, since `terminationGracePeriodSeconds` is less than the total time
7371
(55+10) it takes for these two things to happen.
7472

73+
Os _hooks_ `PreStop` não são executados de forma assíncrona a partir do sinal para parar o conêiner, o _hook_ precisa finalizar a sua execução antes que o sinal TERM possa ser enviado.
74+
Se um _hook_ `PreStop` travar durante a execução, a fase do Pod será `Terminating` e permanecerá até que o Pod seja morto após seu `terminationGracePeriodSeconds` expirar.
75+
76+
7577
If either a `PostStart` or `PreStop` hook fails,
7678
it kills the Container.
7779

0 commit comments

Comments
 (0)