K8S. For a hosted installation,
confirm that a compatible broker is enabled before configuring these targets.
An older self-hosted agent must be upgraded and configured with a broker before
these targets can work. Installing the Kubernetes plugin alone does not establish
an installation identity or grant cluster access.
How it relates to a cloud connection
Your AWS, Azure, or GCP target continues to provision cloud resources through its existing cloud plugin. A Kubernetes target is a separate, ordinary target. It does not inherit a cloud target’s credentials or call the cloud plugin for a token. You can reuse the cloud connection’s public role, client, or workload identity provider coordinates when that identity also has cluster access. The Kubernetes plugin asks the installation broker for a short-lived assertion and performs the appropriate exchange itself:
Tokens are cached in memory and refreshed as operations need them. Explicit OIDC
configuration does not fall back to the agent’s local cloud credentials if
federation fails. The installation still has its managed identity and signing
infrastructure; the absence of customer credentials in Pkl does not mean there
are no credentials anywhere in the system.
Prepare access first
- Create or identify the cluster and obtain its trusted HTTPS endpoint and base64-encoded PEM CA certificate.
- Configure trust for
https://oidc.cloud.formae.aiand the installation’s exact subject from connection setup. Do not derive the subject from an organization name or a guessed installation ID. - Grant that authenticated identity the Kubernetes permissions your resources need, and allow time for the grants to propagate.
- Apply a new Kubernetes target and its workloads. The agent must be able to reach the cluster and, for cloud authentication, the provider’s token service.
Target configurations
Add these schema dependencies to yourPklProject and run pkl project resolve:
config. Replace the
example coordinates and choose the Kubernetes minor version matching your
cluster. The 1.34 import and kubernetesVersion must agree.
AWS EKS
sts.amazonaws.com. Separately, create an EKS access entry and
permissions
for that role, using an access policy or Kubernetes RBAC groups. The cluster must
have an authentication mode supporting access entries. Role trust alone does
not give the role access to Kubernetes. region is required with
AwsOidcCredentials and does not default from AWS_REGION. This OIDC variant
supports commercial AWS.
Azure AKS
api://AzureADTokenExchange. The plugin requests an AKS
access token, rather than an Azure Resource Manager token.
Grant access through the cluster’s configured Azure RBAC or Kubernetes RBAC
authorizer.
Resolve the service principal’s object ID when creating its role assignment;
clientId in Pkl identifies the application, not that object ID. This variant
supports public Azure.
Both endpoint and CA are mandatory with OIDC. The Kubernetes plugin does not
fetch an admin or user kubeconfig in this mode. If a cloud resource does not
expose the CA, have an administrator supply that public certificate from trusted
cluster metadata. Do not copy the kubeconfig’s credentials into Pkl.
Google GKE
google.subject to assertion.sub, and admit only the
exact installation subject. Grant the resulting principal the required GKE and
Kubernetes permissions. The provider path uses the project number.
Direct federation is the default. To use service-account impersonation, add
serviceAccountEmail = "formae-kubernetes@example-project.iam.gserviceaccount.com"
inside GcpOidcCredentials. Grant the exact federated principal
roles/iam.workloadIdentityUser on that service account, and grant the service
account its own cluster access. Selecting this mode changes the identity seen
by the cluster; it is not an automatic fallback.
Direct Kubernetes OIDC
This option needs no AWS, Azure, or GCP connection. Configure the Kubernetes API server to trust the formae issuer and a dedicated, stable audience:urn:formae:kubernetes: followed by a canonical lowercase
RFC 4122 UUID. The broker must allow that audience.
For an API server using OIDC
flags,
the matching settings are:
User named formae:EXACT_INSTALLATION_SUBJECT, using the actual
subject and the configured prefix. A valid token authenticates an identity;
RBAC still decides what it can do.
Ordering and changes to existing targets
A Kubernetes target can reference the host cluster through resolvables without being nested under a cloud target. For example, useeksCluster.res.endpoint and
eksCluster.res.certificateAuthorityData instead of the EKS literals above.
Those references make the workload depend on the cluster’s metadata being
available. They do not order separately configured access grants or guarantee
their propagation. Establish those grants before applying workloads. Remove
workloads while access remains available, before removing grants or the cluster.
Helm permissions and long operations
Helm needs permission to manage its release Secrets and the resources in the chart. It also needs cluster-scoped permission toget the kube-system
Namespace to identify the cluster before mutations and recovery. A RoleBinding
limited to the workload namespace cannot grant that read. A narrowly scoped
ClusterRole can use resources: ["namespaces"],
resourceNames: ["kube-system"], and verbs: ["get"] in the core API group.
Bind it to the same authenticated identity.
Use a Helm timeoutSeconds of at least 300 with the default agent timing.
Credential refresh is serviced during live operations and status polling; it
depends on the agent and broker staying available. If the agent or plugin is
killed, inspect the release and retry through formae’s recovery flow.
The plugin’s complete EKS,
AKS,
GKE,
and direct OIDC
examples include target and workload definitions. These are also the examples
available to AI assistants through the formae MCP.
