Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

edsoncelio
Copy link
Member

Changes:

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

Related to #13939

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 18, 2021
@k8s-ci-robot k8s-ci-robot requested review from femrtnz and jcjesus March 18, 2021 02:33
@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 18, 2021
@netlify
Copy link

netlify bot commented Mar 18, 2021

Deploy preview for kubernetes-io-master-staging ready!

Built with commit b12cbb5

https://deploy-preview-27110--kubernetes-io-master-staging.netlify.app

Copy link
Contributor

@rikatz rikatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR.

Left some reviews here!

`PreStop`

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.
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. A contagem regressiva do período de tolerância de término do Pod começa antes que o _hook_ `PreStop` seja executado, portanto, independentemente do resultado do manipulador, o contêiner será encerrado dentro do período de tolerância de encerramento do Pod. Nenhum parâmetro é passado para o manispulador.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here -> manispulador / manipulador

Os contêineres podem acessar um _hook_ implementando e registrando um manipulador para esse _hook_.
Existem dois tipos de manipuladores de _hooks_ que podem ser implementados para contêineres:

* Exec - Executa um comando específico, como `pre-stop.sh`, dentro do cgroups e Namespaces do contêiner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dentro do cgroup e namespace do container (tudo no plural ou tudo no singular)

### Execução do manipulador de hook


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/tcpSocker/tcpSocket

No entanto, se o _hook_ demorar muito para ser executado ou travar, o contêiner não consegue atingir o estado `running`.


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/conêiner/contêiner


### Depurando manipuladores de _hooks_

Os logs para um manipulador de _hook_ não expostos em eventos de Pod.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the correct here would be 'são expostos em eventos de Pod"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original is "The logs for a Hook handler are not exposed in Pod events.". I added the missing word, thanks!


Os logs para um manipulador de _hook_ não expostos em eventos de Pod.
Se um manipulador falhar por algum motivo, ele transmitirá um evento.
Para `PostStart` é o evento `FailedPostStartHook` e para `PreStop` é o evento
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FailedPreStopHook (should start in upper case here)

@rikatz
Copy link
Contributor

rikatz commented Mar 19, 2021

/assign

* manispulador -> manipulador
* dentro do cgroup e namespace do container -> dentro dos cgroups e namespaces
* tcpSocker -> tcpSocket
* conêiner-> contêiner
* Os logs para um manipulador de _hook_ não expostos em eventos de Pod -> Os logs para um manipulador de _hook_ não são expostos em eventos de Pod.
* failedPreStopHook -> FailedPreStopHook
@rikatz
Copy link
Contributor

rikatz commented Mar 19, 2021

/lgtm
/approve

Thank you!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 19, 2021
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: fb0d89a9f378d644c0acf8bea4ff2939c1de96ad

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rikatz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2021
@k8s-ci-robot k8s-ci-robot merged commit d79edc1 into kubernetes:master Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/pt Issues or PRs related to Portuguese language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants