woodpecker-ci / helm

Woodpecker CI Helm Charts
Apache License 2.0
23 stars 17 forks source link

overwrite nodeSelector for jobs #105

Closed ghebo closed 11 months ago

ghebo commented 1 year ago

Pod that should execute a job got Node-Selectors: kubernetes.io/arch=amd64

while nodes in GKE with Kubernetes version: v1.26.6-gke.1700 are labeled beta.kubernetes.io/arch=amd64

.woodpecker.yml

pipeline:
  dummy-job:
    image: busybox
    commands:
      - echo "Dummy pipeline"
    backend_options:
      kubernetes:
        nodeSelector:
          beta.kubernetes.io/arch: amd64

values.yaml

    agent:
      image:
        tag: "v1.0.0"
      env:
        WOODPECKER_AGENT_SECRET: "aaaaaaa"
        WOODPECKER_SERVER: "woodpecker-server.woodpecker.svc.cluster.local:9000"
        WOODPECKER_BACKEND: kubernetes
        WOODPECKER_BACKEND_K8S_NAMESPACE: woodpecker
      nodeSelector: 
        beta.kubernetes.io/arch: amd64

In the documentation is mentioned:

Labels defined here will be appended to a list already containing "kubernetes.io/arch". By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_PLATFORM. To overwrite this, you need to specify this label in the nodeSelector section.

The question is how to remove that default label, and add beta.kubernetes.io/arch=amd64

pat-s commented 1 year ago

Which WP version are you using?

    backend_options:
      kubernetes:
        nodeSelector:
          beta.kubernetes.io/arch: amd64

will set set label. To remove it, just remove it from the pipeline definition. Otherwise I don't understand your question...

pat-s commented 11 months ago

Ah I think I know understand your question. beta.kubernetes.io/arch has actually been deprecated since quite some time. Interesting that GKE still uses it.

I think we won't apply a fix here as either this is already fixed in 1.27+ or should be soon. So I'd recommend to upgrade your k8s and check which version uses kubernetes.io/arch instead of beta.kubernetes.io/arch.