devpod icon indicating copy to clipboard operation
devpod copied to clipboard

Error for running on k8s windows node

Open kennyd3d opened this issue 10 months ago • 2 comments

What happened?
Ran devpods on a windows k8s AKS cluster with devpods up <source> --ide vscode --debug. There appears to be a error pulling a python container dependency. I am running this on windows 10.

[10:50:54] info Use C:\Users\me\.devpod\agent\contexts\default\workspaces\vscode-remote-try-python as workspace dir
[10:50:54] info Delete old workspace 'vscode-remote-try-python'
[10:50:54] info Removing DevPod container from server...
[10:50:54] info Run findDevContainer driver command: "${KUBERNETES_PROVIDER}" find
[10:50:54] info Use Kubernetes Namespace 'devpod'
[10:50:54] info Use Kubernetes Config 'C:\Users\me\.kube\config'
[10:50:54] info Use Kubernetes Context 'open-slug-aks'
[10:50:54] info Run command: kubectl --namespace devpod --kubeconfig C:\Users\me\.kube\config --context open-slug-aks get pvc devpod-default-vs-7ca04 --ignore-not-found -o json
[10:50:54] info exec: "kubectl": executable file not found in %PATH%
[10:50:54] info Removing container: find dev container: error finding dev container: exit status 1
[10:50:54] debug Created logger
[10:50:54] debug Received ping from agent
[10:50:54] debug Credentials server started on port 14055...
[10:50:55] debug Incoming client connection at /
[10:50:55] debug Credentials server started...
[10:50:55] debug Create content folder C:\Users\me\.devpod\agent\contexts\default\workspaces\vscode-remote-try-python\content
[10:50:55] info Clone repository
[10:50:55] info URL: https://github.com/microsoft/vscode-remote-try-python
[10:50:55] error Shim: Could not determine if target is a GUI app. Assuming console.
[10:50:55] error Shim: Could not create process with command '"C:\Users\me\scoop\apps\git\current\cmd\git.exe"  clone --config "credential.helper=!'C:\Program Files\DevPod\devpod-cli.exe' agent git-credentials --port 14055" https://github.com/microsoft/vscode-remote-try-python C:\Users\me\.devpod\agent\contexts\default\workspaces\vscode-remote-try-python\content --progress'.
[10:50:55] info clone repository: exit status 1
[10:50:55] info exit status 1
[10:50:55] debug Connection to SSH Server closed
[10:50:55] debug Done creating devcontainer
[10:50:55] debug Done executing ssh server helper command
[10:50:55] fatal Process exited with status 1
run agent command
github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
        D:/a/devpod/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:129
runtime.goexit
        C:/Users/runneradmin/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:1695

What did you expect to happen instead?
Devpods opens up with project in k8s windows pod.

How can we reproduce the bug? (as minimally and precisely as possible)
Set up a windows cluster, specify config in provider, spin up project.

My devcontainer.json:

