DigitalOcean Kubernetes access: who is cluster-admin, and how to change it
On DigitalOcean Kubernetes, your team role is your cluster role: Owner and Member both map to cluster-admin. Give people Modifier or a custom role instead, bind that role to something narrow, and restrict the API server to addresses you control.
Kubernetes RBAC has a reputation for being tedious, so small teams tend to skip it and run everything as the all-powerful default. On DigitalOcean Kubernetes that default is not something you chose. It follows from a person's team role the moment they download a kubeconfig.
Your team role is your cluster role
DigitalOcean's page on custom RoleBindings says that roles assigned to users within teams translate to Kubernetes groups, and so determine the level of access within clusters. The mapping for the predefined roles is:
- Owner and Member: cluster-admin.
- Modifier: create, read and update most resources, but not delete them, and it cannot modify RoleBindings.
- Biller, Billing Viewer and Resource Viewer: view resources, except secrets.
The groups are named in the form do-role-name:<role-name>, and a group called k8saas:default is assigned to every member of the team that owns the cluster. The team roles article explains the roles themselves. The practical consequence is that adding a colleague as a Member also makes them cluster-admin on every cluster the team owns, with the ability to read every secret and delete every workload.
A custom role behaves differently. DigitalOcean says it does not automatically bind to any Kubernetes role. To let it reach a cluster at all it needs the kubernetes:access_cluster permission, and then you write the Role and RoleBinding yourself. That is the route to least privilege.
Notice what Modifier cannot do: it cannot modify RoleBindings. That one restriction is what makes it safe to give to someone who deploys. They can roll out a Deployment, but they cannot grant themselves or anyone else more access, and they cannot delete the workload they just broke. Owner and Member can do both, and nothing in the cluster tells you which of your colleagues has quietly been using that.
Binding a role to something narrow
DigitalOcean's page includes example ClusterRole and ClusterRoleBinding YAML for a custom role, applied with kubectl apply. If all you need is to give a custom role read access to one namespace, the built-in view ClusterRole does that without new YAML. This command binds a group to it in the staging namespace only. We ran it with a client-side dry run to check the syntax, so it needs no cluster to preview:
kubectl create rolebinding staging-viewers \
--clusterrole=view \
--group="do-role-name:ci-readers" \
--namespace=staging \
--dry-run=client -o yaml
Remove the dry-run flags to create it. The group name must match the custom role's group as DigitalOcean builds it, so read that off the page for your role first. We found no DigitalOcean walkthrough for the other common approach, a ServiceAccount with its own token, so we have not written one here. The documented route is the role mapping above.
What a kubeconfig carries
The command everyone runs is doctl kubernetes cluster kubeconfig save <cluster>. Its reference lists an --alias flag, --set-current-context (true by default), a --type flag that accepts token or sso, and --expiry-seconds. The connection page says the command generates a revocable OAuth token on recent versions, which you can view and revoke under Applications and API. The older certificate-based credential is valid for seven days, renews automatically and cannot be revoked.
DigitalOcean's pages disagree a little about expiry. The doctl reference says credentials are automatically renewed by default and that setting an expiry implies the token type. The API reference says that if no expiry is set, the token has a seven-day expiry. Set --expiry-seconds explicitly on a kubeconfig you give to a script or a contractor, so the lifetime is the one you meant. Credentials for doctl itself are a separate subject, covered in the API tokens article.
If you still hold a kubeconfig that predates the token type, regenerate it. The older certificate form is valid for seven days and cannot be revoked, so a copy that leaks, or sits on a former colleague's laptop, cannot be cancelled early.
Restricting who can reach the API server
A control plane firewall narrows that. It takes public IPv4 addresses in CIDR notation, up to 500 per cluster, and private RFC 1918 ranges are not supported. Once enabled, only your allowed addresses, the cluster's worker nodes and workloads, and DigitalOcean's internal systems can reach the control plane. The documented command is:
doctl kubernetes cluster update <cluster> \
--enable-control-plane-firewall=true \
--control-plane-firewall-allowed-addresses="1.2.3.4/32, 2.3.0.0/16"
Two honest notes. DigitalOcean's pages are not consistent about whether the feature is available: the release notes list early availability in June 2024 and general availability in 2026, while the Kubernetes security FAQ still answers "Not today" to the question of restricting the API by IP. Trust the how-to page and the command reference, which are newer. And think about your CI runners before you switch it on. A pipeline that deploys from changing addresses will be locked out the moment you enable it.
What not to touch, and what is managed for you
The managed elements page carries a warning worth reading in full. Deleting or modifying managed RBAC objects, such as the k8saas:credentials:cluster-admin ClusterRoleBinding, can prevent DOKS from using the credentials it needs, and the resulting control plane downtime is not covered by the Kubernetes SLA. DigitalOcean says to create your own roles and bindings instead of modifying managed ones, and it labels managed objects doks.digitalocean.com/managed: "true".
The same page says that when you create a cluster, DigitalOcean provisions two Cloud Firewalls for it, named k8s- followed by the cluster name. You cannot delete them or change their configuration in the control panel, and NodePorts 30000 to 32767 are managed. Worker nodes are Droplets, but you manage them with kubectl and cannot reach them over SSH.
Pod access to the node's metadata endpoint is part of the picture too. The DOKS changelog for 11 August 2026 records a network policy that denies traffic to 169.254.169.254 in versions 1.36.3-do.1, 1.35.7-do.1 and 1.34.10-do.1. The metadata endpoint article explains why that matters.
Finding who has cluster-admin
This is where the documentation goes quiet. We found no DigitalOcean page that shows how to list RBAC bindings, and no audit log feature for DOKS in the documentation, the API reference, the changelog or the release notes. The only logging item is forwarding to Managed OpenSearch. Standard Kubernetes tooling still works against your own cluster:
kubectl get clusterrolebindings -o wide
Expect to see DigitalOcean's managed bindings in that list, including the credentials binding above, so read them as expected and look for the ones you did not create. Because Owner and Member map to cluster-admin through the team, your list of cluster-admins is partly your list of team members. Check both.
What to do first
None of this needs downtime. Because the mapping is by team role, changing a colleague from Member to Modifier takes effect on every cluster the team owns at once. That is the convenience, and it is also the reason to look at your other clusters before you change it.
- Review your team's Owners and Members. Anyone who does not need to delete production workloads should be a Modifier.
- Create a custom role for CI with the access permission, and bind it with a namespaced RoleBinding.
- Set an explicit expiry on kubeconfigs you hand out.
- Turn on the control plane firewall once you know your deploy addresses.
- Leave DigitalOcean's managed RBAC objects alone.
FAQ
Are DigitalOcean team Members cluster-admin on DOKS?
Yes. DigitalOcean maps both the Owner and Member roles to cluster-admin. Modifier can create, read and update most resources but not delete them, and the viewer and biller roles can view resources except secrets.
Does a custom DigitalOcean role get Kubernetes access automatically?
No. DigitalOcean says a custom role does not automatically bind to any Kubernetes role. It needs the kubernetes:access_cluster permission and a Role and RoleBinding that you write.
Can I restrict the Kubernetes API server by IP on DOKS?
Yes, with the control plane firewall, which takes up to 500 public IPv4 CIDR ranges. DigitalOcean's security FAQ still says this is not available, which is out of date relative to the how-to page.
Does DOKS have audit logs?
We found no audit log feature in the DigitalOcean documentation, API reference, changelog or release notes. Log forwarding to Managed OpenSearch is the only logging feature documented.
Kubernetes is one of the DigitalOcean services Secorvia lists, read through the same read-scope token as the rest. The Kubernetes integration page and the DigitalOcean page say what that covers.