Skip to content

Commit 1d40562

Browse files
authored
fix cluster-role permissions issue and add ability to control log-level in deployment (#348)
1 parent e68be60 commit 1d40562

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

charts/k8s-shredder/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ maintainers:
1515
email: gosselin@adobe.com
1616
url: https://adobe.com
1717

18-
version: 0.2.1
18+
version: 0.2.2
1919
appVersion: v0.3.1

charts/k8s-shredder/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# k8s-shredder
22

3-
![Version: 0.2.1](https://img.shields.io/badge/Version-0.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.3.1](https://img.shields.io/badge/AppVersion-v0.3.1-informational?style=flat-square)
3+
![Version: 0.2.2](https://img.shields.io/badge/Version-0.2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.3.1](https://img.shields.io/badge/AppVersion-v0.3.1-informational?style=flat-square)
44

55
a novel way of dealing with kubernetes nodes blocked from draining
66

charts/k8s-shredder/templates/cluster-role.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
rules:
99
- apiGroups: ["*"]
1010
resources: [nodes]
11-
verbs: [get, list, watch]
11+
verbs: [get, list, watch, update, patch]
1212
- apiGroups: ["*"]
1313
resources: [pods, pods/eviction]
1414
verbs: ["*"]
@@ -18,4 +18,7 @@ rules:
1818
- apiGroups: [ "argoproj.io" ]
1919
resources: [ rollouts ]
2020
verbs: [ get, list, watch, update, patch ]
21-
{{ end }}
21+
- apiGroups: [ "karpenter.sh" ]
22+
resources: [ nodeclaims ]
23+
verbs: [ get, list, watch ]
24+
{{ end }}

charts/k8s-shredder/templates/deployment.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ spec:
4747
args:
4848
- "--config=/k8s-shredder-config/config.yaml"
4949
- "--metrics-port=8080"
50+
- "--log-level={{ .Values.logLevel }}"
5051
{{- if .Values.dryRun }}
5152
- "--dry-run"
5253
{{- end }}
@@ -86,13 +87,29 @@ spec:
8687
nodeSelector:
8788
{{- toYaml . | nindent 8 }}
8889
{{- end }}
89-
{{- with .Values.affinity }}
90+
{{- if .Values.affinity }}
9091
affinity:
91-
{{- toYaml . | nindent 8 }}
92+
{{- toYaml .Values.affinity | nindent 8 }}
93+
{{- else }}
94+
affinity:
95+
nodeAffinity:
96+
preferredDuringSchedulingIgnoredDuringExecution:
97+
- weight: 1
98+
preference:
99+
matchExpressions:
100+
- key: node.kubernetes.io/role
101+
operator: In
102+
values:
103+
- master
92104
{{- end }}
93-
{{- with .Values.tolerations }}
105+
{{- if .Values.tolerations }}
94106
tolerations:
95-
{{- toYaml . | nindent 8 }}
107+
{{- toYaml .Values.tolerations | nindent 8 }}
108+
{{- else }}
109+
tolerations:
110+
- key: "node-role.kubernetes.io/control-plane"
111+
operator: "Exists"
112+
effect: "NoSchedule"
96113
{{- end }}
97114
{{- with .Values.topologySpreadConstraints }}
98115
topologySpreadConstraints:

0 commit comments

Comments
 (0)