{
  "name": "aks",
  "version": "v0.1.19",
  "icon": "https://devpod.sh/assets/kubernetes.svg",
  "home": "https://github.com/loft-sh/devpod",
  "source": {
    "github": "loft-sh/devpod-provider-kubernetes",
    "raw": "kubernetes"
  },
  "description": "DevPod on Kubernetes",
  "optionGroups": [
    {
      "name": "Options",
      "options": [
        "KUBERNETES_NAMESPACE",
        "DISK_SIZE"
      ],
      "defaultVisible": true
    },
    {
      "name": "Kubernetes Config",
      "options": [
        "KUBERNETES_CONTEXT",
        "KUBERNETES_CONFIG"
      ]
    },
    {
      "name": "Advanced Options",
      "options": [
        "CLUSTER_ROLE",
        "SERVICE_ACCOUNT",
        "CREATE_NAMESPACE",
        "KUBECTL_PATH",
        "INACTIVITY_TIMEOUT",
        "STORAGE_CLASS",
        "PVC_ACCESS_MODE",
        "PVC_ANNOTATIONS",
        "RESOURCES",
        "POD_MANIFEST_TEMPLATE",
        "ARCH_DETECTION_POD_MANIFEST_TEMPLATE",
        "NODE_SELECTOR",
        "HELPER_RESOURCES",
        "HELPER_IMAGE",
        "LABELS",
        "DOCKERLESS_DISABLED",
        "DOCKERLESS_IMAGE"
      ]
    }
  ],
  "options": {
    "ARCH_DETECTION_POD_MANIFEST_TEMPLATE": {
      "description": "Pod manifest template file path used as template to build the architecture detenction pod. E.g. /path/pod_manifest.yaml. Alternatively can be an inline yaml string.",
      "type": "multiline",
      "global": true
    },
    "CLUSTER_ROLE": {
      "description": "If defined, DevPod will create a role binding for the given cluster role.",
      "global": true
    },
    "CREATE_NAMESPACE": {
      "description": "If true, DevPod will try to create the namespace.",
      "type": "boolean",
      "global": true,
      "default": "true"
    },
    "DANGEROUSLY_OVERRIDE_IMAGE": {
      "description": "Only set this if you know what you're doing! Overrides the pod base image and could break your workspace.",
      "global": true
    },
    "DISK_SIZE": {
      "description": "The default size for the persistent volume to use.",
      "global": true,
      "default": "10Gi"
    },
    "DOCKERLESS_DISABLED": {
      "description": "If dockerless should be disabled. Dockerless is the way DevPod uses to build images directly within Kubernetes. If dockerless is disabled and no image is specified, DevPod will fail instead.",
      "global": true,
      "default": "false"
    },
    "DOCKERLESS_IMAGE": {
      "description": "The dockerless image to use.",
      "global": true
    },
    "HELPER_IMAGE": {
      "description": "The image DevPod will use to find out the cluster architecture. Defaults to alpine.",
      "global": true
    },
    "HELPER_RESOURCES": {
      "description": "The resources to use for the workspace init container. E.g. requests.cpu=100m,limits.memory=1Gi",
      "global": true
    },
    "INACTIVITY_TIMEOUT": {
      "description": "If defined, will automatically stop the pod after the inactivity period. Examples: 10m, 1h"
    },
    "KUBECTL_PATH": {
      "description": "The path where to find the kubectl binary.",
      "global": true,
      "default": "kubectl"
    },
    "KUBERNETES_CONFIG": {
      "description": "The kubernetes config to use. E.g. /path/to/my/kube/config.yaml"
    },
    "KUBERNETES_CONTEXT": {
      "description": "The kubernetes context to use. E.g. my-kube-context"
    },
    "KUBERNETES_NAMESPACE": {
      "description": "The kubernetes namespace to use",
      "command": "NAMESPACE=$(${KUBECTL_PATH} config view --kubeconfig=${KUBERNETES_CONFIG} --context=${KUBERNETES_CONTEXT} --minify -o jsonpath='{..namespace}' 2>/dev/null || true)\nif [ -z \"${NAMESPACE}\" ]; then\n  NAMESPACE=devpod\nfi\necho $NAMESPACE"
    },
    "KUBERNETES_PULL_SECRETS_ENABLED": {
      "description": "If true, DevPod will try to use the pull secrets from the current context.",
      "type": "boolean",
      "global": true,
      "default": "true"
    },
    "LABELS": {
      "description": "The labels to use for the workspace pod. E.g. devpod.sh/example=value,devpod.sh/example2=value2",
      "global": true
    },
    "NODE_SELECTOR": {
      "description": "The node selector to use for the workspace pod. E.g. my-label=value,my-label-2=value-2",
      "global": true
    },
    "POD_MANIFEST_TEMPLATE": {
      "description": "Pod manifest template file path used as template to build the devpod pod. E.g. /path/pod_manifest.yaml. Alternatively can be an inline yaml string.",
      "type": "multiline",
      "global": true
    },
    "POD_TIMEOUT": {
      "description": "Determines how long the provider waits for the workspace pod to come up. Examples: 10m, 1h",
      "default": "10m"
    },
    "PVC_ACCESS_MODE": {
      "description": "If defined, DevPod will use the given access mode to create the persistent volume claim. You will need to ensure the storage class support the given access mode!. E.g. RWO or ROX or RWX or RWOP",
      "global": true
    },
    "PVC_ANNOTATIONS": {
      "description": "If defined, DevPod will use add the given annotations to the main workspace pvc",
      "global": true
    },
    "RESOURCES": {
      "description": "The resources to use for the workspace container. E.g. requests.cpu=500m,limits.memory=5Gi,limits.gpu-vendor.example/example-gpu=1",
      "global": true
    },
    "SERVICE_ACCOUNT": {
      "description": "If defined, DevPod will use the given service account for the dev container.",
      "global": true
    },
    "STORAGE_CLASS": {
      "description": "If defined, DevPod will use the given storage class to create the persistent volume claim. You will need to ensure the storage class exists in your cluster!",
      "global": true
    },
    "STRICT_SECURITY": {
      "description": "EXPERIMENTAL! Use at your own risk. Removes the default security context and merges the one from POD_MANIFEST_TEMPLATE if specified.",
      "type": "boolean",
      "default": "false"
    },
    "WORKSPACE_VOLUME_MOUNT": {
      "description": "Sets the path of the workspace volume mount. By default it is the root of your workspace source code, usually /workspaces/$WORKSPACE_ID. If you intend to create multi-repo workspaces or need additional files throughout the lifecycle of the workspace, set this option to a parent directory of the workspace mount.",
      "type": "string"
    }
  },
  "agent": {
    "local": "true",
    "containerInactivityTimeout": "${INACTIVITY_TIMEOUT}",
    "exec": {},
    "binaries": {
      "KUBERNETES_PROVIDER": [
        {
          "os": "linux",
          "arch": "amd64",
          "checksum": "99cb3516bd77e0b0b1e360432556917edc374a89585f8aad3ccaa2a10f582ae4",
          "path": "https://github.com/loft-sh/devpod-provider-kubernetes/releases/download/v0.1.19/devpod-provider-kubernetes-linux-amd64"
        },
        {
          "os": "linux",
          "arch": "arm64",
          "checksum": "805f98946692f649fb9ecd18a0d26df157c712acb9f9a79d5c376c496029d032",
          "path": "https://github.com/loft-sh/devpod-provider-kubernetes/releases/download/v0.1.19/devpod-provider-kubernetes-linux-arm64"
        },
        {
          "os": "darwin",
          "arch": "amd64",
          "checksum": "1a85515db7aedf84f61f1f38a7ec16d3527f3db65e2d663bfa49b5dd1ce8fb6a",
          "path": "https://github.com/loft-sh/devpod-provider-kubernetes/releases/download/v0.1.19/devpod-provider-kubernetes-darwin-amd64"
        },
        {
          "os": "darwin",
          "arch": "arm64",
          "checksum": "21dfea983c88da858e0ce2b4dc681f6dc3b1cee427fee35df24bb95542516bb3",
          "path": "https://github.com/loft-sh/devpod-provider-kubernetes/releases/download/v0.1.19/devpod-provider-kubernetes-darwin-arm64"
        },
        {
          "os": "windows",
          "arch": "amd64",
          "checksum": "042a528d64f8ce449ae9b3cf6f85ae4bb8e603627857c7d479574a3e4cbc1ae0",
          "path": "https://github.com/loft-sh/devpod-provider-kubernetes/releases/download/v0.1.19/devpod-provider-kubernetes-windows-amd64.exe"
        }
      ]
    },
    "dockerless": {
      "disabled": "${DOCKERLESS_DISABLED}",
      "image": "${DOCKERLESS_IMAGE}"
    },
    "driver": "custom",
    "docker": {},
    "custom": {
      "findDevContainer": [
        "\"${KUBERNETES_PROVIDER}\" find"
      ],
      "commandDevContainer": [
        "\"${KUBERNETES_PROVIDER}\" command"
      ],
      "targetArchitecture": [
        "\"${KUBERNETES_PROVIDER}\" target-architecture"
      ],
      "runDevContainer": [
        "\"${KUBERNETES_PROVIDER}\" run"
      ],
      "startDevContainer": [
        "\"${KUBERNETES_PROVIDER}\" start"
      ],
      "stopDevContainer": [
        "\"${KUBERNETES_PROVIDER}\" stop"
      ],
      "deleteDevContainer": [
        "\"${KUBERNETES_PROVIDER}\" delete"
      ],
      "canReprovision": "true"
    }
  },
  "exec": {
    "command": [
      "\"${DEVPOD}\" helper sh -c \"${COMMAND}\""
    ]
  }
}

