Temporal K8s Operator

Published
Length
3 min read

Luis Felipe Dias

All posts

A temporal k8s operator automates workflow cluster setup and day-to-day updates inside Kubernetes. It watches custom resources and adjusts your server pods and databases to match. Platform teams use this setup so they do not have to manage stateful services by hand. Still, teams often grant broad cluster roles to operators and engineers during setup. Broad roles let users run unchecked commands inside worker pods and read sensitive state data. How the temporal k8s operator works with native RB

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

A temporal k8s operator automates workflow cluster setup and day-to-day updates inside Kubernetes. It watches custom resources and adjusts your server pods and databases to match. Platform teams use this setup so they do not have to manage stateful services by hand. Still, teams often grant broad cluster roles to operators and engineers during setup. Broad roles let users run unchecked commands inside worker pods and read sensitive state data.

How the temporal k8s operator works with native RBAC

The operator runs as a controller pod inside your Kubernetes cluster. It reads your desired cluster state and creates the needed deployments, services, and jobs. To do this work, the controller needs a Kubernetes Role or ClusterRole. In Kubernetes RBAC, a Role or ClusterRole holds rules that represent a set of permissions. These permissions are additive, which means there are no deny rules in the system. A Role sets permissions within one namespace. A ClusterRole is not namespaced and can cover resources across all namespaces. You attach these rules to the operator service account with a RoleBinding or ClusterRoleBinding. A RoleBinding grants permissions inside one namespace, while a ClusterRoleBinding grants access across the whole cluster. Engineers also need RBAC rules to check pod logs or run debug tools on Temporal pods. Kubernetes RBAC treats pod logs and pod command execution as subresources on the pod API.

Why native roles leave a gap during live debugging

Native Kubernetes RBAC solves the problem of who can reach the cluster API. It lets you scope the operator and your engineers to specific namespaces and resource types. You can separate who can read pod logs from who can create new workflow clusters. Still, native RBAC stops at the API check. Once RBAC grants pod exec rights to an engineer, the cluster does not check in-flight commands. An engineer with exec rights can open a shell inside a running Temporal server pod. From that shell, they can run admin CLI commands, delete workflow histories, or read database keys. They can also query workflow payloads that hold customer emails, phone numbers, or card numbers. Native RBAC decides who can start a session, not what each command does in flight. It also cannot rewrite sensitive fields in command output before the user sees the result.

Scoping operator and engineer permissions in production

Start by moving the operator away from cluster-wide admin roles wherever possible. Use a Role and a RoleBinding in the single namespace where your workflow pods run. Reserve ClusterRole and ClusterRoleBinding rules only for resources that truly span the whole cluster. Separate the service account that runs the operator from the roles that human engineers use. Give engineers read-only roles for day-to-day checks so they can view pod status and logs. Do not bundle pod exec subresource rules into default developer roles. When someone must run an admin command or inspect a live database, check every action at the command level. Masking rules can also rewrite emails, phone numbers, and national IDs in query results during fixing.

Add request guardrails and response masking beside Kubernetes

Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev runs beside the API server as a sidecar for your Kubernetes API and checks every request and response alongside RBAC.

K8s Namespace Isolation + External Secrets Operator (K8s): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

With hoop.dev Kubernetes controls, guardrails can allow listing Secret names while refusing reads of Secret data before execution. Data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.

Frequently asked questions

What does a temporal k8s operator manage?

It manages the lifecycle of Temporal server components, schema migration jobs, and service endpoints inside Kubernetes. You declare your desired cluster state, and the controller keeps the pods aligned with that state.

Should the operator use a Role or a ClusterRole?

Use a Role with a RoleBinding if the operator only manages resources in one namespace. Use a ClusterRole and ClusterRoleBinding only when it must watch resources across all namespaces.

Why is pod exec risky on Temporal pods?

Pod exec lets a user run any shell command or admin tool inside the container. Native RBAC cannot block destructive CLI flags or mask sensitive payload data inside that open shell.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

The query runs. The emails stay hidden.