O produto descrito nesta documentação, Anthos Clusters na AWS (geração anterior), está em modo de manutenção . Todas as novas instalações devem usar o produto da geração atual, Anthos Clusters na AWS .
Você pode acessar os segredos do Vault dentro dos pods usando o injetor do Agent Sidecar. O injetor é um Controlador Webhook Mutante do Kubernetes . O controlador intercepta eventos do Pod e atualiza a configuração do Pod.
O Injetor do Agente do Vault usa a Conta de Serviço do Kubernetes (KSA) de um Pod com o método de Autenticação do Kubernetes do Vault. A conta KSA deve estar vinculada a uma função do Vault com uma política que conceda acesso aos segredos.
Uma vez configurado, você pode solicitar segredos anotando um Pod.
O snippet a seguir inclui anotações que você adicionaria a um Pod. Se a função myapp tiver acesso ao secret/banana , o Vault o montará em /vault/secrets/apple .
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-06-12 UTC."],[],[],null,["# Using HashiCorp Vault on GKE on AWS\n\n[HashiCorp Vault](https://www.vaultproject.io/) is a third-party\nsecrets management solution that integrates with Kubernetes and\nGKE on AWS.\n| **Note:** This section is not meant as an endorsement or recommendation to use HashiCorp Vault.\n\nYou can deploy Vault on GKE on AWS using:\n\n- HashiCorp's official [Helm chart](https://www.vaultproject.io/docs/platform/k8s/helm/)\n- [Vault on GKE](https://github.com/sethvargo/vault-on-gke), which is installed with Terraform.\n\nYou can access Vault secrets inside pods using the Agent Sidecar injector. The\ninjector is a\n[Kubernetes Mutating Webhook Controller](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/).\nThe controller intercepts Pod events and updates the Pod's configuration.\n\nThe Vault Agent Injector uses a Pod's Kubernetes Service Account (KSA) with the\nVault Kubernetes Auth method. The KSA account must be bound to a Vault role with\na policy granting access to the secrets.\n\nOnce configured, you can request secrets by annotating a Pod.\n\nThe following snippet includes annotations that you would add to a Pod.\nIf the `myapp` role has access to Secret `secret/banana`, Vault\nmounts it at `/vault/secrets/apple`. \n\n spec:\n template:\n metadata:\n annotations:\n vault.hashicorp.com/agent-inject: \"true\"\n vault.hashicorp.com/agent-inject-secret-apple: \"secrets/banana\"\n vault.hashicorp.com/role: \"myapp\"\n\nYou can apply this configuration:\n\n- To a Pod with `kubectl edit pod/`\u003cvar translate=\"no\"\u003epod-name\u003c/var\u003e.\n- To a Deployment with `kubectl edit deployment/`\u003cvar translate=\"no\"\u003edeployment-name\u003c/var\u003e.\n\nWhat's next\n-----------\n\n- Read the [Vault Injector](https://www.vaultproject.io/docs/platform/k8s/injector/) documentation.\n- Review the [vault-k8s GitHub repository](https://github.com/hashicorp/vault-k8s)."]]