forked from kubevirt/kubevirt
-
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.
rook got k8s-1.17 provider and functional test of vm snapshot with st…
…orage Signed-off-by: Michael Henriksen <[email protected]>
- Loading branch information
Showing
13 changed files
with
2,894 additions
and
0 deletions.
There are no files selected for viewing
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
80 changes: 80 additions & 0 deletions
80
manifests/testing/external-snapshotter/rbac-snapshot-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,80 @@ | ||
# RBAC file for the snapshot controller. | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: snapshot-controller | ||
|
||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
# rename if there are conflicts | ||
name: snapshot-controller-runner | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["persistentvolumes"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["persistentvolumeclaims"] | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: ["storage.k8s.io"] | ||
resources: ["storageclasses"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["list", "watch", "create", "update", "patch"] | ||
- apiGroups: ["snapshot.storage.k8s.io"] | ||
resources: ["volumesnapshotclasses"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["snapshot.storage.k8s.io"] | ||
resources: ["volumesnapshotcontents"] | ||
verbs: ["create", "get", "list", "watch", "update", "delete"] | ||
- apiGroups: ["snapshot.storage.k8s.io"] | ||
resources: ["volumesnapshots"] | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: ["snapshot.storage.k8s.io"] | ||
resources: ["volumesnapshots/status"] | ||
verbs: ["update"] | ||
|
||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: snapshot-controller-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: snapshot-controller | ||
# replace with non-default namespace name | ||
namespace: default | ||
roleRef: | ||
kind: ClusterRole | ||
# change the name also here if the ClusterRole gets renamed | ||
name: snapshot-controller-runner | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
namespace: default # TODO: replace with the namespace you want for your controller | ||
name: snapshot-controller-leaderelection | ||
rules: | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["get", "watch", "list", "delete", "update", "create"] | ||
|
||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: snapshot-controller-leaderelection | ||
namespace: default # TODO: replace with the namespace you want for your controller | ||
subjects: | ||
- kind: ServiceAccount | ||
name: snapshot-controller | ||
namespace: default # TODO: replace with the namespace you want for your controller | ||
roleRef: | ||
kind: Role | ||
name: snapshot-controller-leaderelection | ||
apiGroup: rbac.authorization.k8s.io | ||
|
26 changes: 26 additions & 0 deletions
26
manifests/testing/external-snapshotter/setup-snapshot-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,26 @@ | ||
# This YAML file shows how to deploy the snapshot controller | ||
|
||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: snapshot-controller | ||
spec: | ||
serviceName: "snapshot-controller" | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: snapshot-controller | ||
template: | ||
metadata: | ||
labels: | ||
app: snapshot-controller | ||
spec: | ||
serviceAccount: snapshot-controller | ||
containers: | ||
- name: snapshot-controller | ||
image: quay.io/k8scsi/snapshot-controller:v2.0.1 | ||
args: | ||
- "--v=5" | ||
- "--leader-election=false" | ||
imagePullPolicy: Always |
85 changes: 85 additions & 0 deletions
85
manifests/testing/external-snapshotter/snapshot.storage.k8s.io_volumesnapshotclasses.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,85 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.5 | ||
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/260" | ||
creationTimestamp: null | ||
name: volumesnapshotclasses.snapshot.storage.k8s.io | ||
spec: | ||
additionalPrinterColumns: | ||
- JSONPath: .driver | ||
name: Driver | ||
type: string | ||
- JSONPath: .deletionPolicy | ||
description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass | ||
should be deleted when its bound VolumeSnapshot is deleted. | ||
name: DeletionPolicy | ||
type: string | ||
- JSONPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
group: snapshot.storage.k8s.io | ||
names: | ||
kind: VolumeSnapshotClass | ||
listKind: VolumeSnapshotClassList | ||
plural: volumesnapshotclasses | ||
singular: volumesnapshotclass | ||
preserveUnknownFields: false | ||
scope: Cluster | ||
subresources: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: VolumeSnapshotClass specifies parameters that a underlying storage | ||
system uses when creating a volume snapshot. A specific VolumeSnapshotClass | ||
is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses | ||
are non-namespaced | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
deletionPolicy: | ||
description: deletionPolicy determines whether a VolumeSnapshotContent created | ||
through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot | ||
is deleted. Supported values are "Retain" and "Delete". "Retain" means | ||
that the VolumeSnapshotContent and its physical snapshot on underlying | ||
storage system are kept. "Delete" means that the VolumeSnapshotContent | ||
and its physical snapshot on underlying storage system are deleted. Required. | ||
enum: | ||
- Delete | ||
- Retain | ||
type: string | ||
driver: | ||
description: driver is the name of the storage driver that handles this | ||
VolumeSnapshotClass. Required. | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
parameters: | ||
additionalProperties: | ||
type: string | ||
description: parameters is a key-value map with storage driver specific | ||
parameters for creating snapshots. These values are opaque to Kubernetes. | ||
type: object | ||
required: | ||
- deletionPolicy | ||
- driver | ||
type: object | ||
version: v1beta1 | ||
versions: | ||
- name: v1beta1 | ||
served: true | ||
storage: true | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.