Implementation:Kubeflow Kubeflow Kubectl Kustomize Version Check
| Knowledge Sources | |
|---|---|
| Domains | Kubeflow, Platform Deployment, Prerequisites |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Concrete tool for validating prerequisite CLI tool versions provided by kubectl and kustomize.
Description
This implementation uses the kubectl version --client and kustomize version commands to confirm that the local workstation has compatible versions of both tools installed. The kubectl client must report a version of 1.25 or higher, and the kustomize binary must be present and functional. Additionally, kubectl version (without the --client flag) is used to verify connectivity to the target Kubernetes cluster and confirm the server version meets the minimum requirement.
Usage
Run these checks at the start of every Kubeflow deployment workflow, before proceeding to installation method selection or any manifest application. These commands require no special installation beyond having kubectl and kustomize on the system PATH.
Code Reference
Source Location
- Repository: kubeflow/kubeflow
- File: README.md (lines 41-53, referencing prerequisites)
Signature
kubectl version --client [--output=yaml|json]
kubectl version
kustomize version
Import
# Install kubectl (Linux example)
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
# Install kustomize
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin/
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| --client | flag | No | When passed to kubectl version, restricts output to the client version only without contacting the cluster |
| --output | string | No | Output format: yaml or json. Defaults to human-readable text |
| KUBECONFIG | env var | No | Path to kubeconfig file. Defaults to ~/.kube/config |
| Kubernetes cluster endpoint | URL | Yes | The API server endpoint configured in kubeconfig for server version check |
Outputs
| Name | Type | Description |
|---|---|---|
| Client Version | string | The kubectl client version (e.g., v1.28.2) |
| Server Version | string | The Kubernetes API server version (e.g., v1.27.4) |
| Kustomize Version | string | The kustomize binary version (e.g., v5.3.0) |
| Exit Code | integer | 0 on success, non-zero if the tool is missing or the cluster is unreachable |
Usage Examples
Basic Usage
# Check kubectl client version only
kubectl version --client
# Check both client and server versions
kubectl version
# Check kustomize version
kustomize version
# Full prerequisites validation script
echo "=== Checking kubectl client version ==="
kubectl version --client --output=yaml
echo "=== Checking cluster connectivity and server version ==="
kubectl version --output=yaml
echo "=== Checking kustomize version ==="
kustomize version
echo "=== Checking cluster-admin permissions ==="
kubectl auth can-i create namespaces --all-namespaces
kubectl auth can-i create customresourcedefinitions --all-namespaces