mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Remove node termination handler addon
This commit is contained in:
parent
17f3990ea1
commit
e02ff0687e
@ -1,4 +0,0 @@
|
||||
# GCE Node Termination Handler
|
||||
|
||||
This addon deploys [GCE Node Termination Handler](https://github.com/GoogleCloudPlatform/k8s-node-termination-handler) on to kubernetes clusters on GCP.
|
||||
It is meant to help translate GCE VM termination notifications into kubernetes graceful terminations.
|
@ -1,74 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
k8s-app: node-termination-handler
|
||||
namespace: kube-system
|
||||
name: node-termination-handler
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: node-termination-handler
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: node-termination-handler
|
||||
spec:
|
||||
priorityClassName: system-node-critical
|
||||
# Necessary to reboot node
|
||||
hostPID: true
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
# Restrict to GPU nodes or preemptible nodes
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: cloud.google.com/gke-accelerator
|
||||
operator: Exists
|
||||
- matchExpressions:
|
||||
- key: cloud.google.com/gke-preemptible
|
||||
operator: Exists
|
||||
volumes:
|
||||
- name: klet-service-account
|
||||
hostPath:
|
||||
path: /var/lib/kubelet
|
||||
- name: klet-ca-crt
|
||||
hostPath:
|
||||
path: /etc/srv/kubernetes
|
||||
tolerations:
|
||||
# Run regardless of any existing taints.
|
||||
- effect: NoSchedule
|
||||
operator: Exists
|
||||
- effect: NoExecute
|
||||
operator: Exists
|
||||
containers:
|
||||
- image: k8s.gcr.io/gke-node-termination-handler@sha256:aca12d17b222dfed755e28a44d92721e477915fb73211d0a0f8925a1fa847cca
|
||||
name: node-termination-handler
|
||||
command: ["./node-termination-handler"]
|
||||
args: ["--logtostderr", "--exclude-pods=$(POD_NAME):$(POD_NAMESPACE)", "-v=10", "--kubeconfig=/var/lib/kubelet/kubeconfig", "--taint=cloud.google.com/impending-node-termination::NoSchedule"]
|
||||
securityContext:
|
||||
capabilities:
|
||||
# Necessary to reboot node
|
||||
add: ["SYS_BOOT"]
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
resources:
|
||||
limits:
|
||||
cpu: 50m
|
||||
memory: 30Mi
|
||||
volumeMounts:
|
||||
- name: klet-service-account
|
||||
mountPath: /var/lib/kubelet
|
||||
- name: klet-ca-crt
|
||||
mountPath: /etc/srv/kubernetes
|
@ -513,14 +513,6 @@ CONCURRENT_SERVICE_SYNCS="${CONCURRENT_SERVICE_SYNCS:-}"
|
||||
|
||||
export SERVICEACCOUNT_ISSUER="https://kubernetes.io/${CLUSTER_NAME}"
|
||||
|
||||
# Optional: Enable Node termination Handler for Preemptible and GPU VMs.
|
||||
# https://github.com/GoogleCloudPlatform/k8s-node-termination-handler
|
||||
ENABLE_NODE_TERMINATION_HANDLER="${ENABLE_NODE_TERMINATION_HANDLER:-false}"
|
||||
# Override default Node Termination Handler Image
|
||||
if [[ "${NODE_TERMINATION_HANDLER_IMAGE:-}" ]]; then
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} NODE_TERMINATION_HANDLER_IMAGE"
|
||||
fi
|
||||
|
||||
# Taint Windows nodes by default to prevent Linux workloads from being
|
||||
# scheduled onto them.
|
||||
WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=win1809:NoSchedule}"
|
||||
|
@ -565,14 +565,6 @@ CONCURRENT_SERVICE_SYNCS=${CONCURRENT_SERVICE_SYNCS:-}
|
||||
# to resolve the partially qualified name.
|
||||
export SERVICEACCOUNT_ISSUER='https://kubernetes.default.svc.cluster.local'
|
||||
|
||||
# Optional: Enable Node termination Handler for Preemptible and GPU VMs.
|
||||
# https://github.com/GoogleCloudPlatform/k8s-node-termination-handler
|
||||
ENABLE_NODE_TERMINATION_HANDLER=${ENABLE_NODE_TERMINATION_HANDLER:-false}
|
||||
# Override default Node Termination Handler Image
|
||||
if [[ "${NODE_TERMINATION_HANDLER_IMAGE:-}" ]]; then
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} NODE_TERMINATION_HANDLER_IMAGE"
|
||||
fi
|
||||
|
||||
# Taint Windows nodes by default to prevent Linux workloads from being
|
||||
# scheduled onto them.
|
||||
WINDOWS_NODE_TAINTS=${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=win1809:NoSchedule}
|
||||
|
@ -2287,12 +2287,6 @@ function setup-addon-manifests {
|
||||
copy-manifests "${psp_dir}" "${dst_dir}"
|
||||
fi
|
||||
fi
|
||||
if [[ "${ENABLE_NODE_TERMINATION_HANDLER:-}" == "true" ]]; then
|
||||
local -r nth_dir="${src_dir}/${3:-$2}/node-termination-handler"
|
||||
if [[ -d "${nth_dir}" ]]; then
|
||||
copy-manifests "${nth_dir}" "${dst_dir}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# A function that downloads extra addons from a URL and puts them in the GCI
|
||||
@ -2708,10 +2702,6 @@ EOF
|
||||
if [[ "${ENABLE_NVIDIA_GPU_DEVICE_PLUGIN:-}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "device-plugins/nvidia-gpu"
|
||||
fi
|
||||
if [[ "${ENABLE_NODE_TERMINATION_HANDLER:-}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "node-termination-handler"
|
||||
setup-node-termination-handler-manifest ''
|
||||
fi
|
||||
# Setting up the konnectivity-agent daemonset
|
||||
if [[ "${RUN_KONNECTIVITY_PODS:-false}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "konnectivity-agent"
|
||||
@ -2820,13 +2810,6 @@ EOF
|
||||
cp "${src_file}" /etc/kubernetes/manifests
|
||||
}
|
||||
|
||||
function setup-node-termination-handler-manifest {
|
||||
local -r nth_manifest="/etc/kubernetes/$1/$2/daemonset.yaml"
|
||||
if [[ -n "${NODE_TERMINATION_HANDLER_IMAGE}" ]]; then
|
||||
sed -i "s|image:.*|image: ${NODE_TERMINATION_HANDLER_IMAGE}|" "${nth_manifest}"
|
||||
fi
|
||||
}
|
||||
|
||||
function setup-konnectivity-agent-manifest {
|
||||
local -r manifest="/etc/kubernetes/addons/konnectivity-agent/konnectivity-agent-ds.yaml"
|
||||
sed -i "s|__APISERVER_IP__|${KUBERNETES_MASTER_NAME}|g" "${manifest}"
|
||||
|
@ -1246,7 +1246,6 @@ VOLUME_PLUGIN_DIR: $(yaml-quote "${VOLUME_PLUGIN_DIR}")
|
||||
KUBELET_ARGS: $(yaml-quote "${KUBELET_ARGS}")
|
||||
REQUIRE_METADATA_KUBELET_CONFIG_FILE: $(yaml-quote true)
|
||||
ENABLE_NETD: $(yaml-quote "${ENABLE_NETD:-false}")
|
||||
ENABLE_NODE_TERMINATION_HANDLER: $(yaml-quote "${ENABLE_NODE_TERMINATION_HANDLER:-false}")
|
||||
CUSTOM_NETD_YAML: |
|
||||
${CUSTOM_NETD_YAML//\'/\'\'}
|
||||
CUSTOM_CALICO_NODE_DAEMONSET_YAML: |
|
||||
|
Loading…
Reference in New Issue
Block a user