Infraestrutura base para o External Secrets Operator com integração ao OCI Vault usando Instance Principal (sem necessidade de credenciais estáticas).
- External Secrets Operator (v1.3.1) - Sincronização de secrets de vaults externos
- Reflector - Replicação automática de secrets entre namespaces
- Instance Principal Authentication - Autenticação via Dynamic Group (mais seguro)
- OCI Vault - Vault externo para armazenamento seguro
- OCI Dynamic Group - Para autenticação sem credenciais estáticas
- OCI Policy - Permissões de acesso ao Vault
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ OCI Vault │ ←→ │ ESO Controller │ ←→ │ K8s Secrets │
│ │ │ (Instance │ │ │
│ │ │ Principal) │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Reflector │
│ (Replication) │
└─────────────────┘
│
▼
┌─────────────────┐
│ Other Namespaces│
└─────────────────┘
-
Criar Dynamic Group
oci iam dynamic-group create \ --compartment-id <TENANCY_OCID> \ --name "k3s-cluster-nodes" \ --description "K3s cluster nodes for OCI Vault access" \ --matching-rule "any {instance.id = '<VM1>', instance.id = '<VM2>', ...}"
-
Criar Policy
oci iam policy create \ --compartment-id <TENANCY_OCID> \ --name "k3s-vault-access-policy" \ --description "Allow K3s nodes to read secrets from Vault" \ --statements "[ \"Allow dynamic-group k3s-cluster-nodes to read secret-family in tenancy\", \"Allow dynamic-group k3s-cluster-nodes to read secret-bundles in tenancy\", \"Allow dynamic-group k3s-cluster-nodes to use vaults in tenancy\" ]"
-
OCI Vault - Criar vault e adicionar secrets necessários
- Kubernetes cluster rodando em instâncias OCI
- Terraform >= 1.0
- Kubectl configurado
# Não precisa de variáveis de ambiente!
cd /home/julio/projects/julio/eso
terraform init
terraform plan
terraform applyApós o deploy, verifique a instalação:
# Verificar pods do ESO
kubectl get pods -n external-secrets
# Verificar CRDs
kubectl get crd | grep external-secrets
# Verificar Reflector
kubectl get pods -n reflector-systemOutros projetos devem criar SecretStores usando Instance Principal:
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
name: oci-vault
namespace: monitoring
spec:
provider:
oracle:
region: sa-saopaulo-1
vault: <VAULT_OCID>
principalType: InstancePrincipal
# Sem auth section - usa Instance Principal automaticamente!apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: grafana-admin
namespace: monitoring
spec:
refreshInterval: 1h
secretStoreRef:
name: oci-vault
kind: SecretStore
target:
name: grafana-admin-secret
creationPolicy: Owner
data:
- secretKey: password
remoteRef:
key: grafana-admin-password # Nome do secret no OCI Vault✅ Mais Seguro - Sem credenciais estáticas em secrets ✅ Rotação Automática - Managed pela OCI ✅ Menos Complexidade - Não precisa gerenciar fingerprint/privateKey ✅ Auditável - Logs centralizados na OCI
- ✅ ESO v1.3.1 deployment
- ✅ Instance Principal authentication (no static credentials)
- ✅ OCI Vault integration
- ✅ Automatic secret replication via Reflector
- ✅ Multi-namespace support
- ✅ Secure and auditable access
- ✅ Low resource footprint (~512MB total)
- ESO: ~384MB (3 pods × 128Mi)
- Reflector: ~128MB
- Total: ~512MB
Ideal para clusters ARM com recursos limitados!