diff --git a/examples/templates/kubernetes-multi-service/README.md b/examples/templates/kubernetes-multi-service/README.md index 3dda56db85099..7c70d661f7258 100644 --- a/examples/templates/kubernetes-multi-service/README.md +++ b/examples/templates/kubernetes-multi-service/README.md @@ -4,75 +4,71 @@ description: Get started with Kubernetes development. tags: [cloud, kubernetes] --- -# Authentication +# Getting started -This template features two ways to authenticate to a Kubernetes cluster. +## RBAC -## kubeconfig (Coder host) +The Coder provisioner requires permission to administer pods to use this template. The template +creates workspaces in a single Kubernetes namespace, using the `workspaces_namespace` parameter set +while creating the template. -If the Coder host has a local `~/.kube/config`, you can use this to authenticate -with Coder. Make sure this is done with same user that's running the `coder` service. +Create a role as follows and bind it to the user or service account that runs the coder host. -## ServiceAccount +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: coder +rules: +- apiGroups: [""] + resources: ["pods"] + verbs: ["*"] +``` -Create a ServiceAccount and role on your cluster to authenticate your template with Coder. +## Authentication -1. Run the following command on a device with Kubernetes context: +This template can authenticate using in-cluster authentication, or using a kubeconfig local to the +Coder host. For additional authentication options, consult the [Kubernetes provider +documentation](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs). - ```sh - CODER_NAMESPACE=default - kubectl apply -n $CODER_NAMESPACE -f - <