Cannot change namespace value for Devcontainer in K8s

Hi, I have deployed Coder from helm chart in my cluster in specific "coder" namespace I'm facing issue when creating devcontainer workspace. Really need help. I also mounted kubeconfig file to /home/coder/.kube by and I'm sure content in it is correct. Then I created a template by choosing Devcontainers (Kubernetes) stater template. Problems cause when I create workspace from that template. I have two question: 1. why I can't override value of var.use_kubeconfig and var.namespace? All params that I can override is describe as image bellow. 2. Even I edited main.tf, set var.namespace.default to "coder" and var.use_kubeconfig.default to true so it can use kubeconfig in ~/.kube/config, I still facing with error, describe in image bellow. For more details, here's yaml file showing how I deployed coder-v2 helm chart. Please help me. Thanks 🙂
11 Replies
Codercord
Codercord•3w ago
<#1311973359004815423>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys•3w ago
hey @Luna Lovegood, you can override the var.<whatever> by going in the "Variables" tab of the template these are managed on a template-level as opposed to coder_parameters (what you've shown in your screenshot) which are managed on a per-workpace basis
Luna Lovegood
Luna LovegoodOP•3w ago
@Phorcys so that means var.<whatever> cannot be change when template created? where is "Variables" tab you mentioned? I can't find it on Coder dashboard
Phorcys
Phorcys•3w ago
they can! i'm currently on the go so I won't be able to give a very detailed answer right now but basically: variables are managed on a template-level by template admins, which means their value will be the same across all workspaces on the other hand, parameters are on a per workspace basis, meaning that users will be able to control them when creating the workspace
Luna Lovegood
Luna LovegoodOP•3w ago
oh thank you I can continue from this. This post can be close or mark "solved"
Codercord
Codercord•3w ago
@Luna Lovegood closed the thread.
Phorcys
Phorcys•3w ago
let me know if you need any other help!
Codercord
Codercord•2w ago
@Luna Lovegood reopened the thread.
Luna Lovegood
Luna LovegoodOP•2w ago
I have this error message when trying to edit value for template variables
No description
Luna Lovegood
Luna LovegoodOP•2w ago
I perform in UI so I dont know where to check logs here is some last lines from coder-agent
2024-12-04 08:35:54.882 [info] coderd: audit_log ID=770aad16-fca7-48ae-b3a5-b480976a2b0f Time="2024-12-04T08:35:54.878088Z" UserID=633bae2f-ff0d-47c7-8362-2e22baa1d64d OrganizationID=90deaaaa-67f3-4b70-88a6-7e561676d8c5 Ip=10.42.0.111 UserAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0" ResourceType=template_version ResourceID=e0ec4f58-0daa-40cb-a1ea-40cf9639d47a ResourceTarget=distracted_shannon6 Action=create Diff="{\"created_by\":{\"Old\":\"\",\"New\":\"633bae2f-ff0d-47c7-8362-2e22baa1d64d\",\"Secret\":false},\"id\":{\"Old\":\"\",\"New\":\"e0ec4f58-0daa-40cb-a1ea-40cf9639d47a\",\"Secret\":false},\"name\":{\"Old\":\"\",\"New\":\"distracted_shannon6\",\"Secret\":false},\"template_id\":{\"Old\":\"null\",\"New\":\"7714d926-705c-43a5-bdd5-a9f5deb542ad\",\"Secret\":false}}" StatusCode=201 AdditionalFields="{}" RequestID=49985e55-b237-4167-8916-2c76e3db9d38 ResourceIcon="" actor="&{ID:633bae2f-ff0d-47c7-8362-2e22baa1d64d Email:[email protected] Username:admin}"
2024-12-04 08:35:54.965 [info] provisionerd-coder-6c8c59b758-xqfhn-0: unpacking template source archive session_id=3a0bcc4f-5215-4399-b9ce-e9e54b56bc83 size_bytes=30720
2024-12-04 08:35:55.107 [info] provisionerd-coder-6c8c59b758-xqfhn-0: clean stale Terraform plugins cache_path=/home/coder/.cache/coder/provisioner-0/tf
2024-12-04 08:36:11.887 [info] provisionerd-coder-6c8c59b758-xqfhn-0.runner: dry-run provision failure job_id=5ea71dd5-072b-412a-a75a-581c3e03d49d error="terraform plan: exit status 1"
2024-12-04 08:36:11.897 [info] provisionerd-coder-6c8c59b758-xqfhn-0: recv done on Session session_id=3a0bcc4f-5215-4399-b9ce-e9e54b56bc83 error=EOF
2024-12-04 08:38:27.621 [info] coderd: audit_log ID=93e93242-1c5b-4d72-aae6-74acf0622ada Time="2024-12-04T08:38:27.61815Z" UserID=633bae2f-ff0d-47c7-8362-2e22baa1d64d OrganizationID=90deaaaa-67f3-4b70-88a6-7e561676d8c5 Ip=10.42.0.111 UserAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0" ResourceType=template_version ResourceID=8450fc13-8802-4fad-884b-aa0dd8ccd528 ResourceTarget=nice_khorana4 Action=create Diff="{\"created_by\":{\"Old\":\"\",\"New\":\"633bae2f-ff0d-47c7-8362-2e22baa1d64d\",\"Secret\":false},\"id\":{\"Old\":\"\",\"New\":\"8450fc13-8802-4fad-884b-aa0dd8ccd528\",\"Secret\":false},\"name\":{\"Old\":\"\",\"New\":\"nice_khorana4\",\"Secret\":false},\"template_id\":{\"Old\":\"null\",\"New\":\"7714d926-705c-43a5-bdd5-a9f5deb542ad\",\"Secret\":false}}" StatusCode=201 AdditionalFields="{}" RequestID=c171de36-26a1-4aa5-87b7-ebccb371e731 ResourceIcon="" actor="&{ID:633bae2f-ff0d-47c7-8362-2e22baa1d64d Email:[email protected] Username:admin}"
2024-12-04 08:38:27.663 [info] provisionerd-coder-6c8c59b758-xqfhn-0: unpacking template source archive session_id=ea34058f-6ccf-45d5-8582-f36c23664bc7 size_bytes=30720
2024-12-04 08:38:27.810 [info] provisionerd-coder-6c8c59b758-xqfhn-0: clean stale Terraform plugins cache_path=/home/coder/.cache/coder/provisioner-0/tf
2024-12-04 08:38:46.106 [info] provisionerd-coder-6c8c59b758-xqfhn-0.runner: dry-run provision failure job_id=b6cf539f-4b9b-442c-aeeb-1c44d267a536 error="terraform plan: exit status 1"
2024-12-04 08:38:46.115 [info] provisionerd-coder-6c8c59b758-xqfhn-0: recv done on Session session_id=ea34058f-6ccf-45d5-8582-f36c23664bc7 error=EOF
2024-12-04 08:44:22.508 [info] dbpurge: purged old database entries duration=10.090258ms
2024-12-04 08:49:21.899 [info] notifications.report_generator: report generator finished duration=1.562937ms
2024-12-04 08:54:22.517 [info] dbpurge: purged old database entries duration=8.321953ms
2024-12-04 08:35:54.882 [info] coderd: audit_log ID=770aad16-fca7-48ae-b3a5-b480976a2b0f Time="2024-12-04T08:35:54.878088Z" UserID=633bae2f-ff0d-47c7-8362-2e22baa1d64d OrganizationID=90deaaaa-67f3-4b70-88a6-7e561676d8c5 Ip=10.42.0.111 UserAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0" ResourceType=template_version ResourceID=e0ec4f58-0daa-40cb-a1ea-40cf9639d47a ResourceTarget=distracted_shannon6 Action=create Diff="{\"created_by\":{\"Old\":\"\",\"New\":\"633bae2f-ff0d-47c7-8362-2e22baa1d64d\",\"Secret\":false},\"id\":{\"Old\":\"\",\"New\":\"e0ec4f58-0daa-40cb-a1ea-40cf9639d47a\",\"Secret\":false},\"name\":{\"Old\":\"\",\"New\":\"distracted_shannon6\",\"Secret\":false},\"template_id\":{\"Old\":\"null\",\"New\":\"7714d926-705c-43a5-bdd5-a9f5deb542ad\",\"Secret\":false}}" StatusCode=201 AdditionalFields="{}" RequestID=49985e55-b237-4167-8916-2c76e3db9d38 ResourceIcon="" actor="&{ID:633bae2f-ff0d-47c7-8362-2e22baa1d64d Email:[email protected] Username:admin}"
2024-12-04 08:35:54.965 [info] provisionerd-coder-6c8c59b758-xqfhn-0: unpacking template source archive session_id=3a0bcc4f-5215-4399-b9ce-e9e54b56bc83 size_bytes=30720
2024-12-04 08:35:55.107 [info] provisionerd-coder-6c8c59b758-xqfhn-0: clean stale Terraform plugins cache_path=/home/coder/.cache/coder/provisioner-0/tf
2024-12-04 08:36:11.887 [info] provisionerd-coder-6c8c59b758-xqfhn-0.runner: dry-run provision failure job_id=5ea71dd5-072b-412a-a75a-581c3e03d49d error="terraform plan: exit status 1"
2024-12-04 08:36:11.897 [info] provisionerd-coder-6c8c59b758-xqfhn-0: recv done on Session session_id=3a0bcc4f-5215-4399-b9ce-e9e54b56bc83 error=EOF
2024-12-04 08:38:27.621 [info] coderd: audit_log ID=93e93242-1c5b-4d72-aae6-74acf0622ada Time="2024-12-04T08:38:27.61815Z" UserID=633bae2f-ff0d-47c7-8362-2e22baa1d64d OrganizationID=90deaaaa-67f3-4b70-88a6-7e561676d8c5 Ip=10.42.0.111 UserAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0" ResourceType=template_version ResourceID=8450fc13-8802-4fad-884b-aa0dd8ccd528 ResourceTarget=nice_khorana4 Action=create Diff="{\"created_by\":{\"Old\":\"\",\"New\":\"633bae2f-ff0d-47c7-8362-2e22baa1d64d\",\"Secret\":false},\"id\":{\"Old\":\"\",\"New\":\"8450fc13-8802-4fad-884b-aa0dd8ccd528\",\"Secret\":false},\"name\":{\"Old\":\"\",\"New\":\"nice_khorana4\",\"Secret\":false},\"template_id\":{\"Old\":\"null\",\"New\":\"7714d926-705c-43a5-bdd5-a9f5deb542ad\",\"Secret\":false}}" StatusCode=201 AdditionalFields="{}" RequestID=c171de36-26a1-4aa5-87b7-ebccb371e731 ResourceIcon="" actor="&{ID:633bae2f-ff0d-47c7-8362-2e22baa1d64d Email:[email protected] Username:admin}"
2024-12-04 08:38:27.663 [info] provisionerd-coder-6c8c59b758-xqfhn-0: unpacking template source archive session_id=ea34058f-6ccf-45d5-8582-f36c23664bc7 size_bytes=30720
2024-12-04 08:38:27.810 [info] provisionerd-coder-6c8c59b758-xqfhn-0: clean stale Terraform plugins cache_path=/home/coder/.cache/coder/provisioner-0/tf
2024-12-04 08:38:46.106 [info] provisionerd-coder-6c8c59b758-xqfhn-0.runner: dry-run provision failure job_id=b6cf539f-4b9b-442c-aeeb-1c44d267a536 error="terraform plan: exit status 1"
2024-12-04 08:38:46.115 [info] provisionerd-coder-6c8c59b758-xqfhn-0: recv done on Session session_id=ea34058f-6ccf-45d5-8582-f36c23664bc7 error=EOF
2024-12-04 08:44:22.508 [info] dbpurge: purged old database entries duration=10.090258ms
2024-12-04 08:49:21.899 [info] notifications.report_generator: report generator finished duration=1.562937ms
2024-12-04 08:54:22.517 [info] dbpurge: purged old database entries duration=8.321953ms
Oh, nvm, I put some invalid data for cache_repo and cache_repo_secret_name so terraform apply cause error.
Codercord
Codercord•2w ago
@Luna Lovegood closed the thread.
Want results from more Discord servers?
Add your server