-
Notifications
You must be signed in to change notification settings - Fork 6
Don't limit CODER_NAMESPACE to a single namespace #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I see. How are you currently provisioning per-user resources? This is actually a feature we've considered doing in Coder. I think there may be some limitations with Helm around provisioning multi-namespace resources. @hh - Would it be possible to also provision a coder-logstream-kube per-user/namespace as well? That may be a nice workaround. |
Ideally everything runs within the namespace we create for them, what token would the coder-logstream-kube pod use? https://github.com/cloudnative-coop/space-templates/blob/canon/equipod/namedspaced.tf#L6-L15 resource "null_resource" "namespace" {
# install kubectl
provisioner "local-exec" {
command = "~/kubectl version --client || (curl -L https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -o ~/kubectl && chmod +x ~/kubectl)"
}
provisioner "local-exec" {
command = "~/kubectl create ns ${local.spacename}"
}
provisioner "local-exec" {
command = "~/kubectl -n ${local.spacename} apply -f ${path.module}/manifests/admin-sa.yaml"
}
} ---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: admin
rules:
- apiGroups:
- ""
resources:
- "*"
verbs:
- "*"
- apiGroups:
- "*"
resources:
- "*"
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: admin
subjects:
- kind: ServiceAccount
name: admin |
I see. Currently, coder-logstream-kube runs within the namespace and doesn't require a token! It uses the token from each workspace's pod spec (which is scoped to only send agent logs/stats for the specific workspace). helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
--namespace coder \
--set url=<your-coder-url> |
@hh are you still looking to do a single |
from #28
|
We also use a namespace per user and are a paying customer so would be nice to be have single deployment to collect logs from all the namespaces |
For now I ended up creating another null resource the includes the following kubectl manifest (since we already download kubectl for username namespace creation). You could also just download helm each time as well too.
|
From https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ :
There are benefits to deploying per-user namespaces:
We create a namespace per user, and do not destroy it when a workspace is torn down. This allows expensive objects (like cert-manager/letsencrypt certs/dns) to persist and be reused for multiple workspaces (from the same user) to access them.
Some resources we use per user/namespace:
The text was updated successfully, but these errors were encountered: