forked from fluid-cloudnative/fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add controller and rbac yaml for CacheFSRuntime
Fixes: fluid-cloudnative#3674 Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
- Loading branch information
Showing
7 changed files
with
256 additions
and
2 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
charts/fluid/fluid/templates/controller/cachefsruntime_controller.yaml
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,86 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cachefsruntime-controller | ||
namespace: {{ include "fluid.namespace" . }} | ||
labels: | ||
control-plane: cachefsruntime-controller | ||
spec: | ||
selector: | ||
matchLabels: | ||
control-plane: cachefsruntime-controller | ||
{{ if .Values.runtime.cachefs.enabled -}} | ||
replicas: {{ .Values.runtime.cachefs.replicas }} | ||
{{- else }} | ||
replicas: 0 | ||
{{- end }} | ||
template: | ||
metadata: | ||
labels: | ||
control-plane: cachefsruntime-controller | ||
annotations: | ||
{{ if gt (.Values.runtime.cachefs.replicas | int) 1 -}} | ||
controller.runtime.fluid.io/replicas: {{ .Values.runtime.cachefs.replicas | quote }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.image.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: cachefsruntime-controller | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: type | ||
operator: NotIn | ||
values: | ||
- virtual-kubelet | ||
{{- if .Values.runtime.cachefs.tolerations }} | ||
tolerations: | ||
{{ toYaml .Values.runtime.cachefs.tolerations | indent 6 }} | ||
{{- end }} | ||
#hostNetwork: true | ||
containers: | ||
- image: "{{ .Values.runtime.cachefs.controller.image }}" | ||
name: manager | ||
args: | ||
- --development=false | ||
- --pprof-addr=:6060 | ||
- --enable-leader-election | ||
- --runtime-workers={{ .Values.runtime.cachefs.runtimeWorkers }} | ||
- --leader-election-namespace={{ include "fluid.namespace" . }} | ||
command: ["cachefsruntime-controller", "start"] | ||
env: | ||
{{- if .Values.runtime.cachefs.fuse.image }} | ||
- name: CACHEFS_IMAGE_ENV | ||
value: {{ .Values.runtime.cachefs.fuse.image | quote }} | ||
{{- end }} | ||
{{- if .Values.runtime.mountRoot }} | ||
- name: MOUNT_ROOT | ||
value: {{ .Values.runtime.mountRoot | quote }} | ||
{{- end }} | ||
{{- if .Values.runtime.criticalFusePod }} | ||
- name: CRITICAL_FUSE_POD | ||
value: {{ ternary "true" "false" (semverCompare ">=1.16.0-0" .Capabilities.KubeVersion.Version) | quote }} | ||
{{- end }} | ||
{{- if .Values.runtime.syncRetryDuration }} | ||
- name: FLUID_SYNC_RETRY_DURATION | ||
value: {{ .Values.runtime.syncRetryDuration | quote }} | ||
{{- end }} | ||
- name: HELM_DRIVER | ||
value: {{ template "fluid.helmDriver" . }} | ||
ports: | ||
- containerPort: 8080 | ||
name: metrics | ||
protocol: TCP | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 1536Mi | ||
requests: | ||
cpu: 100m | ||
memory: 200Mi | ||
terminationGracePeriodSeconds: 10 |
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,152 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: cachefsruntime-controller | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- persistentvolumeclaims | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- persistentvolumes | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods/exec | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- patch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
{{- template "fluid.helmDriver.rbacs" . }} | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- create | ||
- delete | ||
- list | ||
- watch | ||
- get | ||
- apiGroups: | ||
- data.fluid.io | ||
resources: | ||
- cachefsruntimes | ||
- datasets | ||
- cachefsruntimes/status | ||
- datasets/status | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- serviceaccounts | ||
verbs: | ||
- create | ||
- list | ||
- get | ||
- delete | ||
- apiGroups: | ||
- rbac.authorization.k8s.io | ||
resources: | ||
- roles | ||
- rolebindings | ||
verbs: | ||
- create | ||
- list | ||
- get | ||
- delete | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- daemonsets | ||
- statefulsets | ||
- daemonsets/status | ||
- statefulsets/status | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- "*" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: cachefsruntime-clusterrolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cachefsruntime-controller | ||
subjects: | ||
- kind: ServiceAccount | ||
name: cachefsruntime-controller | ||
namespace: {{ include "fluid.namespace" . }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: cachefsruntime-controller | ||
namespace: {{ include "fluid.namespace" . }} |
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 |
---|---|---|
|
@@ -65,6 +65,7 @@ rules: | |
- thinruntimes | ||
- efcruntimes | ||
- vineyardruntimes | ||
- cachefsruntimes | ||
verbs: | ||
- get | ||
- list | ||
|
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