|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Copyright 2026 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +# Deploys node-problem-detector as a DaemonSet onto a running cluster for the |
| 18 | +# GCE cluster e2e jobs, which exercise k8s.io/kubernetes |
| 19 | +# test/e2e/node/node_problem_detector.go. The kube-up NPD addon was removed from |
| 20 | +# kubernetes/kubernetes, so that test falls back to looking for a |
| 21 | +# "node-problem-detector" pod; this script provides it. |
| 22 | +# |
| 23 | +# The image comes from the per-branch community staging registry, matching the |
| 24 | +# node e2e job (see test/build.sh). PULL_BASE_REF is set by Prow to the base |
| 25 | +# branch under test and defaults to master for local runs. |
| 26 | + |
| 27 | +set -o errexit |
| 28 | +set -o nounset |
| 29 | +set -o pipefail |
| 30 | + |
| 31 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 32 | +readonly SCRIPT_DIR |
| 33 | +readonly IMAGE="gcr.io/k8s-staging-npd/node-problem-detector" |
| 34 | +readonly TAG="${PULL_BASE_REF:-master}" |
| 35 | + |
| 36 | +echo "Deploying node-problem-detector DaemonSet (image tag: ${TAG})..." |
| 37 | +kubectl kustomize "${SCRIPT_DIR}" | |
| 38 | + sed -E "s|image: ${IMAGE}:[^[:space:]]+|image: ${IMAGE}:${TAG}|" | |
| 39 | + kubectl apply -f - |
| 40 | + |
| 41 | +echo "Waiting for node-problem-detector DaemonSet to become ready..." |
| 42 | +kubectl --namespace=kube-system rollout status daemonset/node-problem-detector --timeout=5m |
0 commit comments