1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
|
# This manifest is autogenerated via `make manifests` command
# Do the modification to the zfs-driver.yaml in directory deploy/yamls/
# and then run `make manifests` command
# This manifest deploys the OpenEBS ZFS control plane components,
# with associated CRs & RBAC rules.
# Create the OpenEBS namespace
# This is the default namespace where the ZFS driver will create all
# its resources. If we want to change it to use a different namespace
# modify this to create the new namespace and also modify the OPENEBS_NAMESPACE
# env for the ZFS Driver's controller and agent deployments.
# please note that this should be changed while initial setup, once ZFS Driver
# is deployed with a namespace, we should never modify it as old resources will
# not be available under the new namespace and ZFS Driver looks for all the resources
# in the OPENEBS_NAMESPACE namespace passed as an env.
apiVersion: v1
kind: Namespace
metadata:
name: openebs
##############################################
########### ############
########### ZFSVolume CRD ############
########### ############
##############################################
# ZFSVolume CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: zfsvolumes.zfs.openebs.io
spec:
group: zfs.openebs.io
names:
kind: ZFSVolume
listKind: ZFSVolumeList
plural: zfsvolumes
shortNames:
- zfsvol
- zv
singular: zfsvolume
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: ZFS Pool where the volume is created
jsonPath: .spec.poolName
name: ZPool
type: string
- description: Node where the volume is created
jsonPath: .spec.ownerNodeID
name: NodeID
type: string
- description: Size of the volume
jsonPath: .spec.capacity
name: Size
type: string
- description: Status of the volume
jsonPath: .status.state
name: Status
type: string
- description: filesystem created on the volume
jsonPath: .spec.fsType
name: Filesystem
type: string
- description: Age of the volume
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: ZFSVolume represents a ZFS based volume
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
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
metadata:
type: object
spec:
description: VolumeInfo defines ZFS volume parameters for all modes in
which ZFS volumes can be created like - ZFS volume with filesystem,
ZFS Volume exposed as zfs or ZFS volume exposed as raw block device.
Some of the parameters can be only set during creation time (as specified
in the details of the parameter), and a few are editable. In case of
Cloned volumes, the parameters are assigned the same values as the source
volume.
properties:
capacity:
description: Capacity of the volume
minLength: 1
type: string
compression:
description: 'Compression specifies the block-level compression algorithm
to be applied to the ZFS Volume. The value "on" indicates ZFS to
use the default compression algorithm. The default compression algorithm
used by ZFS will be either lzjb or, if the lz4_compress feature
is enabled, lz4. Compression property can be edited after the volume
has been created. The change will only be applied to the newly-written
data. For instance, if the Volume was created with "off" and the
next day the compression was modified to "on", the data written
prior to setting "on" will not be compressed. Default Value: off.'
pattern: ^(on|off|lzjb|zstd|gzip|gzip-[1-9]|zle|lz4)$
type: string
dedup:
description: 'Deduplication is the process for removing redundant
data at the block level, reducing the total amount of data stored.
If a file system has the dedup property enabled, duplicate data
blocks are removed synchronously. The result is that only unique
data is stored and common components are shared among files. Deduplication
can consume significant processing power (CPU) and memory as well
as generate additional disk IO. Before creating a pool with deduplication
enabled, ensure that you have planned your hardware requirements
appropriately and implemented appropriate recovery practices, such
as regular backups. As an alternative to deduplication consider
using compression=lz4, as a less resource-intensive alternative.
should be enabled on the zvol. Dedup property can be edited after
the volume has been created. Default Value: off.'
enum:
- "on"
- "off"
type: string
encryption:
description: 'Enabling the encryption feature allows for the creation
of encrypted filesystems and volumes. ZFS will encrypt file and
zvol data, file attributes, ACLs, permission bits, directory listings,
FUID mappings, and userused / groupused data. ZFS will not encrypt
metadata related to the pool structure, including dataset and snapshot
names, dataset hierarchy, properties, file size, file holes, and
deduplication tables (though the deduplicated data itself is encrypted).
Default Value: off.'
pattern: ^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$
type: string
fsType:
description: 'FsType specifies filesystem type for the zfs volume/dataset.
If FsType is provided as "zfs", then the driver will create a ZFS
dataset, formatting is not required as underlying filesystem is
ZFS anyway. If FsType is ext2, ext3, ext4 or xfs, then the driver
will create a ZVOL and format the volume accordingly. FsType can
not be modified once volume has been provisioned. Default Value:
ext4.'
type: string
keyformat:
description: KeyFormat specifies format of the encryption key The
supported KeyFormats are passphrase, raw, hex.
enum:
- passphrase
- raw
- hex
type: string
keylocation:
description: KeyLocation is the location of key for the encryption
type: string
ownerNodeID:
description: OwnerNodeID is the Node ID where the ZPOOL is running
which is where the volume has been provisioned. OwnerNodeID can
not be edited after the volume has been provisioned.
minLength: 1
type: string
poolName:
description: poolName specifies the name of the pool where the volume
has been created. PoolName can not be edited after the volume has
been provisioned.
minLength: 1
type: string
recordsize:
description: 'Specifies a suggested block size for files in the file
system. The size specified must be a power of two greater than or
equal to 512 and less than or equal to 128 Kbytes. RecordSize property
can be edited after the volume has been created. Changing the file
system''s recordsize affects only files created afterward; existing
files are unaffected. Default Value: 128k.'
minLength: 1
type: string
shared:
description: Shared specifies whether the volume can be shared among
multiple pods. If it is not set to "yes", then the ZFS-LocalPV Driver
will not allow the volumes to be mounted by more than one pods.
enum:
- "yes"
- "no"
type: string
snapname:
description: SnapName specifies the name of the snapshot where the
volume has been cloned from. Snapname can not be edited after the
volume has been provisioned.
type: string
thinProvision:
description: 'ThinProvision describes whether space reservation for
the source volume is required or not. The value "yes" indicates
that volume should be thin provisioned and "no" means thick provisioning
of the volume. If thinProvision is set to "yes" then volume can
be provisioned even if the ZPOOL does not have the enough capacity.
If thinProvision is set to "no" then volume can be provisioned only
if the ZPOOL has enough capacity and capacity required by volume
can be reserved. ThinProvision can not be modified once volume has
been provisioned. Default Value: no.'
enum:
- "yes"
- "no"
type: string
volblocksize:
description: 'VolBlockSize specifies the block size for the zvol.
The volsize can only be set to a multiple of volblocksize, and cannot
be zero. VolBlockSize can not be edited after the volume has been
provisioned. Default Value: 8k.'
minLength: 1
type: string
volumeType:
description: volumeType determines whether the volume is of type "DATASET"
or "ZVOL". If fstype provided in the storageclass is "zfs", a volume
of type dataset will be created. If "ext4", "ext3", "ext2" or "xfs"
is mentioned as fstype in the storageclass, then a volume of type
zvol will be created, which will be further formatted as the fstype
provided in the storageclass. VolumeType can not be modified once
volume has been provisioned.
enum:
- ZVOL
- DATASET
type: string
required:
- capacity
- ownerNodeID
- poolName
- volumeType
type: object
status:
description: VolStatus string that specifies the current state of the
volume provisioning request.
properties:
state:
description: State specifies the current state of the volume provisioning
request. The state "Pending" means that the volume creation request
has not processed yet. The state "Ready" means that the volume has
been created and it is ready for the use.
enum:
- Pending
- Ready
- Failed
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources: {}
- additionalPrinterColumns:
- description: ZFS Pool where the volume is created
jsonPath: .spec.poolName
name: ZPool
type: string
- description: Node where the volume is created
jsonPath: .spec.ownerNodeID
name: Node
type: string
- description: Size of the volume
jsonPath: .spec.capacity
name: Size
type: string
- description: Status of the volume
jsonPath: .status.state
name: Status
type: string
- description: filesystem created on the volume
jsonPath: .spec.fsType
name: Filesystem
type: string
- description: Age of the volume
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: ZFSVolume represents a ZFS based volume
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
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
metadata:
type: object
spec:
description: VolumeInfo defines ZFS volume parameters for all modes in
which ZFS volumes can be created like - ZFS volume with filesystem,
ZFS Volume exposed as zfs or ZFS volume exposed as raw block device.
Some of the parameters can be only set during creation time (as specified
in the details of the parameter), and a few are editable. In case of
Cloned volumes, the parameters are assigned the same values as the source
volume.
properties:
capacity:
description: Capacity of the volume
minLength: 1
type: string
compression:
description: 'Compression specifies the block-level compression algorithm
to be applied to the ZFS Volume. The value "on" indicates ZFS to
use the default compression algorithm. The default compression algorithm
used by ZFS will be either lzjb or, if the lz4_compress feature
is enabled, lz4. Compression property can be edited after the volume
has been created. The change will only be applied to the newly-written
data. For instance, if the Volume was created with "off" and the
next day the compression was modified to "on", the data written
prior to setting "on" will not be compressed. Default Value: off.'
pattern: ^(on|off|lzjb|gzip|gzip-[1-9]|zle|lz4)$
type: string
dedup:
description: 'Deduplication is the process for removing redundant
data at the block level, reducing the total amount of data stored.
If a file system has the dedup property enabled, duplicate data
blocks are removed synchronously. The result is that only unique
data is stored and common components are shared among files. Deduplication
can consume significant processing power (CPU) and memory as well
as generate additional disk IO. Before creating a pool with deduplication
enabled, ensure that you have planned your hardware requirements
appropriately and implemented appropriate recovery practices, such
as regular backups. As an alternative to deduplication consider
using compression=lz4, as a less resource-intensive alternative.
should be enabled on the zvol. Dedup property can be edited after
the volume has been created. Default Value: off.'
enum:
- "on"
- "off"
type: string
encryption:
description: 'Enabling the encryption feature allows for the creation
of encrypted filesystems and volumes. ZFS will encrypt file and
zvol data, file attributes, ACLs, permission bits, directory listings,
FUID mappings, and userused / groupused data. ZFS will not encrypt
metadata related to the pool structure, including dataset and snapshot
names, dataset hierarchy, properties, file size, file holes, and
deduplication tables (though the deduplicated data itself is encrypted).
Default Value: off.'
pattern: ^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$
type: string
fsType:
description: 'FsType specifies filesystem type for the zfs volume/dataset.
If FsType is provided as "zfs", then the driver will create a ZFS
dataset, formatting is not required as underlying filesystem is
ZFS anyway. If FsType is ext2, ext3, ext4 or xfs, then the driver
will create a ZVOL and format the volume accordingly. FsType can
not be modified once volume has been provisioned. Default Value:
ext4.'
type: string
keyformat:
description: KeyFormat specifies format of the encryption key The
supported KeyFormats are passphrase, raw, hex.
enum:
- passphrase
- raw
- hex
type: string
keylocation:
description: KeyLocation is the location of key for the encryption
type: string
ownerNodeID:
description: OwnerNodeID is the Node ID where the ZPOOL is running
which is where the volume has been provisioned. OwnerNodeID can
not be edited after the volume has been provisioned.
minLength: 1
type: string
poolName:
description: poolName specifies the name of the pool where the volume
has been created. PoolName can not be edited after the volume has
been provisioned.
minLength: 1
type: string
recordsize:
description: 'Specifies a suggested block size for files in the file
system. The size specified must be a power of two greater than or
equal to 512 and less than or equal to 128 Kbytes. RecordSize property
can be edited after the volume has been created. Changing the file
system''s recordsize affects only files created afterward; existing
files are unaffected. Default Value: 128k.'
minLength: 1
type: string
snapname:
description: SnapName specifies the name of the snapshot where the
volume has been cloned from. Snapname can not be edited after the
volume has been provisioned.
type: string
thinProvision:
description: 'ThinProvision describes whether space reservation for
the source volume is required or not. The value "yes" indicates
that volume should be thin provisioned and "no" means thick provisioning
of the volume. If thinProvision is set to "yes" then volume can
be provisioned even if the ZPOOL does not have the enough capacity.
If thinProvision is set to "no" then volume can be provisioned only
if the ZPOOL has enough capacity and capacity required by volume
can be reserved. ThinProvision can not be modified once volume has
been provisioned. Default Value: no.'
enum:
- "yes"
- "no"
type: string
volblocksize:
description: 'VolBlockSize specifies the block size for the zvol.
The volsize can only be set to a multiple of volblocksize, and cannot
be zero. VolBlockSize can not be edited after the volume has been
provisioned. Default Value: 8k.'
minLength: 1
type: string
volumeType:
description: volumeType determines whether the volume is of type "DATASET"
or "ZVOL". If fstype provided in the storageclass is "zfs", a volume
of type dataset will be created. If "ext4", "ext3", "ext2" or "xfs"
is mentioned as fstype in the storageclass, then a volume of type
zvol will be created, which will be further formatted as the fstype
provided in the storageclass. VolumeType can not be modified once
volume has been provisioned.
enum:
- ZVOL
- DATASET
type: string
required:
- capacity
- ownerNodeID
- poolName
- volumeType
type: object
status:
description: VolStatus string that specifies the current state of the
volume provisioning request.
properties:
state:
description: State specifies the current state of the volume provisioning
request. The state "Pending" means that the volume creation request
has not processed yet. The state "Ready" means that the volume has
been created and it is ready for the use.
enum:
- Pending
- Ready
type: string
type: object
required:
- spec
type: object
served: true
storage: false
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
##############################################
########### ############
########### ZFSSnapshot CRD ############
########### ############
##############################################
# ZFSSnapshot CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: zfssnapshots.zfs.openebs.io
spec:
group: zfs.openebs.io
names:
kind: ZFSSnapshot
listKind: ZFSSnapshotList
plural: zfssnapshots
shortNames:
- zfssnap
singular: zfssnapshot
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: ZFSSnapshot represents a ZFS Snapshot of the zfsvolume
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
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
metadata:
type: object
spec:
description: VolumeInfo defines ZFS volume parameters for all modes in
which ZFS volumes can be created like - ZFS volume with filesystem,
ZFS Volume exposed as zfs or ZFS volume exposed as raw block device.
Some of the parameters can be only set during creation time (as specified
in the details of the parameter), and a few are editable. In case of
Cloned volumes, the parameters are assigned the same values as the source
volume.
properties:
capacity:
description: Capacity of the volume
minLength: 1
type: string
compression:
description: 'Compression specifies the block-level compression algorithm
to be applied to the ZFS Volume. The value "on" indicates ZFS to
use the default compression algorithm. The default compression algorithm
used by ZFS will be either lzjb or, if the lz4_compress feature
is enabled, lz4. Compression property can be edited after the volume
has been created. The change will only be applied to the newly-written
data. For instance, if the Volume was created with "off" and the
next day the compression was modified to "on", the data written
prior to setting "on" will not be compressed. Default Value: off.'
pattern: ^(on|off|lzjb|zstd|gzip|gzip-[1-9]|zle|lz4)$
type: string
dedup:
description: 'Deduplication is the process for removing redundant
data at the block level, reducing the total amount of data stored.
If a file system has the dedup property enabled, duplicate data
blocks are removed synchronously. The result is that only unique
data is stored and common components are shared among files. Deduplication
can consume significant processing power (CPU) and memory as well
as generate additional disk IO. Before creating a pool with deduplication
enabled, ensure that you have planned your hardware requirements
appropriately and implemented appropriate recovery practices, such
as regular backups. As an alternative to deduplication consider
using compression=lz4, as a less resource-intensive alternative.
should be enabled on the zvol. Dedup property can be edited after
the volume has been created. Default Value: off.'
enum:
- "on"
- "off"
type: string
encryption:
description: 'Enabling the encryption feature allows for the creation
of encrypted filesystems and volumes. ZFS will encrypt file and
zvol data, file attributes, ACLs, permission bits, directory listings,
FUID mappings, and userused / groupused data. ZFS will not encrypt
metadata related to the pool structure, including dataset and snapshot
names, dataset hierarchy, properties, file size, file holes, and
deduplication tables (though the deduplicated data itself is encrypted).
Default Value: off.'
pattern: ^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$
type: string
fsType:
description: 'FsType specifies filesystem type for the zfs volume/dataset.
If FsType is provided as "zfs", then the driver will create a ZFS
dataset, formatting is not required as underlying filesystem is
ZFS anyway. If FsType is ext2, ext3, ext4 or xfs, then the driver
will create a ZVOL and format the volume accordingly. FsType can
not be modified once volume has been provisioned. Default Value:
ext4.'
type: string
keyformat:
description: KeyFormat specifies format of the encryption key The
supported KeyFormats are passphrase, raw, hex.
enum:
- passphrase
- raw
- hex
type: string
keylocation:
description: KeyLocation is the location of key for the encryption
type: string
ownerNodeID:
description: OwnerNodeID is the Node ID where the ZPOOL is running
which is where the volume has been provisioned. OwnerNodeID can
not be edited after the volume has been provisioned.
minLength: 1
type: string
poolName:
description: poolName specifies the name of the pool where the volume
has been created. PoolName can not be edited after the volume has
been provisioned.
minLength: 1
type: string
recordsize:
description: 'Specifies a suggested block size for files in the file
system. The size specified must be a power of two greater than or
equal to 512 and less than or equal to 128 Kbytes. RecordSize property
can be edited after the volume has been created. Changing the file
system''s recordsize affects only files created afterward; existing
files are unaffected. Default Value: 128k.'
minLength: 1
type: string
shared:
description: Shared specifies whether the volume can be shared among
multiple pods. If it is not set to "yes", then the ZFS-LocalPV Driver
will not allow the volumes to be mounted by more than one pods.
enum:
- "yes"
- "no"
type: string
snapname:
description: SnapName specifies the name of the snapshot where the
volume has been cloned from. Snapname can not be edited after the
volume has been provisioned.
type: string
thinProvision:
description: 'ThinProvision describes whether space reservation for
the source volume is required or not. The value "yes" indicates
that volume should be thin provisioned and "no" means thick provisioning
of the volume. If thinProvision is set to "yes" then volume can
be provisioned even if the ZPOOL does not have the enough capacity.
If thinProvision is set to "no" then volume can be provisioned only
if the ZPOOL has enough capacity and capacity required by volume
can be reserved. ThinProvision can not be modified once volume has
been provisioned. Default Value: no.'
enum:
- "yes"
- "no"
type: string
volblocksize:
description: 'VolBlockSize specifies the block size for the zvol.
The volsize can only be set to a multiple of volblocksize, and cannot
be zero. VolBlockSize can not be edited after the volume has been
provisioned. Default Value: 8k.'
minLength: 1
type: string
volumeType:
description: volumeType determines whether the volume is of type "DATASET"
or "ZVOL". If fstype provided in the storageclass is "zfs", a volume
of type dataset will be created. If "ext4", "ext3", "ext2" or "xfs"
is mentioned as fstype in the storageclass, then a volume of type
zvol will be created, which will be further formatted as the fstype
provided in the storageclass. VolumeType can not be modified once
volume has been provisioned.
enum:
- ZVOL
- DATASET
type: string
required:
- capacity
- ownerNodeID
- poolName
- volumeType
type: object
status:
description: SnapStatus string that reflects if the snapshot was created
successfully
properties:
state:
type: string
type: object
required:
- spec
- status
type: object
served: true
storage: true
- name: v1alpha1
schema:
openAPIV3Schema:
description: ZFSSnapshot represents a ZFS Snapshot of the zfsvolume
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
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
metadata:
type: object
spec:
description: VolumeInfo defines ZFS volume parameters for all modes in
which ZFS volumes can be created like - ZFS volume with filesystem,
ZFS Volume exposed as zfs or ZFS volume exposed as raw block device.
Some of the parameters can be only set during creation time (as specified
in the details of the parameter), and a few are editable. In case of
Cloned volumes, the parameters are assigned the same values as the source
volume.
properties:
capacity:
description: Capacity of the volume
minLength: 1
type: string
compression:
description: 'Compression specifies the block-level compression algorithm
to be applied to the ZFS Volume. The value "on" indicates ZFS to
use the default compression algorithm. The default compression algorithm
used by ZFS will be either lzjb or, if the lz4_compress feature
is enabled, lz4. Compression property can be edited after the volume
has been created. The change will only be applied to the newly-written
data. For instance, if the Volume was created with "off" and the
next day the compression was modified to "on", the data written
prior to setting "on" will not be compressed. Default Value: off.'
pattern: ^(on|off|lzjb|gzip|gzip-[1-9]|zle|lz4)$
type: string
dedup:
description: 'Deduplication is the process for removing redundant
data at the block level, reducing the total amount of data stored.
If a file system has the dedup property enabled, duplicate data
blocks are removed synchronously. The result is that only unique
data is stored and common components are shared among files. Deduplication
can consume significant processing power (CPU) and memory as well
as generate additional disk IO. Before creating a pool with deduplication
enabled, ensure that you have planned your hardware requirements
appropriately and implemented appropriate recovery practices, such
as regular backups. As an alternative to deduplication consider
using compression=lz4, as a less resource-intensive alternative.
should be enabled on the zvol. Dedup property can be edited after
the volume has been created. Default Value: off.'
enum:
- "on"
- "off"
type: string
encryption:
description: 'Enabling the encryption feature allows for the creation
of encrypted filesystems and volumes. ZFS will encrypt file and
zvol data, file attributes, ACLs, permission bits, directory listings,
FUID mappings, and userused / groupused data. ZFS will not encrypt
metadata related to the pool structure, including dataset and snapshot
names, dataset hierarchy, properties, file size, file holes, and
deduplication tables (though the deduplicated data itself is encrypted).
Default Value: off.'
pattern: ^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$
type: string
fsType:
description: 'FsType specifies filesystem type for the zfs volume/dataset.
If FsType is provided as "zfs", then the driver will create a ZFS
dataset, formatting is not required as underlying filesystem is
ZFS anyway. If FsType is ext2, ext3, ext4 or xfs, then the driver
will create a ZVOL and format the volume accordingly. FsType can
not be modified once volume has been provisioned. Default Value:
ext4.'
type: string
keyformat:
description: KeyFormat specifies format of the encryption key The
supported KeyFormats are passphrase, raw, hex.
enum:
- passphrase
- raw
- hex
type: string
keylocation:
description: KeyLocation is the location of key for the encryption
type: string
ownerNodeID:
description: OwnerNodeID is the Node ID where the ZPOOL is running
which is where the volume has been provisioned. OwnerNodeID can
not be edited after the volume has been provisioned.
minLength: 1
type: string
poolName:
description: poolName specifies the name of the pool where the volume
has been created. PoolName can not be edited after the volume has
been provisioned.
minLength: 1
type: string
recordsize:
description: 'Specifies a suggested block size for files in the file
system. The size specified must be a power of two greater than or
equal to 512 and less than or equal to 128 Kbytes. RecordSize property
can be edited after the volume has been created. Changing the file
system''s recordsize affects only files created afterward; existing
files are unaffected. Default Value: 128k.'
minLength: 1
type: string
snapname:
description: SnapName specifies the name of the snapshot where the
volume has been cloned from. Snapname can not be edited after the
volume has been provisioned.
type: string
thinProvision:
description: 'ThinProvision describes whether space reservation for
the source volume is required or not. The value "yes" indicates
that volume should be thin provisioned and "no" means thick provisioning
of the volume. If thinProvision is set to "yes" then volume can
be provisioned even if the ZPOOL does not have the enough capacity.
If thinProvision is set to "no" then volume can be provisioned only
if the ZPOOL has enough capacity and capacity required by volume
can be reserved. ThinProvision can not be modified once volume has
been provisioned. Default Value: no.'
enum:
- "yes"
- "no"
type: string
volblocksize:
description: 'VolBlockSize specifies the block size for the zvol.
The volsize can only be set to a multiple of volblocksize, and cannot
be zero. VolBlockSize can not be edited after the volume has been
provisioned. Default Value: 8k.'
minLength: 1
type: string
volumeType:
description: volumeType determines whether the volume is of type "DATASET"
or "ZVOL". If fstype provided in the storageclass is "zfs", a volume
of type dataset will be created. If "ext4", "ext3", "ext2" or "xfs"
is mentioned as fstype in the storageclass, then a volume of type
zvol will be created, which will be further formatted as the fstype
provided in the storageclass. VolumeType can not be modified once
volume has been provisioned.
enum:
- ZVOL
- DATASET
type: string
required:
- capacity
- ownerNodeID
- poolName
- volumeType
type: object
status:
description: SnapStatus string that reflects if the snapshot was created
successfully
properties:
state:
type: string
type: object
required:
- spec
- status
type: object
served: true
storage: false
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
##############################################
########### ############
########### ZFSBackup CRD ############
########### ############
##############################################
# ZFSBackups CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: zfsbackups.zfs.openebs.io
spec:
group: zfs.openebs.io
names:
kind: ZFSBackup
listKind: ZFSBackupList
plural: zfsbackups
shortNames:
- zb
singular: zfsbackup
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Previous snapshot for backup
jsonPath: .spec.prevSnapName
name: PrevSnap
type: string
- description: Backup status
jsonPath: .status
name: Status
type: string
- description: Age of the volume
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: ZFSBackup describes a zfs backup resource created as a custom
resource
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
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
metadata:
type: object
spec:
description: ZFSBackupSpec is the spec for a ZFSBackup resource
properties:
backupDest:
description: BackupDest is the remote address for backup transfer
minLength: 1
pattern: ^([0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+)$
type: string
ownerNodeID:
description: OwnerNodeID is a name of the nodes where the source volume
is
minLength: 1
type: string
prevSnapName:
description: PrevSnapName is the last completed-backup's snapshot
name
type: string
snapName:
description: SnapName is the snapshot name for backup
minLength: 1
type: string
volumeName:
description: VolumeName is a name of the volume for which this backup
is destined
minLength: 1
type: string
required:
- backupDest
- ownerNodeID
- volumeName
type: object
status:
description: ZFSBackupStatus is to hold status of backup
enum:
- Init
- Done
- Failed
- Pending
- InProgress
- Invalid
type: string
required:
- spec
- status
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
##############################################
########### ############
########### ZFSRestore CRD ############
########### ############
##############################################
# ZFSRestores CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: zfsrestores.zfs.openebs.io
spec:
group: zfs.openebs.io
names:
kind: ZFSRestore
listKind: ZFSRestoreList
plural: zfsrestores
singular: zfsrestore
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: ZFSRestore describes a cstor restore resource created as a custom
resource
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
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
metadata:
type: object
spec:
description: ZFSRestoreSpec is the spec for a ZFSRestore resource
properties:
ownerNodeID:
description: owner node name where restore volume is present
minLength: 1
type: string
restoreSrc:
description: it can be ip:port in case of restore from remote or volumeName
in case of local restore
minLength: 1
pattern: ^([0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+)$
type: string
volumeName:
description: volume name to where restore has to be performed
minLength: 1
type: string
required:
- ownerNodeID
- restoreSrc
- volumeName
type: object
status:
description: ZFSRestoreStatus is to hold result of action.
enum:
- Init
- Done
- Failed
- Pending
- InProgress
- Invalid
type: string
volSpec:
description: VolumeInfo defines ZFS volume parameters for all modes in
which ZFS volumes can be created like - ZFS volume with filesystem,
ZFS Volume exposed as zfs or ZFS volume exposed as raw block device.
Some of the parameters can be only set during creation time (as specified
in the details of the parameter), and a few are editable. In case of
Cloned volumes, the parameters are assigned the same values as the source
volume.
properties:
capacity:
description: Capacity of the volume
minLength: 1
type: string
compression:
description: 'Compression specifies the block-level compression algorithm
to be applied to the ZFS Volume. The value "on" indicates ZFS to
use the default compression algorithm. The default compression algorithm
used by ZFS will be either lzjb or, if the lz4_compress feature
is enabled, lz4. Compression property can be edited after the volume
has been created. The change will only be applied to the newly-written
data. For instance, if the Volume was created with "off" and the
next day the compression was modified to "on", the data written
prior to setting "on" will not be compressed. Default Value: off.'
pattern: ^(on|off|lzjb|zstd|gzip|gzip-[1-9]|zle|lz4)$
type: string
dedup:
description: 'Deduplication is the process for removing redundant
data at the block level, reducing the total amount of data stored.
If a file system has the dedup property enabled, duplicate data
blocks are removed synchronously. The result is that only unique
data is stored and common components are shared among files. Deduplication
can consume significant processing power (CPU) and memory as well
as generate additional disk IO. Before creating a pool with deduplication
enabled, ensure that you have planned your hardware requirements
appropriately and implemented appropriate recovery practices, such
as regular backups. As an alternative to deduplication consider
using compression=lz4, as a less resource-intensive alternative.
should be enabled on the zvol. Dedup property can be edited after
the volume has been created. Default Value: off.'
enum:
- "on"
- "off"
type: string
encryption:
description: 'Enabling the encryption feature allows for the creation
of encrypted filesystems and volumes. ZFS will encrypt file and
zvol data, file attributes, ACLs, permission bits, directory listings,
FUID mappings, and userused / groupused data. ZFS will not encrypt
metadata related to the pool structure, including dataset and snapshot
names, dataset hierarchy, properties, file size, file holes, and
deduplication tables (though the deduplicated data itself is encrypted).
Default Value: off.'
pattern: ^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$
type: string
fsType:
description: 'FsType specifies filesystem type for the zfs volume/dataset.
If FsType is provided as "zfs", then the driver will create a ZFS
dataset, formatting is not required as underlying filesystem is
ZFS anyway. If FsType is ext2, ext3, ext4 or xfs, then the driver
will create a ZVOL and format the volume accordingly. FsType can
not be modified once volume has been provisioned. Default Value:
ext4.'
type: string
keyformat:
description: KeyFormat specifies format of the encryption key The
supported KeyFormats are passphrase, raw, hex.
enum:
- passphrase
- raw
- hex
type: string
keylocation:
description: KeyLocation is the location of key for the encryption
type: string
ownerNodeID:
description: OwnerNodeID is the Node ID where the ZPOOL is running
which is where the volume has been provisioned. OwnerNodeID can
not be edited after the volume has been provisioned.
minLength: 1
type: string
poolName:
description: poolName specifies the name of the pool where the volume
has been created. PoolName can not be edited after the volume has
been provisioned.
minLength: 1
type: string
recordsize:
description: 'Specifies a suggested block size for files in the file
system. The size specified must be a power of two greater than or
equal to 512 and less than or equal to 128 Kbytes. RecordSize property
can be edited after the volume has been created. Changing the file
system''s recordsize affects only files created afterward; existing
files are unaffected. Default Value: 128k.'
minLength: 1
type: string
shared:
description: Shared specifies whether the volume can be shared among
multiple pods. If it is not set to "yes", then the ZFS-LocalPV Driver
will not allow the volumes to be mounted by more than one pods.
enum:
- "yes"
- "no"
type: string
snapname:
description: SnapName specifies the name of the snapshot where the
volume has been cloned from. Snapname can not be edited after the
volume has been provisioned.
type: string
thinProvision:
description: 'ThinProvision describes whether space reservation for
the source volume is required or not. The value "yes" indicates
that volume should be thin provisioned and "no" means thick provisioning
of the volume. If thinProvision is set to "yes" then volume can
be provisioned even if the ZPOOL does not have the enough capacity.
If thinProvision is set to "no" then volume can be provisioned only
if the ZPOOL has enough capacity and capacity required by volume
can be reserved. ThinProvision can not be modified once volume has
been provisioned. Default Value: no.'
enum:
- "yes"
- "no"
type: string
volblocksize:
description: 'VolBlockSize specifies the block size for the zvol.
The volsize can only be set to a multiple of volblocksize, and cannot
be zero. VolBlockSize can not be edited after the volume has been
provisioned. Default Value: 8k.'
minLength: 1
type: string
volumeType:
description: volumeType determines whether the volume is of type "DATASET"
or "ZVOL". If fstype provided in the storageclass is "zfs", a volume
of type dataset will be created. If "ext4", "ext3", "ext2" or "xfs"
is mentioned as fstype in the storageclass, then a volume of type
zvol will be created, which will be further formatted as the fstype
provided in the storageclass. VolumeType can not be modified once
volume has been provisioned.
enum:
- ZVOL
- DATASET
type: string
required:
- capacity
- ownerNodeID
- poolName
- volumeType
type: object
required:
- spec
- status
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
##############################################
########### ############
########### ZFSNode CRD ############
########### ############
##############################################
# ZFSNode CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: zfsnodes.zfs.openebs.io
spec:
group: zfs.openebs.io
names:
kind: ZFSNode
listKind: ZFSNodeList
plural: zfsnodes
shortNames:
- zfsnode
singular: zfsnode
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: ZFSNode records information about all zfs pools available in
a node. In general, the openebs node-agent creates the ZFSNode object &
periodically synchronizing the zfs pools available in the node. ZFSNode
has an owner reference pointing to the corresponding node object.
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
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
metadata:
type: object
pools:
items:
description: Pool specifies attributes of a given zfs pool that exists
on the node.
properties:
free:
anyOf:
- type: integer
- type: string
description: Free specifies the available capacity of zfs pool.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
name:
description: Name of the zfs pool.
minLength: 1
type: string
uuid:
description: UUID denotes a unique identity of a zfs pool.
minLength: 1
type: string
required:
- free
- name
- uuid
type: object
type: array
required:
- pools
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
# Create the CSI Driver object
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: zfs.csi.openebs.io
spec:
# do not require volumeattachment
attachRequired: false
podInfoOnMount: false
storageCapacity: true
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419"
creationTimestamp: null
name: volumesnapshotclasses.snapshot.storage.k8s.io
spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshotClass
listKind: VolumeSnapshotClassList
plural: volumesnapshotclasses
singular: volumesnapshotclass
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .driver
name: Driver
type: string
- description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
jsonPath: .deletionPolicy
name: DeletionPolicy
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
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
served: true
storage: false
subresources: {}
- additionalPrinterColumns:
- jsonPath: .driver
name: Driver
type: string
- description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
jsonPath: .deletionPolicy
name: DeletionPolicy
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
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
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419"
creationTimestamp: null
name: volumesnapshotcontents.snapshot.storage.k8s.io
spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshotContent
listKind: VolumeSnapshotContentList
plural: volumesnapshotcontents
singular: volumesnapshotcontent
scope: Cluster
versions:
- additionalPrinterColumns:
- description: Indicates if the snapshot is ready to be used to restore a volume.
jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
- description: Represents the complete size of the snapshot in bytes
jsonPath: .status.restoreSize
name: RestoreSize
type: integer
- description: Determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted.
jsonPath: .spec.deletionPolicy
name: DeletionPolicy
type: string
- description: Name of the CSI driver used to create the physical snapshot on the underlying storage system.
jsonPath: .spec.driver
name: Driver
type: string
- description: Name of the VolumeSnapshotClass to which this snapshot belongs.
jsonPath: .spec.volumeSnapshotClassName
name: VolumeSnapshotClass
type: string
- description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound.
jsonPath: .spec.volumeSnapshotRef.name
name: VolumeSnapshot
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: VolumeSnapshotContent represents the actual "on-disk" snapshot object in the underlying storage system
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
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
spec:
description: spec defines properties of a VolumeSnapshotContent created by the underlying storage system. Required.
properties:
deletionPolicy:
description: deletionPolicy determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system 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. For dynamically provisioned snapshots, this field will automatically be filled in by the CSI snapshotter sidecar with the "DeletionPolicy" field defined in the corresponding VolumeSnapshotClass. For pre-existing snapshots, users MUST specify this field when creating the VolumeSnapshotContent object. Required.
enum:
- Delete
- Retain
type: string
driver:
description: driver is the name of the CSI driver used to create the physical snapshot on the underlying storage system. This MUST be the same as the name returned by the CSI GetPluginName() call for that driver. Required.
type: string
source:
description: source specifies whether the snapshot is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. This field is immutable after creation. Required.
properties:
snapshotHandle:
description: snapshotHandle specifies the CSI "snapshot_id" of a pre-existing snapshot on the underlying storage system for which a Kubernetes object representation was (or should be) created. This field is immutable.
type: string
volumeHandle:
description: volumeHandle specifies the CSI "volume_id" of the volume from which a snapshot should be dynamically taken from. This field is immutable.
type: string
type: object
oneOf:
- required: ["snapshotHandle"]
- required: ["volumeHandle"]
volumeSnapshotClassName:
description: name of the VolumeSnapshotClass from which this snapshot was (or will be) created. Note that after provisioning, the VolumeSnapshotClass may be deleted or recreated with different set of values, and as such, should not be referenced post-snapshot creation.
type: string
volumeSnapshotRef:
description: volumeSnapshotRef specifies the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName field must reference to this VolumeSnapshotContent's name for the bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent object, name and namespace of the VolumeSnapshot object MUST be provided for binding to happen. This field is immutable after creation. Required.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
required:
- deletionPolicy
- driver
- source
- volumeSnapshotRef
type: object
status:
description: status represents the current information of a snapshot.
properties:
creationTime:
description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it indicates the creation time is unknown. The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command `date +%s%N` returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC.
format: int64
type: integer
error:
description: error is the last observed error during snapshot creation, if any. Upon success after retry, this error field will be cleared.
properties:
message:
description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.'
type: string
time:
description: time is the timestamp when the error was encountered.
format: date-time
type: string
type: object
readyToUse:
description: readyToUse indicates if a snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown.
type: boolean
restoreSize:
description: restoreSize represents the complete size of the snapshot in bytes. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown.
format: int64
minimum: 0
type: integer
snapshotHandle:
description: snapshotHandle is the CSI "snapshot_id" of a snapshot on the underlying storage system. If not specified, it indicates that dynamic snapshot creation has either failed or it is still in progress.
type: string
type: object
required:
- spec
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- description: Indicates if the snapshot is ready to be used to restore a volume.
jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
- description: Represents the complete size of the snapshot in bytes
jsonPath: .status.restoreSize
name: RestoreSize
type: integer
- description: Determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted.
jsonPath: .spec.deletionPolicy
name: DeletionPolicy
type: string
- description: Name of the CSI driver used to create the physical snapshot on the underlying storage system.
jsonPath: .spec.driver
name: Driver
type: string
- description: Name of the VolumeSnapshotClass to which this snapshot belongs.
jsonPath: .spec.volumeSnapshotClassName
name: VolumeSnapshotClass
type: string
- description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound.
jsonPath: .spec.volumeSnapshotRef.name
name: VolumeSnapshot
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: VolumeSnapshotContent represents the actual "on-disk" snapshot object in the underlying storage system
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
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
spec:
description: spec defines properties of a VolumeSnapshotContent created by the underlying storage system. Required.
properties:
deletionPolicy:
description: deletionPolicy determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system 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. For dynamically provisioned snapshots, this field will automatically be filled in by the CSI snapshotter sidecar with the "DeletionPolicy" field defined in the corresponding VolumeSnapshotClass. For pre-existing snapshots, users MUST specify this field when creating the VolumeSnapshotContent object. Required.
enum:
- Delete
- Retain
type: string
driver:
description: driver is the name of the CSI driver used to create the physical snapshot on the underlying storage system. This MUST be the same as the name returned by the CSI GetPluginName() call for that driver. Required.
type: string
source:
description: source specifies whether the snapshot is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. This field is immutable after creation. Required.
properties:
snapshotHandle:
description: snapshotHandle specifies the CSI "snapshot_id" of a pre-existing snapshot on the underlying storage system for which a Kubernetes object representation was (or should be) created. This field is immutable.
type: string
volumeHandle:
description: volumeHandle specifies the CSI "volume_id" of the volume from which a snapshot should be dynamically taken from. This field is immutable.
type: string
type: object
volumeSnapshotClassName:
description: name of the VolumeSnapshotClass from which this snapshot was (or will be) created. Note that after provisioning, the VolumeSnapshotClass may be deleted or recreated with different set of values, and as such, should not be referenced post-snapshot creation.
type: string
volumeSnapshotRef:
description: volumeSnapshotRef specifies the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName field must reference to this VolumeSnapshotContent's name for the bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent object, name and namespace of the VolumeSnapshot object MUST be provided for binding to happen. This field is immutable after creation. Required.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
required:
- deletionPolicy
- driver
- source
- volumeSnapshotRef
type: object
status:
description: status represents the current information of a snapshot.
properties:
creationTime:
description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it indicates the creation time is unknown. The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command `date +%s%N` returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC.
format: int64
type: integer
error:
description: error is the last observed error during snapshot creation, if any. Upon success after retry, this error field will be cleared.
properties:
message:
description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.'
type: string
time:
description: time is the timestamp when the error was encountered.
format: date-time
type: string
type: object
readyToUse:
description: readyToUse indicates if a snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown.
type: boolean
restoreSize:
description: restoreSize represents the complete size of the snapshot in bytes. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown.
format: int64
minimum: 0
type: integer
snapshotHandle:
description: snapshotHandle is the CSI "snapshot_id" of a snapshot on the underlying storage system. If not specified, it indicates that dynamic snapshot creation has either failed or it is still in progress.
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419"
creationTimestamp: null
name: volumesnapshots.snapshot.storage.k8s.io
spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshot
listKind: VolumeSnapshotList
plural: volumesnapshots
singular: volumesnapshot
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Indicates if the snapshot is ready to be used to restore a volume.
jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
- description: If a new snapshot needs to be created, this contains the name of the source PVC from which this snapshot was (or will be) created.
jsonPath: .spec.source.persistentVolumeClaimName
name: SourcePVC
type: string
- description: If a snapshot already exists, this contains the name of the existing VolumeSnapshotContent object representing the existing snapshot.
jsonPath: .spec.source.volumeSnapshotContentName
name: SourceSnapshotContent
type: string
- description: Represents the minimum size of volume required to rehydrate from this snapshot.
jsonPath: .status.restoreSize
name: RestoreSize
type: string
- description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot.
jsonPath: .spec.volumeSnapshotClassName
name: SnapshotClass
type: string
- description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot object intends to bind to. Please note that verification of binding actually requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure both are pointing at each other. Binding MUST be verified prior to usage of this object.
jsonPath: .status.boundVolumeSnapshotContentName
name: SnapshotContent
type: string
- description: Timestamp when the point-in-time snapshot was taken by the underlying storage system.
jsonPath: .status.creationTime
name: CreationTime
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot.
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
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
spec:
description: 'spec defines the desired characteristics of a snapshot requested by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots Required.'
properties:
source:
description: source specifies where a snapshot will be created from. This field is immutable after creation. Required.
properties:
persistentVolumeClaimName:
description: persistentVolumeClaimName specifies the name of the PersistentVolumeClaim object representing the volume from which a snapshot should be created. This PVC is assumed to be in the same namespace as the VolumeSnapshot object. This field should be set if the snapshot does not exists, and needs to be created. This field is immutable.
type: string
volumeSnapshotContentName:
description: volumeSnapshotContentName specifies the name of a pre-existing VolumeSnapshotContent object representing an existing volume snapshot. This field should be set if the snapshot already exists and only needs a representation in Kubernetes. This field is immutable.
type: string
type: object
oneOf:
- required: ["persistentVolumeClaimName"]
- required: ["volumeSnapshotContentName"]
volumeSnapshotClassName:
description: 'VolumeSnapshotClassName is the name of the VolumeSnapshotClass requested by the VolumeSnapshot. VolumeSnapshotClassName may be left nil to indicate that the default SnapshotClass should be used. A given cluster may have multiple default Volume SnapshotClasses: one default per CSI Driver. If a VolumeSnapshot does not specify a SnapshotClass, VolumeSnapshotSource will be checked to figure out what the associated CSI Driver is, and the default VolumeSnapshotClass associated with that CSI Driver will be used. If more than one VolumeSnapshotClass exist for a given CSI Driver and more than one have been marked as default, CreateSnapshot will fail and generate an event. Empty string is not allowed for this field.'
type: string
required:
- source
type: object
status:
description: status represents the current information of a snapshot. Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object.
properties:
boundVolumeSnapshotContentName:
description: 'boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent object to which this VolumeSnapshot object intends to bind to. If not specified, it indicates that the VolumeSnapshot object has not been successfully bound to a VolumeSnapshotContent object yet. NOTE: To avoid possible security issues, consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object.'
type: string
creationTime:
description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it may indicate that the creation time of the snapshot is unknown.
format: date-time
type: string
error:
description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurs during the snapshot creation. Upon success, this error field will be cleared.
properties:
message:
description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.'
type: string
time:
description: time is the timestamp when the error was encountered.
format: date-time
type: string
type: object
readyToUse:
description: readyToUse indicates if the snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown.
type: boolean
restoreSize:
type: string
description: restoreSize represents the minimum size of volume required to create a volume from this snapshot. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
required:
- spec
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- description: Indicates if the snapshot is ready to be used to restore a volume.
jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
- description: If a new snapshot needs to be created, this contains the name of the source PVC from which this snapshot was (or will be) created.
jsonPath: .spec.source.persistentVolumeClaimName
name: SourcePVC
type: string
- description: If a snapshot already exists, this contains the name of the existing VolumeSnapshotContent object representing the existing snapshot.
jsonPath: .spec.source.volumeSnapshotContentName
name: SourceSnapshotContent
type: string
- description: Represents the minimum size of volume required to rehydrate from this snapshot.
jsonPath: .status.restoreSize
name: RestoreSize
type: string
- description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot.
jsonPath: .spec.volumeSnapshotClassName
name: SnapshotClass
type: string
- description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot object intends to bind to. Please note that verification of binding actually requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure both are pointing at each other. Binding MUST be verified prior to usage of this object.
jsonPath: .status.boundVolumeSnapshotContentName
name: SnapshotContent
type: string
- description: Timestamp when the point-in-time snapshot was taken by the underlying storage system.
jsonPath: .status.creationTime
name: CreationTime
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot.
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
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
spec:
description: 'spec defines the desired characteristics of a snapshot requested by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots Required.'
properties:
source:
description: source specifies where a snapshot will be created from. This field is immutable after creation. Required.
properties:
persistentVolumeClaimName:
description: persistentVolumeClaimName specifies the name of the PersistentVolumeClaim object representing the volume from which a snapshot should be created. This PVC is assumed to be in the same namespace as the VolumeSnapshot object. This field should be set if the snapshot does not exists, and needs to be created. This field is immutable.
type: string
volumeSnapshotContentName:
description: volumeSnapshotContentName specifies the name of a pre-existing VolumeSnapshotContent object representing an existing volume snapshot. This field should be set if the snapshot already exists and only needs a representation in Kubernetes. This field is immutable.
type: string
type: object
volumeSnapshotClassName:
description: 'VolumeSnapshotClassName is the name of the VolumeSnapshotClass requested by the VolumeSnapshot. VolumeSnapshotClassName may be left nil to indicate that the default SnapshotClass should be used. A given cluster may have multiple default Volume SnapshotClasses: one default per CSI Driver. If a VolumeSnapshot does not specify a SnapshotClass, VolumeSnapshotSource will be checked to figure out what the associated CSI Driver is, and the default VolumeSnapshotClass associated with that CSI Driver will be used. If more than one VolumeSnapshotClass exist for a given CSI Driver and more than one have been marked as default, CreateSnapshot will fail and generate an event. Empty string is not allowed for this field.'
type: string
required:
- source
type: object
status:
description: status represents the current information of a snapshot. Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object.
properties:
boundVolumeSnapshotContentName:
description: 'boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent object to which this VolumeSnapshot object intends to bind to. If not specified, it indicates that the VolumeSnapshot object has not been successfully bound to a VolumeSnapshotContent object yet. NOTE: To avoid possible security issues, consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object.'
type: string
creationTime:
description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it may indicate that the creation time of the snapshot is unknown.
format: date-time
type: string
error:
description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurs during the snapshot creation. Upon success, this error field will be cleared.
properties:
message:
description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.'
type: string
time:
description: time is the timestamp when the error was encountered.
format: date-time
type: string
type: object
readyToUse:
description: readyToUse indicates if the snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown.
type: boolean
restoreSize:
type: string
description: restoreSize represents the minimum size of volume required to create a volume from this snapshot. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
##############################################
########### ############
########### Controller plugin ############
########### ############
##############################################
kind: ServiceAccount
apiVersion: v1
metadata:
name: openebs-zfs-controller-sa
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openebs-zfs-provisioner-role
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["*"]
- apiGroups: [""]
resources: ["persistentvolumes", "services"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["persistentvolumeclaims/status"]
verbs: ["update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses", "csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [ "storage.k8s.io" ]
resources: [ "csistoragecapacities"]
verbs: ["*"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["*"]
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores", "zfsnodes"]
verbs: ["*"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openebs-zfs-provisioner-binding
subjects:
- kind: ServiceAccount
name: openebs-zfs-controller-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: openebs-zfs-provisioner-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: openebs-zfs-csi-controller-critical
# A PriorityClass object can have any 32-bit integer value smaller than or equal
# to 1 billion. Larger numbers are reserved for critical system Pods that should
# not normally be preempted or evicted. The higher the value, the higher the priority.
value: 900000000
globalDefault: false
description: "This priority class should be used for the OpenEBS ZFS localPV CSI driver controller deployment only."
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: openebs-zfs-controller
namespace: kube-system
labels:
openebs.io/component-name: openebs-zfs-controller
openebs.io/version: 2.1.0
spec:
selector:
matchLabels:
app: openebs-zfs-controller
role: openebs-zfs
serviceName: "openebs-zfs"
replicas: 1
template:
metadata:
labels:
app: openebs-zfs-controller
role: openebs-zfs
openebs.io/component-name: openebs-zfs-controller
openebs.io/version: 2.1.0
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- openebs-zfs-controller
topologyKey: "kubernetes.io/hostname"
priorityClassName: openebs-zfs-csi-controller-critical
serviceAccount: openebs-zfs-controller-sa
containers:
- name: csi-resizer
image: k8s.gcr.io/sig-storage/csi-resizer:v1.2.0
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
imagePullPolicy: IfNotPresent
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.0
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: snapshot-controller
image: k8s.gcr.io/sig-storage/snapshot-controller:v4.0.0
args:
- "--v=5"
- "--leader-election=true"
imagePullPolicy: IfNotPresent
- name: csi-provisioner
image: k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
- "--feature-gates=Topology=true"
- "--strict-topology"
- "--leader-election"
- "--extra-create-metadata=true"
- "--enable-capacity=true"
- "--default-fstype=ext4"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: openebs-zfs-plugin
image: openebs/zfs-driver:2.1.0
imagePullPolicy: IfNotPresent
env:
- name: OPENEBS_CONTROLLER_DRIVER
value: controller
- name: OPENEBS_CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: OPENEBS_NAMESPACE
value: openebs
- name: OPENEBS_IO_INSTALLER_TYPE
value: "zfs-operator"
- name: OPENEBS_IO_ENABLE_ANALYTICS
value: "true"
args :
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
- "--plugin=$(OPENEBS_CONTROLLER_DRIVER)"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
volumes:
- name: socket-dir
emptyDir: {}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openebs-zfs-snapshotter-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- 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: ["volumesnapshotcontents/status"]
verbs: ["update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status"]
verbs: ["update"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create", "list", "watch", "delete"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openebs-zfs-snapshotter-binding
subjects:
- kind: ServiceAccount
name: openebs-zfs-controller-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: openebs-zfs-snapshotter-role
apiGroup: rbac.authorization.k8s.io
---
########################################
########### ############
########### Node plugin ############
########### ############
########################################
apiVersion: v1
kind: ServiceAccount
metadata:
name: openebs-zfs-node-sa
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openebs-zfs-driver-registrar-role
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["persistentvolumes", "nodes", "services"]
verbs: ["get", "list"]
- apiGroups: ["*"]
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores", "zfsnodes"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openebs-zfs-driver-registrar-binding
subjects:
- kind: ServiceAccount
name: openebs-zfs-node-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: openebs-zfs-driver-registrar-role
apiGroup: rbac.authorization.k8s.io
---
kind: ConfigMap
apiVersion: v1
metadata:
name: openebs-zfspv-bin
namespace: kube-system # should be the same namespace where it is getting mounted
data:
zfs: |
#!/bin/sh
if [ -x /host/sbin/zfs ]; then
chroot /host /sbin/zfs "$@"
elif [ -x /host/usr/sbin/zfs ]; then
chroot /host /usr/sbin/zfs "$@"
else
chroot /host zfs "$@"
fi
---
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: openebs-zfs-csi-node-critical
# A PriorityClass object can have any 32-bit integer value smaller than or equal
# to 1 billion. Larger numbers are reserved for critical system Pods that should
# not normally be preempted or evicted. The higher the value, the higher the priority.
value: 900001000
globalDefault: false
description: "This priority class should be used for the OpenEBS ZFS localPV CSI driver node deployment only."
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: openebs-zfs-node
namespace: kube-system
labels:
openebs.io/component-name: openebs-zfs-node
openebs.io/version: 2.1.0
spec:
selector:
matchLabels:
app: openebs-zfs-node
updateStrategy:
rollingUpdate:
maxUnavailable: 100%
type: RollingUpdate
template:
metadata:
labels:
app: openebs-zfs-node
role: openebs-zfs
openebs.io/component-name: openebs-zfs-node
openebs.io/version: 2.1.0
spec:
{% if kubernetes_openebs_zfs_node_selector is defined %}
nodeSelector:
{{ kubernetes_openebs_zfs_node_selector | to_nice_yaml(indent=2) | indent(width=8) -}}
{% endif %}
{% if kubernetes_openebs_zfs_node_affinity is defined %}
affinity:
nodeAffinity:
{{ kubernetes_openebs_zfs_node_affinity | to_nice_yaml(indent=2) | indent(width=10) -}}
{% endif %}
priorityClassName: openebs-zfs-csi-node-critical
serviceAccount: openebs-zfs-node-sa
hostNetwork: true
containers:
- name: csi-node-driver-registrar
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
imagePullPolicy: IfNotPresent
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/zfs-localpv /registration/zfs-localpv-reg.sock"]
env:
- name: ADDRESS
value: /plugin/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/zfs-localpv/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NODE_DRIVER
value: openebs-zfs
volumeMounts:
- name: plugin-dir
mountPath: /plugin
- name: registration-dir
mountPath: /registration
- name: openebs-zfs-plugin
securityContext:
privileged: true
allowPrivilegeEscalation: true
image: openebs/zfs-driver:2.1.0
imagePullPolicy: IfNotPresent
args:
- "--nodename=$(OPENEBS_NODE_NAME)"
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
- "--plugin=$(OPENEBS_NODE_DRIVER)"
env:
- name: OPENEBS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: OPENEBS_CSI_ENDPOINT
value: unix:///plugin/csi.sock
- name: OPENEBS_NODE_DRIVER
value: agent
- name: OPENEBS_NAMESPACE
value: openebs
- name: ALLOWED_TOPOLOGIES
# The desired comma separated keys can be added here,
# by default all the node label keys are allowed.
# For example:
# value: "kubernetes.io/hostname,openebs.io/rack"
value: "All"
volumeMounts:
- name: plugin-dir
mountPath: /plugin
- name: device-dir
mountPath: /dev
- name: encr-keys
mountPath: /home/keys
- name: chroot-zfs
mountPath: /sbin/zfs
subPath: zfs
- name: host-root
mountPath: /host
mountPropagation: "HostToContainer"
readOnly: true
- name: pods-mount-dir
mountPath: /var/lib/kubelet/
# needed so that any mounts setup inside this container are
# propagated back to the host machine.
mountPropagation: "Bidirectional"
volumes:
- name: device-dir
hostPath:
path: /dev
type: Directory
- name: encr-keys
hostPath:
path: /home/keys
type: DirectoryOrCreate
- name: chroot-zfs
configMap:
defaultMode: 0555
name: openebs-zfspv-bin
- name: host-root
hostPath:
path: /
type: Directory
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
type: DirectoryOrCreate
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/zfs-localpv/
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet/
type: Directory
---
|