Local Environment:

  • DevPod Version: v0.6.12%
  • Operating System: mac
  • ARCH of the OS: ARM64

DevPod Provider:

  • Cloud Provider: azure via local kube config
  • Kubernetes Provider: 1.31.1
  • Local/remote provider: ssh
  • Custom provider: provide imported provider.yaml config file

Anything else we need to know?

kennyd3d avatar Feb 18 '25 18:02 kennyd3d

Hi @kennyd3d, I believe for arm you need to use the 3-bookworm or 3-bulleye variant. Reference - https://hub.docker.com/r/microsoft/devcontainers-python

Let me know if that helps!

bkneis avatar Mar 03 '25 09:03 bkneis

Hi @kennyd3d, I believe for arm you need to use the 3-bookworm or 3-bulleye variant. Reference - https://hub.docker.com/r/microsoft/devcontainers-python

Let me know if that helps!

Thank you @bkneis. I did some more testing on windows 10 and ran into a different error (see logs). I'm wondering if it has to do with running it on a windows k8s cluster? I've updated the issue with the current error.

kennyd3d avatar Mar 03 '25 19:03 kennyd3d

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar May 03 '25 02:05 github-actions[bot]

This issue was closed because it has been inactive for 30 days since being marked as stale.

github-actions[bot] avatar Jun 02 '25 02:06 github-actions[bot]