concourse / concourse-chart

Helm chart to install Concourse
Apache License 2.0
146 stars 176 forks source link

WIP: initial windows workers #317

Open ramonskie opened 2 years ago

ramonskie commented 2 years ago

got this working so you could add windows workers to your concourse on GKE

i created a extra gke-windows nodepool

gcloud container node-pools create concourse-windows-workers \
  --cluster=$CLUSTER_NAME \
  --machine-type=n1-standard-4 \
  --image-type=WINDOWS_LTSC_CONTAINERD \
  --enable-autoscaling \
  --enable-autoupgrade \
  --num-nodes=1 \
  --min-nodes=1 \
  --max-nodes=2 \
  --local-ssd-count 1 \
  --region "$PROJECT_REGION" \
  --tags=workers \
  --node-taints=workers=true:NoSchedule \
  --service-account=${CONCOURSE_SA}@${PROJECT_ID}.iam.gserviceaccount.com

and add the following to helm chart values.

windows_worker:
  enabled: true
  replicas: 1
  tolerations:
    - key: "workers"
      operator: "Equal"
      value: "true"
      effect: "NoSchedule"
    - key: "node.kubernetes.io/os"
      operator: "Equal"
      value: "windows"
      effect: "NoSchedule"
  kind: Deployment
  nodeSelector:
    cloud.google.com/gke-local-ssd: "true"
    cloud.google.com/gke-nodepool: "concourse-windows-workers"
  resources:
    requests:
      cpu: "3000m"

this code needs some cleanup and a good review. as in its current state its a bit hacky.

we are currently using this in our project https://github.com/cloudfoundry/bosh-community-stemcell-ci-infra this will setup a complete concourse cluster with credhub, uaa, and certs generation etc.

ramonskie commented 2 years ago

the dockerfile to create the windows docker image is.

# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as download

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV CONCOURSE_VERSION="7.8.3"

# Download file
RUN Invoke-WebRequest ('https://github.com/concourse/concourse/releases/download/v{0}/concourse-{0}-windows-amd64.zip' -f $env:CONCOURSE_VERSION) -OutFile 'concourse.zip' -UseBasicParsing ; `
    Expand-Archive concourse.zip -DestinationPath C:\ ; `
    Remove-Item -Path concourse.zip

# clean env
FROM mcr.microsoft.com/windows/servercore:ltsc2019

COPY --from=download C:\concourse\bin\concourse.exe /concourse.exe

ENTRYPOINT ["\\concourse.exe"]

i created this PR to check if anyone has any intrest in it what so ever

rkoster commented 1 year ago

@xtremerui did you have a change to take a look at this?