This repository has been archived on 2026-10-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
coredns-deployment/install.sh
T

21 lines
843 B
Bash
Executable File

#!/bin/sh
set -eu
project_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
expected_context=kubernetes-admin@kubernetes
current_context=$(kubectl config current-context)
if [ "$current_context" != "$expected_context" ]; then
echo "Refusing to modify context '$current_context'; expected '$expected_context'." >&2
exit 1
fi
kubectl -n kube-system patch deployment coredns --type=strategic \
--patch-file "$project_dir/coredns-scheduling-patch.yaml" \
--dry-run=server >/dev/null
kubectl apply --server-side --dry-run=server \
-f "$project_dir/coredns-pdb.yaml" >/dev/null
kubectl -n kube-system patch deployment coredns --type=strategic \
--patch-file "$project_dir/coredns-scheduling-patch.yaml"
kubectl apply --server-side -f "$project_dir/coredns-pdb.yaml"
kubectl -n kube-system rollout status deployment/coredns --timeout=5m