Skip to content

Commit 58542a3

Browse files
committed
test: deploy NPD for cluster e2e
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
1 parent 3c9bbe7 commit 58542a3

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

deployment/kustomization.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
# Basic node-problem-detector install (system-log-monitor only). Lets the
5+
# manifests be consumed as a kustomize base, e.g. `kubectl apply -k deployment/`
6+
# or from the e2e overlay in test/e2e/manifests/.
7+
resources:
8+
- rbac.yaml
9+
- node-problem-detector-config.yaml
10+
- node-problem-detector.yaml

test/e2e/manifests/deploy-npd.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
# Reuse the production base in deployment/ so this e2e overlay never drifts from
5+
# it; only the image is overridden, to the per-branch community staging build.
6+
resources:
7+
- ../../../deployment
8+
9+
images:
10+
- name: registry.k8s.io/node-problem-detector/node-problem-detector
11+
newName: gcr.io/k8s-staging-npd/node-problem-detector
12+
newTag: master

0 commit comments

Comments
 (0)