Skip to content

Commit

Permalink
WILL BE RESET
Browse files Browse the repository at this point in the history
  • Loading branch information
na2na-p committed Aug 8, 2024
1 parent e816581 commit 77833e3
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 10 deletions.
13 changes: 5 additions & 8 deletions infra/k8s/web/templates/descheduler-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ kind: CronJob
metadata:
name: {{ include "web.fullname" . }}
spec:
schedule: {{ .Values.descheduler.schedule }}
schedule: "{{ .Values.descheduler.schedule }}"
jobTemplate:
spec:
template:
spec:
containers:
- name: descheduler
image: k8s.gcr.io/descheduler/descheduler:v0.26.1
image: registry.k8s.io/descheduler/descheduler:v0.30.1
command:
- "/bin/descheduler"
args:
Expand All @@ -20,9 +20,8 @@ spec:
- --descheduling-interval
- "30s"
volumeMounts:
- name: policy-volume
mountPath: /policy-dir
subPath: policy.yaml
- mountPath: /policy-dir
name: policy-volume
livenessProbe:
failureThreshold: 3
httpGet:
Expand All @@ -32,11 +31,9 @@ spec:
initialDelaySeconds: 3
periodSeconds: 10
restartPolicy: Never
serviceAccountName: {{ include "web.fullname" . }}-sa
volumes:
- name: policy-volume
configMap:
name: {{ include "web.fullname" . }}
items:
- key: policy.yaml
path: policy.yaml
{{- end }}
48 changes: 48 additions & 0 deletions infra/k8s/web/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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: {{ include "web.fullname" . }}-sa
---
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: {{ include "web.fullname" . }}-sa
kind: ServiceAccount
namespace: {{ .Release.Namespace }}
3 changes: 1 addition & 2 deletions infra/k8s/web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ readinessProbe:
descheduler:
enabled: true
maxPodLifeTimeSeconds: 86400
# 6時間に1回実行
schedule: "0 */6 * * *"
schedule: "*/1 * * * *"

0 comments on commit 77833e3

Please sign in to comment.