-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install Descheduler, fix startup readywait
Descheduler will be used for eve-app rebalancing during cluster node reboots/upgrades in an upcoming PR. Wait for longhorn daemonsets to be ready, before upcoming PR to snapshot single-node /var/lib kube db. Resolve sometimes failure to import external-boot-image Wait for containerd before importing. Tighter error checking on import. Signed-off-by: Andrew Durbin <andrewd@zededa.com>
- Loading branch information
1 parent
cc44ccf
commit 87f6a27
Showing
11 changed files
with
4,903 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# from: https://raw.githubusercontent.com/kubernetes-sigs/descheduler/${DESCHEDULER_VERSION}/kubernetes/job/job.yaml | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: descheduler-job | ||
namespace: kube-system | ||
spec: | ||
parallelism: 1 | ||
completions: 1 | ||
template: | ||
metadata: | ||
name: descheduler-pod | ||
spec: | ||
priorityClassName: system-cluster-critical | ||
containers: | ||
- name: descheduler | ||
image: registry.k8s.io/descheduler/descheduler:v0.29.0 | ||
volumeMounts: | ||
- mountPath: /policy-dir | ||
name: policy-volume | ||
command: | ||
- "/bin/descheduler" | ||
args: | ||
- "--policy-config-file" | ||
- "/policy-dir/policy.yaml" | ||
- "--v" | ||
- "3" | ||
resources: | ||
requests: | ||
cpu: "500m" | ||
memory: "256Mi" | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /healthz | ||
port: 10258 | ||
scheme: HTTPS | ||
initialDelaySeconds: 3 | ||
periodSeconds: 10 | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
privileged: false | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
restartPolicy: "Never" | ||
serviceAccountName: descheduler-sa | ||
volumes: | ||
- name: policy-volume | ||
configMap: | ||
name: descheduler-policy-configmap |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: descheduler-policy-configmap | ||
namespace: kube-system | ||
data: | ||
policy.yaml: | | ||
apiVersion: "descheduler/v1alpha2" | ||
kind: "DeschedulerPolicy" | ||
profiles: | ||
- name: ProfileName | ||
pluginConfig: | ||
- name: "RemovePodsViolatingNodeAffinity" | ||
args: | ||
namespaces: | ||
include: | ||
- "eve-kube-app" | ||
nodeAffinityType: | ||
- "preferredDuringSchedulingIgnoredDuringExecution" | ||
plugins: | ||
deschedule: | ||
enabled: | ||
- "RemovePodsViolatingNodeAffinity" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2024 Zededa, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
DESCHEDULER_VERSION="v0.29.0" | ||
|
||
descheduler_install() | ||
{ | ||
logmsg "Applying Descheduler ${DESCHEDULER_VERSION}" | ||
if ! kubectl apply -f /etc/descheduler_rbac.yaml; then | ||
logmsg "descheduler rbac not yet applied" | ||
return 1 | ||
fi | ||
if ! kubectl apply -f /etc/descheduler-policy-configmap.yaml; then | ||
logmsg "descheduler configmap not yet applied" | ||
return 1 | ||
fi | ||
return 0 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: descheduler-cluster-role | ||
rules: | ||
- apiGroups: ["events.k8s.io"] | ||
resources: ["events"] | ||
verbs: ["create", "update"] | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
verbs: ["get", "watch", "list"] | ||
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
verbs: ["get", "watch", "list"] | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["get", "watch", "list", "delete"] | ||
- apiGroups: [""] | ||
resources: ["pods/eviction"] | ||
verbs: ["create"] | ||
- apiGroups: ["scheduling.k8s.io"] | ||
resources: ["priorityclasses"] | ||
verbs: ["get", "watch", "list"] | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["create"] | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
resourceNames: ["descheduler"] | ||
verbs: ["get", "patch", "delete"] | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: descheduler-sa | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: descheduler-cluster-role-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: descheduler-cluster-role | ||
subjects: | ||
- name: descheduler-sa | ||
kind: ServiceAccount | ||
namespace: kube-system |
Oops, something went wrong.