Penv Cloud
Start free
Docs
Guidesince cloud@2026-09-10

Kubernetes

Authenticate your pod as its service account: bind a trust, project a token with your workspace id as audience, and hand it to penv run.

Your pod authenticates to us as its service account through a projected token. Projection mechanics: Kubernetes service account token projection. To deliver values without penv in the container, use External Secrets Operator.

Trust

Create the trust under Machine Identities, then Connect a Platform (connect a platform). The issuer field differs per cluster:

ClusterConnect page
Any KubernetesKubernetes
Amazon EKSEKS
Google Kubernetes EngineGKE
Azure Kubernetes ServiceAKS (keep the issuer's trailing slash)
Oracle Container EngineOKE
Trust partValue
Subjectsystem:serviceaccount:<namespace>:<service-account>, matched exactly
AudienceYour workspace id (single-audience rule)

Your cluster issuer must be reachable from the internet. We fetch its discovery document when the trust binds; an issuer readable only inside the cluster never binds.

Projected token

deployment.yaml
volumes:
  - name: penv-token
    projected:
      sources:
        - serviceAccountToken:
            path: token
            audience: <ORG_ID>        # your workspace id, and no other audience
            expirationSeconds: 3600

containers:
  - name: api
    volumeMounts:
      - name: penv-token             # required, or no container can read the volume
        mountPath: /var/run/secrets/penv
        readOnly: true

On EKS, do not reuse AWS_WEB_IDENTITY_TOKEN_FILE for this trust: its audience is fixed to sts.amazonaws.com. On AKS, AZURE_FEDERATED_TOKEN_FILE has Microsoft's audience. Project a separate token.

Run

PENV_OIDC_TOKEN="$(cat /var/run/secrets/penv/token)" penv run -- node server.js

penv exchanges the token with us for a 15-minute credential; penv run reads once and the child runs indefinitely. Probe and image setup: run in a container.

The console snippet exchanges with curl and ends in penv pull; prefer penv run, which writes nothing to disk.

Routepenv at runtimeA rotated value reaches the pod
penv run in the containerYes, one call to us per startOn the next start
External Secrets OperatorNoOn the operator's refresh interval

EKS IRSA and Pod Identity

penv versionIRSA web identity or Pod Identity credential
1.0.0-beta.2penv reads it and proves the pod's AWS role, but does not sign your workspace id, so we refuse the exchange. Use the projected token above.
1.0.0-beta.3 and laterpenv signs your workspace id and we accept it against an AWS trust.

AWS trust setup: authenticate an AWS workload.

Setup

Read the cluster issuer (or the OKE discovery key) per the connect page above.

Open Machine Identities, then Connect a Platform, pick the cluster entry, and enter the issuer, namespace, and service account.

Add the projected volume with your workspace id as audience, mounted read only.

Copy penv into the image and set the command to penv run, with PENV_OIDC_TOKEN read from the mounted file.

Roll the deployment and read the pod log. 401 unauthorized means the trust does not name this service account.