Last active
March 1, 2026 04:59
-
-
Save fizz/307ce198f24c78b55a721f80971e491e to your computer and use it in GitHub Desktop.
kubeflow-version-snapshot.sh: quick Kubeflow/KFP runtime version inventory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # kubeflow-version-snapshot.sh — quick Kubeflow/KFP runtime version inventory | |
| # | |
| # Usage: | |
| # ./kubeflow-version-snapshot.sh <kube-context> [namespace] | |
| # ./kubeflow-version-snapshot.sh mlinfra-prod kubeflow | |
| # ./kubeflow-version-snapshot.sh mlinfra-29 kubeflow | |
| # | |
| # Example output (mlinfra-prod, 2026-02-27): | |
| # | |
| # Kubeflow Version Snapshot | |
| # Context: mlinfra-prod | |
| # Namespace: kubeflow | |
| # Timestamp: 2026-02-27T17:45:12Z | |
| # | |
| # == Core Kubeflow Components == | |
| # admission-webhook-deployment docker.io/kubeflownotebookswg/poddefaults-webhook:v1.8.0 | |
| # centraldashboard docker.io/kubeflownotebookswg/centraldashboard:v1.8.0 | |
| # notebook-controller-deployment docker.io/kubeflownotebookswg/notebook-controller:v1.8.0 | |
| # profiles-deployment docker.io/kubeflownotebookswg/profile-controller:v1.8.0 | |
| # volumes-web-app-deployment docker.io/kubeflownotebookswg/volumes-web-app:v1.8.0 | |
| # | |
| # == KFP Components == | |
| # cache-server gcr.io/ml-pipeline/cache-server:2.0.5 | |
| # kubeflow-pipelines-profile-controller python:3.7 | |
| # metadata-grpc-deployment gcr.io/tfx-oss-public/ml_metadata_store_server:1.14.0 | |
| # ml-pipeline gcr.io/ml-pipeline/api-server:2.0.5 | |
| # ml-pipeline-persistenceagent gcr.io/ml-pipeline/persistenceagent:2.0.5 | |
| # ml-pipeline-scheduledworkflow gcr.io/ml-pipeline/scheduledworkflow:2.0.5 | |
| # ml-pipeline-ui ghcr.io/kubeflow/kfp-frontend:2.5.0 | |
| # ml-pipeline-ui-artifact ghcr.io/kubeflow/kfp-frontend:2.5.0 | |
| # ml-pipeline-viewer-crd gcr.io/ml-pipeline/viewer-crd-controller:2.0.5 | |
| # ml-pipeline-visualizationserver gcr.io/ml-pipeline/visualization-server:2.0.5 | |
| # | |
| # == KFP Install Config == | |
| # pipeline-install-config.appVersion: 2.5.0 | |
| # profile-controller env configmap: kubeflow-pipelines-profile-controller-env | |
| # profile-controller FRONTEND_IMAGE: ghcr.io/kubeflow/kfp-frontend | |
| # profile-controller FRONTEND_TAG: 2.5.0 | |
| # | |
| # == Inferred Kubeflow Release Line (best effort) == | |
| # core tag: v1.8.0 | |
| # inferred kubeflow line: v1.8.x | |
| CTX="${1:-mlinfra-prod}" | |
| NS="${2:-kubeflow}" | |
| need_cmd() { | |
| command -v "$1" >/dev/null 2>&1 || { | |
| echo "error: missing required command: $1" >&2 | |
| exit 1 | |
| } | |
| } | |
| need_cmd kubectl | |
| need_cmd sed | |
| need_cmd sort | |
| need_cmd uniq | |
| need_cmd awk | |
| print_section() { | |
| local title="$1" | |
| echo | |
| echo "== $title ==" | |
| } | |
| safe_get_cm_key() { | |
| local cm="$1" | |
| local key="$2" | |
| kubectl --context "$CTX" -n "$NS" get cm "$cm" -o "jsonpath={.data.${key}}" 2>/dev/null || true | |
| } | |
| echo "Kubeflow Version Snapshot" | |
| echo "Context: $CTX" | |
| echo "Namespace: $NS" | |
| echo "Timestamp: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" | |
| print_section "Core Kubeflow Components" | |
| kubectl --context "$CTX" -n "$NS" get deploy -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range .spec.template.spec.containers[*]}{.image}{" "}{end}{"\n"}{end}' \ | |
| | awk -F'\t' ' | |
| $1 ~ /centraldashboard|profiles-deployment|admission-webhook-deployment|volumes-web-app-deployment|notebook-controller-deployment/ { print } | |
| ' \ | |
| | sort | |
| print_section "KFP Components" | |
| kubectl --context "$CTX" -n "$NS" get deploy -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range .spec.template.spec.containers[*]}{.image}{" "}{end}{"\n"}{end}' \ | |
| | awk -F'\t' ' | |
| $1 ~ /ml-pipeline|metadata-|cache-|kubeflow-pipelines-profile-controller/ { print } | |
| ' \ | |
| | sort | |
| print_section "KFP Install Config" | |
| KFP_APP_VERSION="$(safe_get_cm_key pipeline-install-config appVersion)" | |
| if [[ -n "$KFP_APP_VERSION" ]]; then | |
| echo "pipeline-install-config.appVersion: $KFP_APP_VERSION" | |
| else | |
| echo "pipeline-install-config.appVersion: <missing>" | |
| fi | |
| PC_ENV_CM="$(kubectl --context "$CTX" -n "$NS" get deploy kubeflow-pipelines-profile-controller -o jsonpath='{.spec.template.spec.containers[0].envFrom[0].configMapRef.name}' 2>/dev/null || true)" | |
| if [[ -n "$PC_ENV_CM" ]]; then | |
| FRONTEND_IMAGE="$(safe_get_cm_key "$PC_ENV_CM" FRONTEND_IMAGE)" | |
| FRONTEND_TAG="$(safe_get_cm_key "$PC_ENV_CM" FRONTEND_TAG)" | |
| echo "profile-controller env configmap: $PC_ENV_CM" | |
| echo "profile-controller FRONTEND_IMAGE: ${FRONTEND_IMAGE:-<unset>}" | |
| echo "profile-controller FRONTEND_TAG: ${FRONTEND_TAG:-<unset>}" | |
| fi | |
| print_section "Inferred Kubeflow Release Line (best effort)" | |
| CORE_TAGS="$( | |
| kubectl --context "$CTX" -n "$NS" get deploy -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range .spec.template.spec.containers[*]}{.image}{"\n"}{end}{end}' \ | |
| | awk -F'\t' '$1 ~ /centraldashboard|profiles-deployment|admission-webhook-deployment|volumes-web-app-deployment/ { print $2 }' \ | |
| | sed -n 's#.*:v\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*#\1#p' \ | |
| | sort | uniq | |
| )" | |
| if [[ -n "$CORE_TAGS" ]]; then | |
| echo "$CORE_TAGS" | sed 's/^/core tag: v/' | |
| FIRST="$(echo "$CORE_TAGS" | head -n1)" | |
| echo "inferred kubeflow line: v${FIRST%.*}.x" | |
| else | |
| echo "Could not infer from core tags." | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment