joelynnnnn
CCoder.com
•Created by joelynnnnn on 1/20/2025 in #help
startup_script not working when using GitLab CI template management
When I create the template directly on Coder UI and start a workspace, everything is fine. However, when I set-up GitLab CI to push the exact same template, create the workspace, the startup_script prompts an error.
Here's the startup_script:
startup_script = <<EOF
#!/bin/sh
set -e
sudo apt-get update
# install VS Code
curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
mkdir -p /tmp/vscode-cli
tar -xf vscode_cli.tar.gz -C /tmp/vscode-cli
rm vscode_cli.tar.gz
# start the web server on a specific port
/tmp/vscode-cli/code serve-web --port 13338 --without-connection-token --accept-server-license-terms >/tmp/vscode-web.log 2>&1 &
EOF
Here's the error from workspace created by GitLab CI:
Pulling image "codercom/enterprise-base:ubuntu"
Successfully pulled image "codercom/enterprise-base:ubuntu" in 1.11s (1.11s including waiting)
Created container dev
Started container dev
/bin/sh: 2: set: Illegal option -
5 replies
CCoder.com
•Created by joelynnnnn on 1/6/2025 in #help
Workspace build failed for Kubernetes (Devcontainers)
I've mounted kubeconfig secret onto my Coder deployment and when I deploy Kubernetes (Deployment), it reads the secret correctly and deploys it into the Kubernetes Cluster.
However, for Devcontainers (Kubernetes), it seems like it doesn't read the kubeconfig and workspace build failed with "persistentvolumeclaims is forbidden ... cannot create resource "persistentvolumeclaims"
For both, the provider.kubernetes.configpath is exactly the same.
45 replies