Skip to content

Support Kubernetes 1.35 #5

Support Kubernetes 1.35

Support Kubernetes 1.35 #5

name: Container images
on:
workflow_dispatch:
pull_request:
branches:
- main
paths-ignore:
- 'charts/**'
push:
branches:
- main
paths-ignore:
- 'charts/**'
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# needed for git describe --tags
fetch-depth: 0
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute tag
id: tag
run: echo "value=$(git describe --tags)" >> "$GITHUB_OUTPUT"
- name: Build and push controller image
uses: docker/build-push-action@v6
with:
context: .
load: true
push: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
tags: ghcr.io/kilnfi/carina:controller-${{ steps.tag.outputs.value }}
cache-from: type=gha,scope=controller
cache-to: type=gha,mode=max,scope=controller
- name: Build and push scheduler image
uses: docker/build-push-action@v6
with:
context: ./scheduler
load: true
push: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
tags: ghcr.io/kilnfi/carina:scheduler-${{ steps.tag.outputs.value }}
cache-from: type=gha,scope=scheduler
cache-to: type=gha,mode=max,scope=scheduler
- name: Create KinD cluster
if: github.ref_name != 'main'
uses: helm/kind-action@v1
with:
cluster_name: kind
# Interactive debug
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
- name: Test Kubernetes
if: github.ref_name != 'main'
run: |
set -eu -o pipefail -x
tag="${{ steps.tag.outputs.value }}"
kind load docker-image "ghcr.io/kilnfi/carina:controller-${tag}" "ghcr.io/kilnfi/carina:scheduler-${tag}"
helm install --create-namespace -n carina --set carina-scheduler.image.tag="scheduler-${tag}" --set image.carina.tag="controller-${tag}" --hide-notes --wait carina-csi-driver charts/
# Create a 50G loopback device inside carina-node to simulate a disk
kubectl wait pod -n carina -l app=csi-carina-node --for=condition=ready --timeout=120s
kubectl exec -t -n carina -c csi-carina-node ds/csi-carina-node -- sh -c "truncate -s 50G /tmp/disk.device && losetup /dev/loop2 /tmp/disk.device && pvcreate /dev/loop2"
sleep 30s
# Run the helm test — creates a PVC and a pod that uses carina storage.
helm test -n carina --hide-notes carina-csi-driver