Skip to content

Support Kubernetes 1.35 #125

Support Kubernetes 1.35

Support Kubernetes 1.35 #125

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# needed for git describe --tags
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build images
run: |
set -x
tag="$(git describe --tags)"
echo "Build controller image"
go mod vendor
docker build \
--cache-from type=gha \
--cache-to type=gha,mode=max \
-t "ghcr.io/kilnfi/carina:controller-${tag}" .
echo "Build scheduler image"
cd scheduler
go mod vendor
docker build \
--cache-from type=gha \
--cache-to type=gha,mode=max \
-t "ghcr.io/kilnfi/carina:scheduler-${tag}" .
# Interactive debug
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
- name: Create KinD cluster
if: github.ref_name != 'main'
uses: helm/kind-action@v1.14.0
with:
cluster_name: kind
- name: Test Kubernetes
if: github.ref_name != 'main'
run: |
set -x
tag="$(git describe --tags)"
kind load docker-image "ghcr.io/kilnfi/carina:controller-${tag}" "ghcr.io/kilnfi/carina:scheduler-${tag}"
# Install carina without a device first — we need the carina-node
# daemonset running to create a fake block device inside it.
sed -i -e "s/__TAG__/${tag}/" .github/kiln-values.yaml
helm upgrade --install --create-namespace -n carina carina-csi-driver charts/ -f .github/kiln-values.yaml --wait --timeout=20m
# Create a 12G loopback device inside carina-node to simulate a disk,
# then re-install with the device configured and initialize LVM on it.
kubectl wait pod -n carina -l app=csi-carina-node --for=condition=ready --timeout=120s
device="$(kubectl exec -t -n carina ds/csi-carina-node -c csi-carina-node -- \
sh -c 'truncate --size=12G /tmp/disk.device; losetup --show -f /tmp/disk.device')"
sed -i -e "s/__DEVICE__/${device#/dev/}/" .github/kiln-values.yaml
kubectl exec -t -n carina ds/csi-carina-node -c csi-carina-node -- \
sh -c "pvcreate ${device}"
helm upgrade --install -n carina carina-csi-driver charts/ -f .github/kiln-values.yaml --wait --timeout=200s
# Run the helm test — creates a PVC and a pod that uses carina storage.
helm test -n carina carina-csi-driver --timeout=500s
- name: Waot
if: always()
run: sleep 20m
- name: Push image
if: github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: |
set -x
tag="$(git describe --tags)"
docker push "ghcr.io/kilnfi/carina:controller-${tag}"
docker push "ghcr.io/kilnfi/carina:scheduler-${tag}"
helm:
name: Helm chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# needed for git describe --tags
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push chart
if: github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: |
set -x
tag="$(git describe --tags)"
sed -i -r "s/^(appV|v)ersion *:.*$/\1ersion: $tag/" charts/Chart.yaml
helm package charts --version "${tag}"
HELM_EXPERIMENTAL_OCI=1 helm push "carina-csi-driver-${tag}.tgz" "oci://ghcr.io/kilnfi/helm-charts"