[go: up one dir, main page]

[CI] Test k3s for review environment isolation

Summary

Reference: &25 (comment 1495549657)

We've been using K3s in a few projects for awhile, to test pinned k8s versions. We created a docker image which can be easily run as a service in our CI pipelines.

Source Project: https://gitlab.com/gitlab-org/cluster-integration/test-utils/k3s-gitlab-ci

Example running a test against multiple K8s versions:

test:
  stage: test
  image: registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image/releases/3.7.1-kube-1.20.11-alpine-3.14
  parallel:
    matrix:
      - K3S_VERSION:
        - v1.24.14-k3s1
        - v1.25.10-k3s1
        - v1.26.5-k3s1
        - v1.27.1-k3s1
  services:
    - name: registry.gitlab.com/gitlab-org/cluster-integration/test-utils/k3s-gitlab-ci/releases/$K3S_VERSION
      alias: k3s
  script:
    - apk add curl
    - curl k3s:8081 > k3s.yaml
    - export KUBECONFIG=$(pwd)/k3s.yaml
    - kubectl version
    - kubectl cluster-info

Similar to #1308 (closed), let's see how feasible/helpful k3s would be in CI.

References

Acceptance criteria

  • Feature branch is created that uses the above project template for review environments
  • Releases are compared to existing cloud environments including deploy time, required changes, and stability
Edited by Mitchell Nielsen