Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance doesn't get cleaned up with Kubernetes driver #270

Open
davidspek opened this issue Sep 12, 2023 · 1 comment
Open

Instance doesn't get cleaned up with Kubernetes driver #270

davidspek opened this issue Sep 12, 2023 · 1 comment

Comments

@davidspek
Copy link

Behaviour

When using the Kubernetes driver the buildx builder instance isn't getting cleaned up, leaving dangling deployments on the cluster (which in our case is leaving extra nodes on the cluster indefinitely).

Steps to reproduce this issue

  1. Use the kubernetes driver
  2. Have a build run
  3. Note the builder isn't cleaned up

Expected behaviour

The builder gets cleaned up removing the Kubernetes deployment

Actual behaviour

Kubernetes deployments of builder instances linger indefinitely.

Configuration

- name: Set up Docker Buildx
        id: builder
        uses: docker/setup-buildx-action@v3
        with:
          cleanup: true
          driver: kubernetes
          platforms: linux/amd64
          driver-opts: |
            namespace=buildx
            requests.cpu=1.5
            requests.memory=3.5Gi
            "nodeselector=plural.sh/scalingGroup=buildx-spot-x86"
            "tolerations=key=plural.sh/capacityType,value=SPOT,effect=NoSchedule;key=plural.sh/reserved,value=BUILDX,effect=NoSchedule"
      - name: Append ARM buildx builder from AWS
        run: |
          docker buildx create \
            --append \
            --bootstrap \
            --name ${{ steps.builder.outputs.name }} \
            --driver=kubernetes \
            --platform linux/arm64 \
            --node=${{ steps.builder.outputs.name }}-arm64 \
            --buildkitd-flags "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" \
            --driver-opt namespace=buildx \
            --driver-opt requests.cpu=1.5 \
            --driver-opt requests.memory=3.5Gi \
            '--driver-opt="nodeselector=plural.sh/scalingGroup=buildx-spot-arm64"' \
            '--driver-opt="tolerations=key=plural.sh/capacityType,value=SPOT,effect=NoSchedule;key=plural.sh/reserved,value=BUILDX,effect=NoSchedule"'

Logs

Download the log file of your build
and attach it to this issue.

@crazy-max
Copy link
Member

I think the current API for the Kubernetes driver in Buildx is using the pod.spec. For this case we would need a driver option to use ephemeralcontainers maybe? Any idea @AkihiroSuda @morlay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants