Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design a vineyard csi driver for workloads based on kubernetes volumes. #1533

Merged
merged 4 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions charts/vineyard-operator/templates/csidriver-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: csidrivers.k8s.v6d.io
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "vineyard-operator.fullname"
. }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.11.0
labels:
{{- include "vineyard-operator.labels" . | nindent 4 }}
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
name: webhook-service
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
- v1
group: k8s.v6d.io
names:
kind: CSIDriver
listKind: CSIDriverList
plural: csidrivers
singular: csidriver
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
clusters:
items:
properties:
name:
default: ""
type: string
namespace:
default: ""
type: string
type: object
type: array
enableToleration:
default: false
type: boolean
enableVerboseLog:
default: false
type: boolean
image:
default: vineyardcloudnative/vineyard-operator
type: string
imagePullPolicy:
default: IfNotPresent
type: string
sidecar:
default:
attacherImage: registry.k8s.io/sig-storage/csi-attacher:v4.0.0
enableTopology: false
imagePullPolicy: Always
livenessProbeImage: registry.k8s.io/sig-storage/livenessprobe:v2.8.0
nodeRegistrarImage: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.6.0
provisionerImage: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0
properties:
attacherImage:
default: registry.k8s.io/sig-storage/csi-attacher:v4.0.0
type: string
enableTopology:
default: false
type: boolean
imagePullPolicy:
default: Always
type: string
livenessProbeImage:
default: registry.k8s.io/sig-storage/livenessprobe:v2.8.0
type: string
nodeRegistrarImage:
default: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.6.0
type: string
provisionerImage:
default: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0
type: string
type: object
storageClassName:
default: vineyard-csi
type: string
volumeBindingMode:
default: WaitForFirstConsumer
type: string
type: object
status:
properties:
state:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 2 additions & 0 deletions charts/vineyard-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ metadata:
name: {{ include "vineyard-operator.fullname" . }}-controller-manager
labels:
control-plane: controller-manager
k8s.v6d.io/instance: vineyard-operator
{{- include "vineyard-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.controllerManager.replicas }}
Expand All @@ -30,6 +31,7 @@ spec:
containers:
- args:
- manager
- --verbose
command:
- /vineyardctl
env:
Expand Down
134 changes: 134 additions & 0 deletions charts/vineyard-operator/templates/manager-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ rules:
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand All @@ -34,6 +42,13 @@ rules:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims/finalizers
verbs:
- patch
- apiGroups:
- ""
resources:
Expand All @@ -45,6 +60,13 @@ rules:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumes/finalizers
verbs:
- patch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -90,6 +112,16 @@ rules:
- delete
- get
- update
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- apps
resources:
Expand Down Expand Up @@ -127,6 +159,14 @@ rules:
- get
- list
- update
- apiGroups:
- csi.storage.k8s.io
resources:
- csinodeinfos
verbs:
- get
- list
- watch
- apiGroups:
- k8s.v6d.io
resources:
Expand All @@ -147,6 +187,32 @@ rules:
- get
- patch
- update
- apiGroups:
- k8s.v6d.io
resources:
- csidrivers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- k8s.v6d.io
resources:
- csidrivers/finalizers
verbs:
- update
- apiGroups:
- k8s.v6d.io
resources:
- csidrivers/status
verbs:
- get
- patch
- update
- apiGroups:
- k8s.v6d.io
resources:
Expand Down Expand Up @@ -285,6 +351,74 @@ rules:
- get
- patch
- update
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotclasses
verbs:
- get
- list
- watch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- update
- watch
- apiGroups:
- storage.k8s.io
resources:
- csinodes
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments/status
verbs:
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
12 changes: 12 additions & 0 deletions charts/vineyard-operator/templates/recover-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ kind: CustomResourceDefinition
metadata:
name: recovers.k8s.v6d.io
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "vineyard-operator.fullname"
. }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.11.0
labels:
{{- include "vineyard-operator.labels" . | nindent 4 }}
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
name: webhook-service
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
- v1
group: k8s.v6d.io
names:
kind: Recover
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ webhooks:
resources:
- backups
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: '{{ include "vineyard-operator.fullname" . }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /validate-k8s-v6d-io-v1alpha1-csidriver
failurePolicy: Fail
name: vcsidriver.kb.io
rules:
- apiGroups:
- k8s.v6d.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- csidrivers
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/kubernetes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Vineyard on Kubernetes
./kubernetes/using-vineyard-operator.rst
./kubernetes/ml-pipeline-mars-pytorch.rst
./kubernetes/data-sharing-with-vineyard-on-kubernetes.rst
./kubernetes/efficient-data-sharing-in-kubeflow-with-vineyard-csi-driver.rst

Vineyard can be seamlessly deployed on Kubernetes, managed by the :ref:`vineyard-operator`,
to enhance big-data workflows through its data-aware scheduling policy. This policy
Expand Down
Loading