Skip to content

Commit

Permalink
feat(node-servant-applier): got rid of openkruise, using daemonset
Browse files Browse the repository at this point in the history
Signed-off-by: Armin Schlegel <armin.schlegel@gmx.de>
  • Loading branch information
siredmar committed Jan 31, 2024
1 parent c666385 commit f1c7bf0
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
apiVersion: apps.kruise.io/v1alpha1
kind: BroadcastJob
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
job-name: node-servant-applier
name: node-servant-applier
labels:
app.kubernetes.io/name: node-servant-applier
namespace: kube-system
spec:
selector:
matchLabels:
app.kubernetes.io/name: node-servant-applier
template:
metadata:
labels:
job-name: node-servant-applier
app.kubernetes.io/name: node-servant-applier
spec:
serviceAccount: node-servant-applier
containers:
Expand Down Expand Up @@ -38,7 +41,6 @@ spec:
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: IfNotPresent
name: node-servant-applier
restartPolicy: Never
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand All @@ -48,10 +50,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}

{{- with .Values.completionPolicy }}
completionPolicy:
{{- toYaml . | nindent 4 }}
{{- end }}



45 changes: 45 additions & 0 deletions charts/node-servant-applier/templates/rbac-applier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: node-servant-applier
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: node-servant-applier
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- list
- watch
- get
- create
- update
- apiGroups:
- batch
resources:
- jobs
verbs:
- list
- watch
- get
- create
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: node-servant-applier
subjects:
- kind: ServiceAccount
name: node-servant-applier
namespace: kube-system
apiGroup: ""
roleRef:
kind: Role
name: node-servant-applier
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: node-servant-applier
name: node-servant-convert
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: node-servant-convert
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- get
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: node-servant-convert
subjects:
- kind: ServiceAccount
name: node-servant-convert
namespace: kube-system
apiGroup: ""
roleRef:
kind: ClusterRole
name: node-servant-convert
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: node-servant-applier
name: node-servant-convert
rules:
- apiGroups:
- ""
Expand All @@ -33,41 +62,12 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: node-servant-applier
name: node-servant-convert
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: node-servant-applier
name: node-servant-convert
subjects:
- kind: ServiceAccount
name: node-servant-applier
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: node-servant-applier
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- get
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: node-servant-applier
subjects:
- kind: ServiceAccount
name: node-servant-applier
namespace: kube-system
apiGroup: ""
roleRef:
kind: ClusterRole
name: node-servant-applier
apiGroup: rbac.authorization.k8s.io
name: node-servant-convert
namespace: kube-system
9 changes: 4 additions & 5 deletions charts/node-servant-applier/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
image:
registry: ghcr.io/edgefarm/edgefarm
repository: node-servant-applier
tag: v3
tag: v5

tolerations:
- effect: NoSchedule
Expand All @@ -19,7 +19,6 @@ affinity:
nodeSelectorTerms:
- matchExpressions:
- key: node.edgefarm.io/to-be-converted
operator: Exists

completionPolicy:
type: Never
operator: In
values:
- "true"

0 comments on commit f1c7bf0

Please sign in to comment.