Skip to content

Modernize Go version and all dependencies to align with Volcano v1.15 / Kubernetes 1.35 #1

Description

@hajnalmt

Context

This project is frozen at early 2021 Kubernetes ecosystem standards. It currently uses:

  • Go 1.15 (5+ years old, EOL)
  • k8s.io/ v0.19.6* (Kubernetes 1.19, EOL since 2021)
  • volcano.sh/apis v0.0.0-20210528 (5 years old)
  • klog v1 (deprecated, unmaintained)
  • github.com/google/cadvisor v0.37.3 (very outdated)
  • github.com/golang/protobuf v1.4.3 (deprecated, replaced by google.golang.org/protobuf)

The project directly imports k8s.io/kubernetes internal packages (pkg/kubelet/cm/cpumanager/state, pkg/kubelet/cadvisor, pkg/kubelet/eviction), which is an anti-pattern explicitly discouraged by the Kubernetes project. This forces a massive 25-entry replace block in go.mod and makes upgrades extremely painful.

Target

Align with Volcano master (future v1.15) which targets Kubernetes 1.35:

Dependency Current Target
Go 1.15 1.25.0
k8s.io/* v0.19.6 v0.35.0
klog v1.0.0 klog/v2 v2.130.1
volcano.sh/apis v0.0.0-20210528 Current Volcano APIs module
cadvisor v0.37.3 v0.53.0
protobuf github.com/golang/protobuf google.golang.org/protobuf

Tasks

  • Upgrade Go version in go.mod to 1.25.0
  • Remove direct dependency on k8s.io/kubernetes internal packages
    • Extract or vendor only the CPU manager checkpoint parsing logic (struct + unmarshal)
    • Replace k8s.io/kubernetes/pkg/kubelet/cm/cpuset with the public k8s.io/utils/cpuset package (available since K8s 1.25+)
    • Replace cadvisor machine info initialization with a lighter approach or direct sysfs reading
    • Replace kubelet eviction threshold parsing with local implementation
  • Upgrade all k8s.io/* dependencies to v0.35.0
  • Migrate from klog v1 to klog/v2 (update all import paths and initialization)
  • Update volcano.sh/apis to match current Volcano CRD types (Numatopology)
  • Remove the replace directive block entirely
  • Replace deprecated github.com/golang/protobuf with google.golang.org/protobuf
  • Replace deprecated io/ioutil usage with os package equivalents
  • Verify the project compiles and runs against a Kubernetes 1.35 cluster

Notes

The hardest part of this work is removing the k8s.io/kubernetes internal dependency. The project imports:

  1. k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state — for checkpoint parsing (CPU allocations)
  2. k8s.io/kubernetes/pkg/kubelet/cm/cpuset — for CPU set parsing (now available as k8s.io/utils/cpuset)
  3. k8s.io/kubernetes/pkg/kubelet/cadvisor — for machine info (NUMA node count, memory)
  4. k8s.io/kubernetes/pkg/kubelet/eviction — for eviction threshold parsing

Each of these needs to be replaced with either a public API, a vendored minimal copy, or a reimplementation.

Priority

Critical — the project cannot compile with any modern Go toolchain or target any supported Kubernetes version in its current state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions