kcr_couchbase_com 3.20260601.153757

Kubernetes Custom Resource Bindings
Documentation
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
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/couchbase-partners/helm-charts/couchbase.com/v2/couchbaseclusters.yaml
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}

use self::prelude::*;

/// ClusterSpec is the specification for a CouchbaseCluster resources, and allows
/// the cluster to be customized.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "couchbase.com", version = "v2", kind = "CouchbaseCluster", plural = "couchbaseclusters")]
#[kube(namespaced)]
#[kube(status = "CouchbaseClusterStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct CouchbaseClusterSpec {
    /// AntiAffinity forces the Operator to schedule different Couchbase server pods on
    /// different Kubernetes nodes.  Anti-affinity reduces the likelihood of unrecoverable
    /// failure in the event of a node issue.  Use of anti-affinity is highly recommended for
    /// production clusters.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "antiAffinity")]
    pub anti_affinity: Option<bool>,
    /// AutoResourceAllocation populates pod resource requests based on the services running
    /// on that pod.  When enabled, this feature will calculate the memory request as the
    /// total of service allocations defined in `spec.cluster`, plus an overhead defined
    /// by `spec.autoResourceAllocation.overheadPercent`.Changing individual allocations for
    /// a service will cause a cluster upgrade as allocations are modified in the underlying
    /// pods.  This field also allows default pod CPU requests and limits to be applied.
    /// All resource allocations can be overridden by explicitly configuring them in the
    /// `spec.servers.resources` field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoResourceAllocation")]
    pub auto_resource_allocation: Option<CouchbaseClusterAutoResourceAllocation>,
    /// AutoscaleStabilizationPeriod defines how long after a rebalance the
    /// corresponding HorizontalPodAutoscaler should remain in maintenance mode.
    /// During maintenance mode all autoscaling is disabled since every HorizontalPodAutoscaler
    /// associated with the cluster becomes inactive.
    /// Since certain metrics can be unpredictable when Couchbase is rebalancing or upgrading,
    /// setting a stabilization period helps to prevent scaling recommendations from the
    /// HorizontalPodAutoscaler for a provided period of time.
    /// 
    /// 
    /// Values must be a valid Kubernetes duration of 0s or higher:
    /// <https://golang.org/pkg/time/#ParseDuration>
    /// A value of 0, puts the cluster in maintenance mode during rebalance but
    /// immediately exits this mode once the rebalance has completed.
    /// When undefined, the HPA is never put into maintenance mode during rebalance.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoscaleStabilizationPeriod")]
    pub autoscale_stabilization_period: Option<String>,
    /// Backup defines whether the Operator should manage automated backups, and how
    /// to lookup backup resources.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub backup: Option<CouchbaseClusterBackup>,
    /// Buckets defines whether the Operator should manage buckets, and how to lookup
    /// bucket resources.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub buckets: Option<CouchbaseClusterBuckets>,
    /// ClusterSettings define Couchbase cluster-wide settings such as memory allocation,
    /// failover characteristics and index settings.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cluster: Option<CouchbaseClusterCluster>,
    /// EnableOnlineVolumeExpansion enables online expansion of Persistent Volumes.
    /// You can only expand a PVC if its storage class's "allowVolumeExpansion" field is set to true.
    /// Additionally, Kubernetes feature "ExpandInUsePersistentVolumes" must be enabled in order to
    /// expand the volumes which are actively bound to Pods.
    /// Volumes can only be expanded and not reduced to a smaller size.
    /// See: <https://kubernetes.io/docs/concepts/storage/persistent-volumes/#resizing-an-in-use-persistentvolumeclaim>
    /// 
    /// 
    /// If "EnableOnlineVolumeExpansion" is enabled for use within an environment that does
    /// not actually support online volume and file system expansion then the cluster will fallback to
    /// rolling upgrade procedure to create a new set of Pods for use with resized Volumes.
    /// More info:  <https://kubernetes.io/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enableOnlineVolumeExpansion")]
    pub enable_online_volume_expansion: Option<bool>,
    /// DEPRECATED - This option only exists for backwards compatibility and no longer
    /// restricts autoscaling to ephemeral services.
    /// EnablePreviewScaling enables autoscaling for stateful services and buckets.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enablePreviewScaling")]
    pub enable_preview_scaling: Option<bool>,
    /// EnvImagePrecedence gives precedence over the default container image name in
    /// `spec.Image` to an image name provided through Operator environment variables.
    /// For more info on using Operator environment variables:
    /// <https://docs.couchbase.com/operator/current/reference-operator-configuration.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "envImagePrecedence")]
    pub env_image_precedence: Option<bool>,
    /// Hibernate is whether to hibernate the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hibernate: Option<bool>,
    /// HibernationStrategy defines how to hibernate the cluster.  When Immediate
    /// the Operator will immediately delete all pods and take no further action until
    /// the hibernate field is set to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hibernationStrategy")]
    pub hibernation_strategy: Option<CouchbaseClusterHibernationStrategy>,
    /// Image is the container image name that will be used to launch Couchbase
    /// server instances.  Updating this field will cause an automatic upgrade of
    /// the cluster. Explicitly specifying the image for a server class will override
    /// this value for the server class.
    pub image: String,
    /// Logging defines Operator logging options.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub logging: Option<CouchbaseClusterLogging>,
    /// Migration defines the specification for a CouchbaseCluster assimilation of an unmanaged
    /// cluster to a managed Kubernetes cluster
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub migration: Option<CouchbaseClusterMigration>,
    /// DEPRECATED - By Couchbase Server metrics endpoint on version 7.0+
    /// Monitoring defines any Operator managed integration into 3rd party monitoring
    /// infrastructure.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub monitoring: Option<CouchbaseClusterMonitoring>,
    /// Networking defines Couchbase cluster networking options such as network
    /// topology, TLS and DDNS settings.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub networking: Option<CouchbaseClusterNetworking>,
    /// OnlineVolumeExpansionTimeoutInMins must be provided as a retry mechanism with a timeout in minutes
    /// for expanding volumes. This must only be provided, if EnableOnlineVolumeExpansion is set to true.
    /// Value must be between 0 and 30.
    /// If no value is provided, then it defaults to 10 minutes.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onlineVolumeExpansionTimeoutInMins")]
    pub online_volume_expansion_timeout_in_mins: Option<i64>,
    /// Paused is to pause the control of the operator for the Couchbase cluster.
    /// This does not pause the cluster itself, instead stopping the operator from
    /// taking any action.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub paused: Option<bool>,
    /// PerServiceClassPDB determines whether a pod disruption budget (PDB) should be created for each service class.
    /// By default, a single PDB will be created for the cluster with a minAvailable value of one less than the total number of requested Couchbase nodes in the cluster,
    /// meaning only a single Couchbase node can be voluntarily disrupted at a time. When this field is set to true, a PDB will be created for each
    /// service class, with a minAvailable value of one less than the service class size. This allows for a more granular
    /// control over the number of Couchbase nodes that can be voluntarily disrupted at a time, such as during a Kubernetes upgrade.
    /// In order to enable this feature, the size of each service class must be at least 2 and the maximum number of Couchbase nodes
    /// that the PDB's would allow to be disrupted at once cannot exceed 50% of the total number of Couchbase nodes requested in the cluster specification.
    /// Furthermore, the requested number of replicas for both the index and data services must remain less than the minimum number
    /// of Couchbase nodes that the server class PDB's will cumulatively allow for.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "perServiceClassPDB")]
    pub per_service_class_pdb: Option<bool>,
    /// Platform gives a hint as to what platform we are running on and how
    /// to configure services.  This field must be one of "aws", "gke" or "azure".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub platform: Option<CouchbaseClusterPlatform>,
    /// RecoveryPolicy controls how aggressive the Operator is when recovering cluster
    /// topology.  When PrioritizeDataIntegrity, the Operator will delegate failover
    /// exclusively to Couchbase server, relying on it to only allow recovery when safe to
    /// do so.  When PrioritizeUptime, the Operator will wait for a period after the
    /// expected auto-failover of the cluster, before forcefully failing-over the pods.
    /// This may cause data loss, and is only expected to be used on clusters with ephemeral
    /// data, where the loss of the pod means that the data is known to be unrecoverable.
    /// This field must be either "PrioritizeDataIntegrity" or "PrioritizeUptime", defaulting
    /// to "PrioritizeDataIntegrity".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "recoveryPolicy")]
    pub recovery_policy: Option<CouchbaseClusterRecoveryPolicy>,
    /// When `spec.upgradeStrategy` is set to `RollingUpgrade` it will, by default, upgrade one pod
    /// at a time.  If this field is specified then that number can be increased.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "rollingUpgrade")]
    pub rolling_upgrade: Option<CouchbaseClusterRollingUpgrade>,
    /// Security defines Couchbase cluster security options such as the administrator
    /// account username and password, and user RBAC settings.
    pub security: CouchbaseClusterSecurity,
    /// DEPRECATED - by spec.security.securityContext
    /// SecurityContext allows the configuration of the security context for all
    /// Couchbase server pods.  When using persistent volumes you may need to set
    /// the fsGroup field in order to write to the volume.  For non-root clusters
    /// you must also set runAsUser to 1000, corresponding to the Couchbase user
    /// in official container images.  More info:
    /// <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityContext")]
    pub security_context: Option<CouchbaseClusterSecurityContext>,
    /// ServerGroups define the set of availability zones you want to distribute
    /// pods over, and construct Couchbase server groups for.  By default, most
    /// cloud providers will label nodes with the key "topology.kubernetes.io/zone",
    /// the values associated with that key are used here to provide explicit
    /// scheduling by the Operator.  You may manually label nodes using the
    /// "topology.kubernetes.io/zone" key, to provide failure-domain
    /// aware scheduling when none is provided for you.  Global server groups are
    /// applied to all server classes, and may be overridden on a per-server class
    /// basis to give more control over scheduling and server groups.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverGroups")]
    pub server_groups: Option<Vec<String>>,
    /// Servers defines server classes for the Operator to provision and manage.
    /// A server class defines what services are running and how many members make
    /// up that class.  Specifying multiple server classes allows the Operator to
    /// provision clusters with Multi-Dimensional Scaling (MDS).  At least one server
    /// class must be defined, and at least one server class must be running the data
    /// service.
    pub servers: Vec<CouchbaseClusterServers>,
    /// SoftwareUpdateNotifications enables software update notifications in the UI.
    /// When enabled, the UI will alert when a Couchbase server upgrade is available.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "softwareUpdateNotifications")]
    pub software_update_notifications: Option<bool>,
    /// UpgradeProcess defines the process that will be used when performing a couchbase cluster upgrade.
    /// When SwapRebalance is requested (default), pods will be upgraded using either a RollingUpgrade or
    /// ImmediateUpgrade (determined by UpgradeStrategy). When InPlaceUpgrade is requested, the operator will
    /// perform an in-place upgrade on a best effort basis. InPlaceUpgrade cannot be used if the UpgradeStrategy
    /// is set to ImmediateUpgrade.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "upgradeProcess")]
    pub upgrade_process: Option<CouchbaseClusterUpgradeProcess>,
    /// UpgradeStrategy controls how aggressive the Operator is when performing a cluster
    /// upgrade.  When a rolling upgrade is requested, pods are upgraded one at a time.  This
    /// strategy is slower, however less disruptive.  When an immediate upgrade strategy is
    /// requested, all pods are upgraded at the same time.  This strategy is faster, but more
    /// disruptive.  This field must be either "RollingUpgrade" or "ImmediateUpgrade", defaulting
    /// to "RollingUpgrade".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "upgradeStrategy")]
    pub upgrade_strategy: Option<CouchbaseClusterUpgradeStrategy>,
    /// VolumeClaimTemplates define the desired characteristics of a volume
    /// that can be requested/claimed by a pod, for example the storage class to
    /// use and the volume size.  Volume claim templates are referred to by name
    /// by server class volume mount configuration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeClaimTemplates")]
    pub volume_claim_templates: Option<Vec<CouchbaseClusterVolumeClaimTemplates>>,
    /// XDCR defines whether the Operator should manage XDCR, remote clusters and how
    /// to lookup replication resources.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub xdcr: Option<CouchbaseClusterXdcr>,
}

/// AutoResourceAllocation populates pod resource requests based on the services running
/// on that pod.  When enabled, this feature will calculate the memory request as the
/// total of service allocations defined in `spec.cluster`, plus an overhead defined
/// by `spec.autoResourceAllocation.overheadPercent`.Changing individual allocations for
/// a service will cause a cluster upgrade as allocations are modified in the underlying
/// pods.  This field also allows default pod CPU requests and limits to be applied.
/// All resource allocations can be overridden by explicitly configuring them in the
/// `spec.servers.resources` field.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterAutoResourceAllocation {
    /// CPULimits automatically populates the CPU limits across all Couchbase
    /// server pods.  This field defaults to "4" CPUs.  Explicitly specifying the CPU
    /// limit for a particular server class will override this value.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cpuLimits")]
    pub cpu_limits: Option<String>,
    /// CPURequests automatically populates the CPU requests across all Couchbase
    /// server pods.  The default value of "2", is the minimum recommended number of
    /// CPUs required to run Couchbase Server.  Explicitly specifying the CPU request
    /// for a particular server class will override this value. More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cpuRequests")]
    pub cpu_requests: Option<String>,
    /// Enabled defines whether auto-resource allocation is enabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// OverheadPercent defines the amount of memory above that required for individual
    /// services on a pod.  For Couchbase Server this should be approximately 25%.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "overheadPercent")]
    pub overhead_percent: Option<i64>,
}

/// Backup defines whether the Operator should manage automated backups, and how
/// to lookup backup resources.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackup {
    /// Annotations defines additional annotations to appear on the backup/restore pods.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// The Backup Image to run on backup pods.
    pub image: String,
    /// ImagePullSecrets allow you to use an image from private
    /// repositories and non-dockerhub ones.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullSecrets")]
    pub image_pull_secrets: Option<Vec<CouchbaseClusterBackupImagePullSecrets>>,
    /// Labels defines additional labels to appear on the backup/restore pods.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
    /// Managed defines whether backups are managed by us or the clients.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// NodeSelector defines which nodes to constrain the pods that
    /// run any backup and restore operations to.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeSelector")]
    pub node_selector: Option<BTreeMap<String, String>>,
    /// Deprecated: by CouchbaseBackup.spec.objectStore.Endpoint
    /// ObjectEndpoint contains the configuration for connecting to a custom S3 compliant object store.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "objectEndpoint")]
    pub object_endpoint: Option<CouchbaseClusterBackupObjectEndpoint>,
    /// Resources is the resource requirements for the backup and restore
    /// containers.  Will be populated by defaults if not specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<CouchbaseClusterBackupResources>,
    /// Deprecated: by CouchbaseBackup.spec.objectStore.secret
    /// S3Secret contains the key region and optionally access-key-id and secret-access-key for operating backups in S3.
    /// This field must be popluated when the `spec.s3bucket` field is specified
    /// for a backup or restore resource.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "s3Secret")]
    pub s3_secret: Option<String>,
    /// Selector allows CouchbaseBackup and CouchbaseBackupRestore
    /// resources to be filtered based on labels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<CouchbaseClusterBackupSelector>,
    /// The Service Account to run backup (and restore) pods under.
    /// Without this backup pods will not be able to update status.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountName")]
    pub service_account_name: Option<String>,
    /// Tolerations specifies all backup and restore pod tolerations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tolerations: Option<Vec<CouchbaseClusterBackupTolerations>>,
    /// Deprecated: by CouchbaseBackup.spec.objectStore.useIAM
    /// UseIAMRole enables backup to fetch EC2 instance metadata.
    /// This allows the AWS SDK to use the EC2's IAM Role for S3 access.
    /// UseIAMRole will ignore credentials in s3Secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "useIAMRole")]
    pub use_iam_role: Option<bool>,
}

/// LocalObjectReference contains enough information to let you locate the
/// referenced object inside the same namespace.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupImagePullSecrets {
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// Deprecated: by CouchbaseBackup.spec.objectStore.Endpoint
/// ObjectEndpoint contains the configuration for connecting to a custom S3 compliant object store.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupObjectEndpoint {
    /// The name of the secret, in this namespace, that contains the CA certificate for verification of a TLS endpoint
    /// The secret must have the key with the name "tls.crt"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secret: Option<String>,
    /// The host/address of the custom object endpoint.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// UseVirtualPath will force the AWS SDK to use the new virtual style paths
    /// which are often required by S3 compatible object stores.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "useVirtualPath")]
    pub use_virtual_path: Option<bool>,
}

/// Resources is the resource requirements for the backup and restore
/// containers.  Will be populated by defaults if not specified.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims,
    /// that are used by this container.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<CouchbaseClusterBackupResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required.
    /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of
    /// the Pod where this field is used. It makes that resource available
    /// inside a container.
    pub name: String,
}

/// Selector allows CouchbaseBackup and CouchbaseBackupRestore
/// resources to be filtered based on labels.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterBackupSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// The pod this Toleration is attached to tolerates any taint that matches
/// the triple <key,value,effect> using the matching operator <operator>.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBackupTolerations {
    /// Effect indicates the taint effect to match. Empty means match all taint effects.
    /// When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub effect: Option<String>,
    /// Key is the taint key that the toleration applies to. Empty means match all taint keys.
    /// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// Operator represents a key's relationship to the value.
    /// Valid operators are Exists and Equal. Defaults to Equal.
    /// Exists is equivalent to wildcard for value, so that a pod can
    /// tolerate all taints of a particular category.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub operator: Option<String>,
    /// TolerationSeconds represents the period of time the toleration (which must be
    /// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
    /// it is not set, which means tolerate the taint forever (do not evict). Zero and
    /// negative values will be treated as 0 (evict immediately) by the system.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tolerationSeconds")]
    pub toleration_seconds: Option<i64>,
    /// Value is the taint value the toleration matches to.
    /// If the operator is Exists, the value should be empty, otherwise just a regular string.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// Buckets defines whether the Operator should manage buckets, and how to lookup
/// bucket resources.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBuckets {
    /// Managed defines whether buckets are managed by the Operator (true), or user managed (false).
    /// When Operator managed, all buckets must be defined with either CouchbaseBucket or
    /// CouchbaseEphemeralBucket resources.  Manual addition
    /// of buckets will be reverted by the Operator.  When user managed, the Operator
    /// will not interrogate buckets at all.  This field defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// Selector is a label selector used to list buckets in the namespace
    /// that are managed by the Operator.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<CouchbaseClusterBucketsSelector>,
    /// Synchronize allows unmanaged buckets, scopes, and collections to be synchronized as
    /// Kubernetes resources by the Operator.  This feature is intended for development only
    /// and should not be used for production workloads.  The synchronization workflow starts
    /// with `spec.buckets.managed` being set to false, the user can manually create buckets,
    /// scopes, and collections using the Couchbase UI, or other tooling.  When you wish to
    /// commit to Kubernetes resources, you must specify a unique label selector in the
    /// `spec.buckets.selector` field, and this field is set to true.  The Operator will
    /// create Kubernetes resources for you, and upon completion set the cluster's `Synchronized`
    /// status condition. Synchronizing will not create a Kubernetes resource for the Couchbase
    /// Server maintained _system scope. You may then safely set `spec.buckets.managed` to
    /// true and the Operator will manage these resources as per usual.  To update an already
    /// managed data topology, you must first set it to unmanaged, make any changes, and delete
    /// any old resources, then follow the standard synchronization workflow.  The Operator
    /// can not, and will not, ever delete, or make modifications to resource specifications
    /// that are intended to be user managed, or managed by a life cycle management tool. These
    /// actions must be instigated by an end user.  For a more complete experience, refer to
    /// the documentation for the `cao save` and `cao restore` CLI commands.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub synchronize: Option<bool>,
}

/// Selector is a label selector used to list buckets in the namespace
/// that are managed by the Operator.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBucketsSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterBucketsSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterBucketsSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// ClusterSettings define Couchbase cluster-wide settings such as memory allocation,
/// failover characteristics and index settings.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterCluster {
    /// AnalyticsServiceMemQuota is the amount of memory that should be allocated to the analytics service.
    /// This value is per-pod, and only applicable to pods belonging to server classes running
    /// the analytics service.  This field must be a quantity greater than or equal to 1Gi.  This
    /// field defaults to 1Gi.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsServiceMemoryQuota")]
    pub analytics_service_memory_quota: Option<String>,
    /// AutoCompaction allows the configuration of auto-compaction, including on what
    /// conditions disk space is reclaimed and when it is allowed to run. Cluster level settings
    /// will be used as the default when creating new buckets and any changes to the settings will be applied
    /// to all existing buckets that have not had their auto-compaction settings individually modified.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoCompaction")]
    pub auto_compaction: Option<CouchbaseClusterClusterAutoCompaction>,
    /// AutoFailoverMaxCount is the maximum number of automatic failovers Couchbase server
    /// will allow before not allowing any more.  This field must be between 1-3 for server versions prior to 7.1.0
    /// default is 1.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoFailoverMaxCount")]
    pub auto_failover_max_count: Option<i64>,
    /// AutoFailoverOnDataDiskIssues defines whether Couchbase server should failover a pod
    /// if a disk issue was detected.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoFailoverOnDataDiskIssues")]
    pub auto_failover_on_data_disk_issues: Option<bool>,
    /// AutoFailoverOnDataDiskIssuesTimePeriod defines how long to wait for transient errors
    /// before failing over a faulty disk.  This field must be in the range 5-3600s, defaulting
    /// to 120s.  More info:  <https://golang.org/pkg/time/#ParseDuration>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoFailoverOnDataDiskIssuesTimePeriod")]
    pub auto_failover_on_data_disk_issues_time_period: Option<String>,
    /// AutoFailoverServerGroup whether to enable failing over a server group.
    /// This field is ignored in server versions 7.1+ as it has been removed from the Couchbase API
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoFailoverServerGroup")]
    pub auto_failover_server_group: Option<bool>,
    /// AutoFailoverTimeout defines how long Couchbase server will wait between a pod
    /// being witnessed as down, until when it will failover the pod.  Couchbase server
    /// will only failover pods if it deems it safe to do so, and not result in data
    /// loss.  This field must be in the range 5-3600s, defaulting to 120s.
    /// More info:  <https://golang.org/pkg/time/#ParseDuration>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoFailoverTimeout")]
    pub auto_failover_timeout: Option<String>,
    /// ClusterName defines the name of the cluster, as displayed in the Couchbase UI.
    /// By default, the cluster name is that specified in the CouchbaseCluster resource's
    /// metadata.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterName")]
    pub cluster_name: Option<String>,
    /// Data allows the data service to be configured.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<CouchbaseClusterClusterData>,
    /// DataServiceMemQuota is the amount of memory that should be allocated to the data service.
    /// This value is per-pod, and only applicable to pods belonging to server classes running
    /// the data service.  This field must be a quantity greater than or equal to 256Mi.  This
    /// field defaults to 256Mi.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataServiceMemoryQuota")]
    pub data_service_memory_quota: Option<String>,
    /// EventingServiceMemQuota is the amount of memory that should be allocated to the eventing service.
    /// This value is per-pod, and only applicable to pods belonging to server classes running
    /// the eventing service.  This field must be a quantity greater than or equal to 256Mi.  This
    /// field defaults to 256Mi.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventingServiceMemoryQuota")]
    pub eventing_service_memory_quota: Option<String>,
    /// IndexServiceMemQuota is the amount of memory that should be allocated to the index service.
    /// This value is per-pod, and only applicable to pods belonging to server classes running
    /// the index service.  This field must be a quantity greater than or equal to 256Mi.  This
    /// field defaults to 256Mi.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "indexServiceMemoryQuota")]
    pub index_service_memory_quota: Option<String>,
    /// DEPRECATED - by indexer.
    /// The index storage mode to use for secondary indexing.  This field must be one of
    /// "memory_optimized" or "plasma", defaulting to "memory_optimized".  This field is
    /// immutable and cannot be changed unless there are no server classes running the
    /// index service in the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "indexStorageSetting")]
    pub index_storage_setting: Option<CouchbaseClusterClusterIndexStorageSetting>,
    /// Indexer allows the indexer to be configured.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indexer: Option<CouchbaseClusterClusterIndexer>,
    /// Query allows the query service to be configured.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub query: Option<CouchbaseClusterClusterQuery>,
    /// QueryServiceMemQuota is used when the spec.autoResourceAllocation feature is enabled,
    /// and is used to define the amount of memory reserved by the query service for use with
    /// Kubernetes resource scheduling. More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    /// In CB Server 7.6.0+ QueryServiceMemQuota also sets a soft memory limit for every Query node in the cluster.
    /// The garbage collector tries to keep below this target. It is not a hard, absolute limit, and memory
    /// usage may exceed this value.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "queryServiceMemoryQuota")]
    pub query_service_memory_quota: Option<String>,
    /// SearchServiceMemQuota is the amount of memory that should be allocated to the search service.
    /// This value is per-pod, and only applicable to pods belonging to server classes running
    /// the search service.  This field must be a quantity greater than or equal to 256Mi.  This
    /// field defaults to 256Mi.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "searchServiceMemoryQuota")]
    pub search_service_memory_quota: Option<String>,
}

/// AutoCompaction allows the configuration of auto-compaction, including on what
/// conditions disk space is reclaimed and when it is allowed to run. Cluster level settings
/// will be used as the default when creating new buckets and any changes to the settings will be applied
/// to all existing buckets that have not had their auto-compaction settings individually modified.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterAutoCompaction {
    /// DatabaseFragmentationThreshold defines the default database fragmentation level to determine the point when compaction is triggered for buckets with a couchstore storage backend.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "databaseFragmentationThreshold")]
    pub database_fragmentation_threshold: Option<CouchbaseClusterClusterAutoCompactionDatabaseFragmentationThreshold>,
    /// ParallelCompaction controls whether database and view compactions can happen
    /// in parallel.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "parallelCompaction")]
    pub parallel_compaction: Option<bool>,
    /// TimeWindow allows restriction of when compaction can occur.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeWindow")]
    pub time_window: Option<CouchbaseClusterClusterAutoCompactionTimeWindow>,
    /// TombstonePurgeInterval controls how long to wait before purging tombstones.
    /// This field must be in the range 1h-1440h, defaulting to 72h.
    /// More info:  <https://golang.org/pkg/time/#ParseDuration>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tombstonePurgeInterval")]
    pub tombstone_purge_interval: Option<String>,
    /// ViewFragmentationThreshold defines triggers for when view compaction should start.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "viewFragmentationThreshold")]
    pub view_fragmentation_threshold: Option<CouchbaseClusterClusterAutoCompactionViewFragmentationThreshold>,
}

/// DatabaseFragmentationThreshold defines the default database fragmentation level to determine the point when compaction is triggered for buckets with a couchstore storage backend.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterAutoCompactionDatabaseFragmentationThreshold {
    /// Percent is the percentage of disk fragmentation after which to decompaction will be
    /// triggered. This field must be in the range 2-100, defaulting to 30.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub percent: Option<i64>,
    /// Size is the amount of disk framentation, that once exceeded, will trigger decompaction.
    /// More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
}

/// TimeWindow allows restriction of when compaction can occur.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterAutoCompactionTimeWindow {
    /// AbortCompactionOutsideWindow stops compaction processes when the
    /// process moves outside the window, defaulting to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "abortCompactionOutsideWindow")]
    pub abort_compaction_outside_window: Option<bool>,
    /// End is a wallclock time, in the form HH:MM, when a compaction should stop.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end: Option<String>,
    /// Start is a wallclock time, in the form HH:MM, when a compaction is permitted to start.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<String>,
}

/// ViewFragmentationThreshold defines triggers for when view compaction should start.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterAutoCompactionViewFragmentationThreshold {
    /// Percent is the percentage of disk fragmentation after which to decompaction will be
    /// triggered. This field must be in the range 2-100, defaulting to 30.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub percent: Option<i64>,
    /// Size is the amount of disk framentation, that once exceeded, will trigger decompaction.
    /// More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
}

/// Data allows the data service to be configured.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterData {
    /// AuxIOThreads allows the number of threads used by the data service,
    /// per pod, to be altered.  This indicates the number of threads that are
    /// to be used in the AuxIO thread pool to run auxiliary I/O tasks.
    /// This value must be between 1 and 64 threads and is only supported on CB versions 7.1.0+.
    /// and should only be increased where there are sufficient CPU resources
    /// allocated for their use. If not specified, this defaults to the
    /// default value set by Couchbase Server.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "auxIOThreads")]
    pub aux_io_threads: Option<i64>,
    /// MinReplicasCount allows the minimum number of replicas required for
    /// buckets to be set. New buckets cannot be created with less than this minimum.
    /// This field must be between 0 and 3, defaulting to 0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minReplicasCount")]
    pub min_replicas_count: Option<i64>,
    /// NonIOThreads allows the number of threads used by the data service,
    /// per pod, to be altered.  This indicates the number of threads that are
    /// to be used in the NonIO thread pool to run in memory tasks.
    /// This value must be between 1 and 64 threads and is only supported on CB versions 7.1.0+.
    /// and should only be increased where there are sufficient CPU resources
    /// allocated for their use. If not specified, this defaults to the
    /// default value set by Couchbase Server.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nonIOThreads")]
    pub non_io_threads: Option<i64>,
    /// ReaderThreads allows the number of threads used by the data service,
    /// per pod, to be altered.  This value must be between 4 and 64 threads for CB versions below 7.1.0 and,
    /// or 1 and 64 for CB versions 7.1.0+.
    /// and should only be increased where there are sufficient CPU resources
    /// allocated for their use.  If not specified, this defaults to the
    /// default value set by Couchbase Server.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "readerThreads")]
    pub reader_threads: Option<i64>,
    /// WriterThreads allows the number of threads used by the data service,
    /// per pod, to be altered.  This setting is especially relevant when
    /// using "durable writes", increasing this field will have a large
    /// impact on performance.  This value must be between 4 and 64 threads for CB versions below 7.1.0 and,
    /// 	// or 1 and 64 for CB versions 7.1.0+.
    /// and should only be increased where there are sufficient CPU resources
    /// allocated for their use. If not specified, this defaults to the
    /// default value set by Couchbase Server.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "writerThreads")]
    pub writer_threads: Option<i64>,
}

/// ClusterSettings define Couchbase cluster-wide settings such as memory allocation,
/// failover characteristics and index settings.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterClusterIndexStorageSetting {
    #[serde(rename = "memory_optimized")]
    MemoryOptimized,
    #[serde(rename = "plasma")]
    Plasma,
}

/// Indexer allows the indexer to be configured.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterIndexer {
    /// EnablePageBloomFilter gives Couchbase Server guidance whether
    /// bloom filters should be used when item lookups occur. These help to
    /// indicate during a lookup that an item is not on disk, and therefore
    /// prevent unnecessary on-disk searches.
    /// This field is only supported on CB versions 7.1.0+.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enablePageBloomFilter")]
    pub enable_page_bloom_filter: Option<bool>,
    /// EnableShardAffinity when false Index Servers rebuild any index that
    /// are newly assigned to them during a rebalance. When set to true,
    /// Couchbase Server moves a reassigned index’s files between Index Servers.
    /// This field is only supported on CB versions 7.6.0+.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enableShardAffinity")]
    pub enable_shard_affinity: Option<bool>,
    /// LogLevel controls the verbosity of indexer logs.  This field must be one of
    /// "silent", "fatal", "error", "warn", "info", "verbose", "timing", "debug" or
    /// "trace", defaulting to "info".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "logLevel")]
    pub log_level: Option<CouchbaseClusterClusterIndexerLogLevel>,
    /// MaxRollbackPoints controls the number of checkpoints that can be rolled
    /// back to.  The default is 2, with a minimum of 1.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRollbackPoints")]
    pub max_rollback_points: Option<i64>,
    /// MemorySnapshotInterval controls when memory indexes should be snapshotted.
    /// This defaults to 200ms, and must be greater than or equal to 1ms.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "memorySnapshotInterval")]
    pub memory_snapshot_interval: Option<String>,
    /// NumberOfReplica specifies number of secondary index replicas to be created
    /// by the Index Service whenever CREATE INDEX is invoked, which ensures
    /// high availability and high performance.
    /// Note, if nodes and num_replica are both specified in the WITH clause,
    /// the specified number of nodes must be one greater than num_replica
    /// This field must be between 0 and 16, defaulting to 0, which means no index replicas to be created by default.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "numReplica")]
    pub num_replica: Option<i64>,
    /// RedistributeIndexes when true, Couchbase Server redistributes indexes
    /// when rebalance occurs, in order to optimize performance.
    /// If false (the default), such redistribution does not occur.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "redistributeIndexes")]
    pub redistribute_indexes: Option<bool>,
    /// StableSnapshotInterval controls when disk indexes should be snapshotted.
    /// This defaults to 5s, and must be greater than or equal to 1ms.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "stableSnapshotInterval")]
    pub stable_snapshot_interval: Option<String>,
    /// StorageMode controls the underlying storage engine for indexes.  Once set
    /// it can only be modified if there are no nodes in the cluster running the
    /// index service.  The field must be one of "memory_optimized" or "plasma",
    /// defaulting to "memory_optimized".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageMode")]
    pub storage_mode: Option<CouchbaseClusterClusterIndexerStorageMode>,
    /// Threads controls the number of processor threads to use for indexing.
    /// A value of 0 means 1 per CPU.  This attribute must be greater
    /// than or equal to 0, defaulting to 0.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub threads: Option<i64>,
}

/// Indexer allows the indexer to be configured.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterClusterIndexerLogLevel {
    #[serde(rename = "silent")]
    Silent,
    #[serde(rename = "fatal")]
    Fatal,
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "warn")]
    Warn,
    #[serde(rename = "info")]
    Info,
    #[serde(rename = "verbose")]
    Verbose,
    #[serde(rename = "timing")]
    Timing,
    #[serde(rename = "debug")]
    Debug,
    #[serde(rename = "trace")]
    Trace,
}

/// Indexer allows the indexer to be configured.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterClusterIndexerStorageMode {
    #[serde(rename = "memory_optimized")]
    MemoryOptimized,
    #[serde(rename = "plasma")]
    Plasma,
}

/// Query allows the query service to be configured.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterClusterQuery {
    /// BackfillEnabled allows the query service to backfill.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "backfillEnabled")]
    pub backfill_enabled: Option<bool>,
    /// CBOEnabled specifies whether the cost-based optimizer is enabled.
    /// Defaults to true.
    #[serde(rename = "cboEnabled")]
    pub cbo_enabled: bool,
    /// CleanupClientAttemptsEnabled specifies whether the Query service preferentially aims to clean up just
    /// transactions that it has created, leaving transactions for the distributed cleanup process only
    /// when it is forced to.
    /// Defaults to true.
    #[serde(rename = "cleanupClientAttemptsEnabled")]
    pub cleanup_client_attempts_enabled: bool,
    /// CleanupLostAttemptsEnabled specifies the Query service takes part in the distributed cleanup
    /// process, and cleans up expired transactions created by any client.
    /// Defaults to true.
    #[serde(rename = "cleanupLostAttemptsEnabled")]
    pub cleanup_lost_attempts_enabled: bool,
    /// CleanupWindow specifies how frequently the Query service checks its subset of active
    /// transaction records for cleanup.
    /// Defaults to 60s
    #[serde(rename = "cleanupWindow")]
    pub cleanup_window: String,
    /// CompletedLimit sets the number of requests to be logged in the completed
    /// requests catalog. As new completed requests are added, old ones are removed.
    #[serde(rename = "completedLimit")]
    pub completed_limit: i32,
    /// CompletedMaxPlanSize limits the size of query execution plans that can be logged in the
    /// completed requests catalog. Queries with plans larger than this are not logged.
    /// This field is only supported on CB versions 7.6.0+.
    /// Defaults to 262144, maximum value is 20840448, and minimum value is 0.
    #[serde(rename = "completedMaxPlanSize")]
    pub completed_max_plan_size: String,
    /// CompletedTrackingAllRequests allows all requests to be tracked regardless of their
    /// time. This field requires `completedTrackingEnabled` to be true.
    #[serde(rename = "completedTrackingAllRequests")]
    pub completed_tracking_all_requests: bool,
    /// CompletedTrackingEnabled allows completed requests to be tracked in the requests
    /// catalog.
    #[serde(rename = "completedTrackingEnabled")]
    pub completed_tracking_enabled: bool,
    /// CompletedThreshold is a trigger for queries to be logged in the completed
    /// requests catalog. All completed queries lasting longer than this threshold
    /// are logged in the completed requests catalog. This field requires `completedTrackingEnabled`
    /// to be set to true and `completedTrackingAllRequests` to be false to have any effect.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "completedTrackingThreshold")]
    pub completed_tracking_threshold: Option<String>,
    /// LogLevel controls the verbosity of query logs. This field must be one of
    /// "debug", "trace", "info", "warn", "error", "severe", or "none", defaulting to "info".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "logLevel")]
    pub log_level: Option<CouchbaseClusterClusterQueryLogLevel>,
    /// MaxParallelism specifies the maximum parallelism for queries on all Query nodes in the cluster.
    /// If the value is zero, negative, or larger than the number of allowed cored the maximum parallelism
    /// is restricted to the number of allowed cores.
    /// Defaults to 1.
    #[serde(rename = "maxParallelism")]
    pub max_parallelism: i32,
    /// MemoryQuota specifies the maximum amount of memory a request may use on any Query node in the cluster.
    /// This parameter enforces a ceiling on the memory used for the tracked documents required for processing
    /// a request. It does not take into account any other memory that might be used to process a request,
    /// such as the stack, the operators, or some intermediate values.
    /// Defaults to 0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "memoryQuota")]
    pub memory_quota: Option<String>,
    /// NodeQuotaValPercent sets the  percentage of the `useReplica` that is dedicated to tracked
    /// value content memory across all active requests for every Query node in the cluster.
    /// This field is only supported on CB versions 7.6.0+.
    /// Defaults to 67.
    #[serde(rename = "nodeQuotaValPercent")]
    pub node_quota_val_percent: i32,
    /// NumActiveTransactionRecords specifies the total number of active transaction records for
    /// all Query nodes in the cluster.
    /// Default to 1024 and has a minimum of 1.
    #[serde(rename = "numActiveTransactionRecords")]
    pub num_active_transaction_records: i32,
    /// NumCpus is the number of CPUs the Query service can use on any Query node in the cluster.
    /// When set to 0 (the default), the Query service can use all available CPUs, up to the limits described below.
    /// The number of CPUs can never be greater than the number of logical CPUs.
    /// In Community Edition, the number of allowed CPUs cannot be greater than 4.
    /// In Enterprise Edition, there is no limit to the number of allowed CPUs.
    /// This field is only supported on CB versions 7.6.0+.
    /// NOTE: This change requires a restart of the Query service to take effect which can be done by rescheduling
    /// nodes that are running the query service.
    /// Defaults to 0
    #[serde(rename = "numCpus")]
    pub num_cpus: i32,
    /// PipelineBatch controls the number of items execution operators can batch for
    /// Fetch from the KV. Defaults to 16.
    #[serde(rename = "pipelineBatch")]
    pub pipeline_batch: i32,
    /// PipelineCap controls the maximum number of items each execution
    /// operator can buffer between various operators. Defaults to 512.
    #[serde(rename = "pipelineCap")]
    pub pipeline_cap: i32,
    /// PreparedLimit is the maximum number of prepared statements in the cache.
    /// When this cache reaches the limit, the least recently used prepared
    /// statements will be discarded as new prepared statements are created.
    #[serde(rename = "preparedLimit")]
    pub prepared_limit: i32,
    /// ScapCan sets the maximum buffered channel size between the indexer client
    /// and the query service for index scans.
    /// Defaults to 512.
    #[serde(rename = "scanCap")]
    pub scan_cap: i32,
    /// TemporarySpace allows the temporary storage used by the query
    /// service backfill, per-pod, to be modified.  This field requires
    /// `backfillEnabled` to be set to true in order to have any effect.
    /// More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "temporarySpace")]
    pub temporary_space: Option<String>,
    /// TemporarySpaceUnlimited allows the temporary storage used by
    /// the query service backfill, per-pod, to be unconstrained.  This field
    /// requires `backfillEnabled` to be set to true in order to have any effect.
    /// This field overrides `temporarySpace`.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "temporarySpaceUnlimited")]
    pub temporary_space_unlimited: Option<bool>,
    /// Timeout is the maximum time to spend on the request before timing out.
    /// If this field is not set then there will be no timeout.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
    /// TxTimeout is the maximum time to spend on a transaction before timing out. This setting
    /// only applies to requests containing the BEGIN TRANSACTION statement, or to requests where
    /// the tximplicit parameter is set. For all other requests, it is ignored.
    /// Defaults to 0ms (no timeout).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "txTimeout")]
    pub tx_timeout: Option<String>,
    /// UseReplica specifies whether a query can fetch data from a replica vBucket if active vBuckets
    /// are inaccessible. If set to true then read from replica is enabled for all queries, but can
    /// be disabled at request level. If set to false read from replica is disabled for all queries
    /// and cannot be overridden at request level. If this field is unset then it is enabled/disabled
    /// at the request level.
    /// This field is only supported on CB versions 7.6.0+.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "useReplica")]
    pub use_replica: Option<bool>,
}

/// Query allows the query service to be configured.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterClusterQueryLogLevel {
    #[serde(rename = "debug")]
    Debug,
    #[serde(rename = "trace")]
    Trace,
    #[serde(rename = "info")]
    Info,
    #[serde(rename = "warn")]
    Warn,
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "severe")]
    Severe,
    #[serde(rename = "none")]
    None,
}

/// ClusterSpec is the specification for a CouchbaseCluster resources, and allows
/// the cluster to be customized.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterHibernationStrategy {
    Immediate,
}

/// Logging defines Operator logging options.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLogging {
    /// Used to manage the audit configuration directly
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub audit: Option<CouchbaseClusterLoggingAudit>,
    /// LogRetentionCount gives the number of persistent log PVCs to keep.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "logRetentionCount")]
    pub log_retention_count: Option<i64>,
    /// LogRetentionTime gives the time to keep persistent log PVCs alive for.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "logRetentionTime")]
    pub log_retention_time: Option<String>,
    /// Specification of all logging configuration required to manage the sidecar containers in each pod.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub server: Option<CouchbaseClusterLoggingServer>,
}

/// Used to manage the audit configuration directly
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingAudit {
    /// The list of event ids to disable for auditing purposes.
    /// This is passed to the REST API with no verification by the operator.
    /// Refer to the documentation for details:
    /// <https://docs.couchbase.com/server/current/audit-event-reference/audit-event-reference.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disabledEvents")]
    pub disabled_events: Option<Vec<i64>>,
    /// The list of users to ignore for auditing purposes.
    /// This is passed to the REST API with minimal validation it meets an acceptable regex pattern.
    /// Refer to the documentation for full details on how to configure this:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/manage-auditing.html#ignoring-events-by-user>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disabledUsers")]
    pub disabled_users: Option<Vec<String>>,
    /// Enabled is a boolean that enables the audit capabilities.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Handle all optional garbage collection (GC) configuration for the audit functionality.
    /// This is not part of the audit REST API, it is intended to handle GC automatically for the audit logs.
    /// By default the Couchbase Server rotates the audit logs but does not clean up the rotated logs.
    /// This is left as an operation for the cluster administrator to manage, the operator allows for us to automate this:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/manage-auditing.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "garbageCollection")]
    pub garbage_collection: Option<CouchbaseClusterLoggingAuditGarbageCollection>,
    /// The interval to optionally rotate the audit log.
    /// This is passed to the REST API, see here for details:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/manage-auditing.html>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rotation: Option<CouchbaseClusterLoggingAuditRotation>,
}

/// Handle all optional garbage collection (GC) configuration for the audit functionality.
/// This is not part of the audit REST API, it is intended to handle GC automatically for the audit logs.
/// By default the Couchbase Server rotates the audit logs but does not clean up the rotated logs.
/// This is left as an operation for the cluster administrator to manage, the operator allows for us to automate this:
/// <https://docs.couchbase.com/server/current/manage/manage-security/manage-auditing.html>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingAuditGarbageCollection {
    /// DEPRECATED - by spec.logging.audit.rotation for Couchbase Server 7.2.4+
    /// Provide the sidecar configuration required (if so desired) to automatically clean up audit logs.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sidecar: Option<CouchbaseClusterLoggingAuditGarbageCollectionSidecar>,
}

/// DEPRECATED - by spec.logging.audit.rotation for Couchbase Server 7.2.4+
/// Provide the sidecar configuration required (if so desired) to automatically clean up audit logs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingAuditGarbageCollectionSidecar {
    /// The minimum age of rotated log files to remove, defaults to one hour.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub age: Option<String>,
    /// Enable this sidecar by setting to true, defaults to being disabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Image is the image to be used to run the audit sidecar helper.
    /// No validation is carried out as this can be any arbitrary repo and tag.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    /// The interval at which to check for rotated log files to remove, defaults to 20 minutes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub interval: Option<String>,
    /// Resources is the resource requirements for the cleanup container.
    /// Will be populated by Kubernetes defaults if not specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<CouchbaseClusterLoggingAuditGarbageCollectionSidecarResources>,
}

/// Resources is the resource requirements for the cleanup container.
/// Will be populated by Kubernetes defaults if not specified.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingAuditGarbageCollectionSidecarResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims,
    /// that are used by this container.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<CouchbaseClusterLoggingAuditGarbageCollectionSidecarResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required.
    /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingAuditGarbageCollectionSidecarResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of
    /// the Pod where this field is used. It makes that resource available
    /// inside a container.
    pub name: String,
}

/// The interval to optionally rotate the audit log.
/// This is passed to the REST API, see here for details:
/// <https://docs.couchbase.com/server/current/manage/manage-security/manage-auditing.html>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingAuditRotation {
    /// The interval at which to rotate log files, defaults to 15 minutes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub interval: Option<String>,
    /// How long Couchbase Server keeps rotated audit logs.
    /// If set to 0 (the default) then audit logs won't be pruned.
    /// Has a maximum of 35791394 seconds.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "pruneAge")]
    pub prune_age: Option<String>,
    /// Size allows the specification of a rotation size for the log, defaults to 20Mi.
    /// More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
}

/// Specification of all logging configuration required to manage the sidecar containers in each pod.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingServer {
    /// ConfigurationName is the name of the Secret to use holding the logging configuration in the namespace.
    /// A Secret is used to ensure we can safely store credentials but this can be populated from plaintext if acceptable too.
    /// If it does not exist then one will be created with defaults in the namespace so it can be easily updated whilst running.
    /// Note that if running multiple clusters in the same kubernetes namespace then you should use a separate Secret for each,
    /// otherwise the first cluster will take ownership (if created) and the Secret will be cleaned up when that cluster is
    /// removed. If running clusters in separate namespaces then they will be separate Secrets anyway.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configurationName")]
    pub configuration_name: Option<String>,
    /// Enabled is a boolean that enables the logging sidecar container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// A boolean which indicates whether the operator should manage the configuration or not.
    /// If omitted then this defaults to true which means the operator will attempt to reconcile it to default values.
    /// To use a custom configuration make sure to set this to false.
    /// Note that the ownership of any Secret is not changed so if a Secret is created externally it can be updated by
    /// the operator but it's ownership stays the same so it will be cleaned up when it's owner is.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "manageConfiguration")]
    pub manage_configuration: Option<bool>,
    /// Any specific logging sidecar container configuration.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sidecar: Option<CouchbaseClusterLoggingServerSidecar>,
}

/// Any specific logging sidecar container configuration.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingServerSidecar {
    /// ConfigurationMountPath is the location to mount the ConfigurationName Secret into the image.
    /// If another log shipping image is used that needs a different mount then modify this.
    /// Note that the configuration file must be called 'fluent-bit.conf' at the root of this path,
    /// there is no provision for overriding the name of the config file passed as the
    /// COUCHBASE_LOGS_CONFIG_FILE environment variable.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configurationMountPath")]
    pub configuration_mount_path: Option<String>,
    /// Image is the image to be used to deal with logging as a sidecar.
    /// No validation is carried out as this can be any arbitrary repo and tag.
    /// It will default to the latest supported version of Fluent Bit.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    /// Resources is the resource requirements for the sidecar container.
    /// Will be populated by Kubernetes defaults if not specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<CouchbaseClusterLoggingServerSidecarResources>,
}

/// Resources is the resource requirements for the sidecar container.
/// Will be populated by Kubernetes defaults if not specified.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingServerSidecarResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims,
    /// that are used by this container.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<CouchbaseClusterLoggingServerSidecarResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required.
    /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterLoggingServerSidecarResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of
    /// the Pod where this field is used. It makes that resource available
    /// inside a container.
    pub name: String,
}

/// Migration defines the specification for a CouchbaseCluster assimilation of an unmanaged
/// cluster to a managed Kubernetes cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterMigration {
    /// MaxConcurrentMigrations is the maximum number of nodes migrations the operator will run concurrently.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxConcurrentMigrations")]
    pub max_concurrent_migrations: Option<i64>,
    /// MigrationOrderOverride defines the strategy for migration order. If not set then the operator will choose nodes at random.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "migrationOrderOverride")]
    pub migration_order_override: Option<CouchbaseClusterMigrationMigrationOrderOverride>,
    /// NumUnmanagedNodes is the number of nodes the operator will leave in the cluster unmigrated.
    /// This is useful for controlling how much of the cluster to migrate over at a time. If not specified
    /// the operator will migrate all nodes.
    /// e.g. if the unmanaged cluster has 10 nodes and NumUnmanagedNodes is set to 2, then the operator will
    /// migrate 8 nodes to Kubernetes and leave 2 nodes.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "numUnmanagedNodes")]
    pub num_unmanaged_nodes: Option<i64>,
    /// StabilizationPeriod is the time the operator will wait after a migration before starting the next migration.
    /// If not specified the operator will start the next migration immediately.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "stabilizationPeriod")]
    pub stabilization_period: Option<String>,
    /// UnmanagedClusterHost is a host of the unmanaged Couchbase cluster to be migrated. This is the host
    /// that the operator will connect to to start the migration process.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "unmanagedClusterHost")]
    pub unmanaged_cluster_host: Option<String>,
}

/// MigrationOrderOverride defines the strategy for migration order. If not set then the operator will choose nodes at random.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterMigrationMigrationOrderOverride {
    /// MigrationOrderOverrideStrategy defines the strategy for migration order. When not set, the operator will choose nodes at random.
    /// When ByServerGroup is set, the operator will migrate nodes in the order of the server groups defined in spec.migration.migrationOrderOverride.serverGroupOrder.
    /// If spec.migration.migrationOrderOverride.serverGroupOrder is not set, the operator will migrate the server groups in alphabetical order.
    /// When ByServerClass is set, the operator will migrate nodes in the order of the server classes defined in spec.migration.migrationOrderOverride.serverClassOrder.
    /// If spec.migration.migrationOrderOverride.serverClassOrder is not set, the operator will migrate the server classes in the order of the server classes defined in spec.servers.
    /// When ByNode is set, the operator will migrate nodes in the order of the nodes defined in spec.migration.migrationOrderOverride.nodeOrder.
    /// If spec.migration.migrationOrderOverride.nodeOrder is not set, the operator will migrate the nodes in alphabetical order.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "migrationOrderOverrideStrategy")]
    pub migration_order_override_strategy: Option<CouchbaseClusterMigrationMigrationOrderOverrideMigrationOrderOverrideStrategy>,
    /// NodeOrder defines the order of nodes for migration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeOrder")]
    pub node_order: Option<Vec<String>>,
    /// ServerClassOrder defines the order of server classes for migration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverClassOrder")]
    pub server_class_order: Option<Vec<String>>,
    /// ServerGroupOrder defines the order of server groups for migration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverGroupOrder")]
    pub server_group_order: Option<Vec<String>>,
}

/// MigrationOrderOverride defines the strategy for migration order. If not set then the operator will choose nodes at random.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterMigrationMigrationOrderOverrideMigrationOrderOverrideStrategy {
    ByServerGroup,
    ByServerClass,
    ByNode,
}

/// DEPRECATED - By Couchbase Server metrics endpoint on version 7.0+
/// Monitoring defines any Operator managed integration into 3rd party monitoring
/// infrastructure.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterMonitoring {
    /// DEPRECATED - By Couchbase Server metrics endpoint on version 7.0+
    /// Prometheus provides integration with Prometheus monitoring.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prometheus: Option<CouchbaseClusterMonitoringPrometheus>,
}

/// DEPRECATED - By Couchbase Server metrics endpoint on version 7.0+
/// Prometheus provides integration with Prometheus monitoring.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterMonitoringPrometheus {
    /// AuthorizationSecret is the name of a Kubernetes secret that contains a
    /// bearer token to authorize GET requests to the metrics endpoint
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "authorizationSecret")]
    pub authorization_secret: Option<String>,
    /// Enabled is a boolean that enables/disables the metrics sidecar container.
    /// This must be set to true, when image is provided.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Image is the metrics image to be used to collect metrics.
    /// No validation is carried out as this can be any arbitrary repo and tag.
    /// enabled must be set to true, when image is provided.
    pub image: String,
    /// RefreshRate is the frequency in which cached statistics are updated in seconds.
    /// Shorter intervals will add additional resource overhead to clusters running Couchbase Server 7.0+
    /// Default is 60 seconds, Maximum value is 600 seconds, and minimum value is 1 second.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "refreshRate")]
    pub refresh_rate: Option<i64>,
    /// Resources is the resource requirements for the metrics container.
    /// Will be populated by Kubernetes defaults if not specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<CouchbaseClusterMonitoringPrometheusResources>,
}

/// Resources is the resource requirements for the metrics container.
/// Will be populated by Kubernetes defaults if not specified.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterMonitoringPrometheusResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims,
    /// that are used by this container.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<CouchbaseClusterMonitoringPrometheusResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required.
    /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterMonitoringPrometheusResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of
    /// the Pod where this field is used. It makes that resource available
    /// inside a container.
    pub name: String,
}

/// Networking defines Couchbase cluster networking options such as network
/// topology, TLS and DDNS settings.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworking {
    /// AddressFamily allows the manual selection of the address family to use.
    /// When this field is not set, Couchbase server will default to using IPv4
    /// for internal communication and also support IPv6 on dual stack systems.
    /// Setting this field to either IPv4 or IPv6 will force Couchbase to use the
    /// selected protocol for internal communication, and also disable all other
    /// protocols to provide added security and simplicty when defining firewall
    /// rules.  Disabling of address families is only supported in Couchbase
    /// Server 7.0.2+.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "addressFamily")]
    pub address_family: Option<CouchbaseClusterNetworkingAddressFamily>,
    /// AdminConsoleServiceTemplate provides a template used by the Operator to create
    /// and manage the admin console service.  This allows services to be annotated, the
    /// service type defined and any other options that Kubernetes provides.  When using
    /// a LoadBalancer service type, TLS and dynamic DNS must also be enabled. The Operator
    /// reserves the right to modify or replace any field.  More info:
    /// <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#service-v1-core>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "adminConsoleServiceTemplate")]
    pub admin_console_service_template: Option<CouchbaseClusterNetworkingAdminConsoleServiceTemplate>,
    /// DEPRECATED - by adminConsoleServiceTemplate.
    /// AdminConsoleServiceType defines whether to create a node port or load balancer service.
    /// When using a LoadBalancer service type, TLS and dynamic DNS must also be enabled.
    /// This field must be one of "NodePort" or "LoadBalancer", defaulting to "NodePort".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "adminConsoleServiceType")]
    pub admin_console_service_type: Option<CouchbaseClusterNetworkingAdminConsoleServiceType>,
    /// DEPRECATED - not required by Couchbase Server.
    /// AdminConsoleServices is a selector to choose specific services to expose via the admin
    /// console. This field may contain any of "data", "index", "query", "search", "eventing"
    /// and "analytics".  Each service may only be included once.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "adminConsoleServices")]
    pub admin_console_services: Option<Vec<String>>,
    /// CloudNativeGateway is used to provision a gRPC gateway proxying a Couchbase
    /// cluster.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cloudNativeGateway")]
    pub cloud_native_gateway: Option<CouchbaseClusterNetworkingCloudNativeGateway>,
    /// DisableUIOverHTTP is used to explicitly enable and disable UI access over
    /// the HTTP protocol.  If not specified, this field defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableUIOverHTTP")]
    pub disable_ui_over_http: Option<bool>,
    /// DisableUIOverHTTPS is used to explicitly enable and disable UI access over
    /// the HTTPS protocol.  If not specified, this field defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableUIOverHTTPS")]
    pub disable_ui_over_https: Option<bool>,
    /// DNS defines information required for Dynamic DNS support.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dns: Option<CouchbaseClusterNetworkingDns>,
    /// ExposeAdminConsole creates a service referencing the admin console.
    /// The service is configured by the adminConsoleServiceTemplate field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "exposeAdminConsole")]
    pub expose_admin_console: Option<bool>,
    /// ExposedFeatureServiceTemplate provides a template used by the Operator to create
    /// and manage per-pod services.  This allows services to be annotated, the
    /// service type defined and any other options that Kubernetes provides.  When using
    /// a LoadBalancer service type, TLS and dynamic DNS must also be enabled. The Operator
    /// reserves the right to modify or replace any field.  More info:
    /// <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#service-v1-core>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "exposedFeatureServiceTemplate")]
    pub exposed_feature_service_template: Option<CouchbaseClusterNetworkingExposedFeatureServiceTemplate>,
    /// DEPRECATED - by exposedFeatureServiceTemplate.
    /// ExposedFeatureServiceType defines whether to create a node port or load balancer service.
    /// When using a LoadBalancer service type, TLS and dynamic DNS must also be enabled.
    /// This field must be one of "NodePort" or "LoadBalancer", defaulting to "NodePort".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "exposedFeatureServiceType")]
    pub exposed_feature_service_type: Option<CouchbaseClusterNetworkingExposedFeatureServiceType>,
    /// DEPRECATED  - by exposedFeatureServiceTemplate.
    /// ExposedFeatureTrafficPolicy defines how packets should be routed from a load balancer
    /// service to a Couchbase pod.  When local, traffic is routed directly to the pod.  When
    /// cluster, traffic is routed to any node, then forwarded on.  While cluster routing may be
    /// slower, there are some situations where it is required for connectivity.  This field
    /// must be either "Cluster" or "Local", defaulting to "Local",
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "exposedFeatureTrafficPolicy")]
    pub exposed_feature_traffic_policy: Option<CouchbaseClusterNetworkingExposedFeatureTrafficPolicy>,
    /// ExposedFeatures is a list of Couchbase features to expose when using a networking
    /// model that exposes the Couchbase cluster externally to Kubernetes.  This field also
    /// triggers the creation of per-pod services used by clients to connect to the Couchbase
    /// cluster.  When admin, only the administrator port is exposed, allowing remote
    /// administration.  When xdcr, only the services required for remote replication are exposed.
    /// The xdcr feature is only required when the cluster is the destination of an XDCR
    /// replication.  When client, all services are exposed as required for client SDK operation.
    /// This field may contain any of "admin", "xdcr" and "client".  Each feature may only be
    /// included once.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "exposedFeatures")]
    pub exposed_features: Option<Vec<String>>,
    /// DEPRECATED - by adminConsoleServiceTemplate and exposedFeatureServiceTemplate.
    /// LoadBalancerSourceRanges applies only when an exposed service is of type
    /// LoadBalancer and limits the source IP ranges that are allowed to use the
    /// service.  Items must use IPv4 class-less interdomain routing (CIDR) notation
    /// e.g. 10.0.0.0/16.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerSourceRanges")]
    pub load_balancer_source_ranges: Option<Vec<String>>,
    /// NetworkPlatform is used to enable support for various networking
    /// technologies.  This field must be one of "Istio".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "networkPlatform")]
    pub network_platform: Option<CouchbaseClusterNetworkingNetworkPlatform>,
    /// DEPRECATED - by adminConsoleServiceTemplate and exposedFeatureServiceTemplate.
    /// ServiceAnnotations allows services to be annotated with custom labels.
    /// Operator annotations are merged on top of these so have precedence as
    /// they are required for correct operation.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAnnotations")]
    pub service_annotations: Option<BTreeMap<String, String>>,
    /// TLS defines the TLS configuration for the cluster including
    /// server and client certificate configuration, and TLS security policies.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tls: Option<CouchbaseClusterNetworkingTls>,
    /// WaitForAddressReachable is used to set the timeout between when polling of
    /// external addresses is started, and when it is deemed a failure.  Polling of
    /// DNS name availability inherently dangerous due to negative caching, so prefer
    /// the use of an initial `waitForAddressReachableDelay` to allow propagation.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "waitForAddressReachable")]
    pub wait_for_address_reachable: Option<String>,
    /// WaitForAddressReachableDelay is used to defer operator checks that
    /// ensure external addresses are reachable before new nodes are balanced
    /// in to the cluster.  This prevents negative DNS caching while waiting
    /// for external-DDNS controllers to propagate addresses.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "waitForAddressReachableDelay")]
    pub wait_for_address_reachable_delay: Option<String>,
}

/// Networking defines Couchbase cluster networking options such as network
/// topology, TLS and DDNS settings.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingAddressFamily {
    IPv4,
    IPv6,
}

/// AdminConsoleServiceTemplate provides a template used by the Operator to create
/// and manage the admin console service.  This allows services to be annotated, the
/// service type defined and any other options that Kubernetes provides.  When using
/// a LoadBalancer service type, TLS and dynamic DNS must also be enabled. The Operator
/// reserves the right to modify or replace any field.  More info:
/// <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#service-v1-core>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingAdminConsoleServiceTemplate {
    /// Standard objects metadata.  This is a curated version for use with Couchbase
    /// resource templates.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<CouchbaseClusterNetworkingAdminConsoleServiceTemplateMetadata>,
    /// ServiceSpec describes the attributes that a user creates on a service.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub spec: Option<CouchbaseClusterNetworkingAdminConsoleServiceTemplateSpec>,
}

/// Standard objects metadata.  This is a curated version for use with Couchbase
/// resource templates.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingAdminConsoleServiceTemplateMetadata {
    /// Annotations is an unstructured key value map stored with a resource that
    /// may be set by external tools to store and retrieve arbitrary metadata. They
    /// are not queryable and should be preserved when modifying objects. More
    /// info: <http://kubernetes.io/docs/user-guide/annotations>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services. More info: <http://kubernetes.io/docs/user-guide/labels>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// ServiceSpec describes the attributes that a user creates on a service.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingAdminConsoleServiceTemplateSpec {
    /// allocateLoadBalancerNodePorts defines if NodePorts will be automatically
    /// allocated for services with type LoadBalancer.  Default is "true". It
    /// may be set to "false" if the cluster load-balancer does not rely on
    /// NodePorts.  If the caller requests specific NodePorts (by specifying a
    /// value), those requests will be respected, regardless of this field.
    /// This field may only be set for services with type LoadBalancer and will
    /// be cleared if the type is changed to any other type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allocateLoadBalancerNodePorts")]
    pub allocate_load_balancer_node_ports: Option<bool>,
    /// clusterIP is the IP address of the service and is usually assigned
    /// randomly. If an address is specified manually, is in-range (as per
    /// system configuration), and is not in use, it will be allocated to the
    /// service; otherwise creation of the service will fail. This field may not
    /// be changed through updates unless the type field is also being changed
    /// to ExternalName (which requires this field to be blank) or the type
    /// field is being changed from ExternalName (in which case this field may
    /// optionally be specified, as describe above).  Valid values are "None",
    /// empty string (""), or a valid IP address. Setting this to "None" makes a
    /// "headless service" (no virtual IP), which is useful when direct endpoint
    /// connections are preferred and proxying is not required.  Only applies to
    /// types ClusterIP, NodePort, and LoadBalancer. If this field is specified
    /// when creating a Service of type ExternalName, creation will fail. This
    /// field will be wiped when updating a Service to type ExternalName.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterIP")]
    pub cluster_ip: Option<String>,
    /// ClusterIPs is a list of IP addresses assigned to this service, and are
    /// usually assigned randomly.  If an address is specified manually, is
    /// in-range (as per system configuration), and is not in use, it will be
    /// allocated to the service; otherwise creation of the service will fail.
    /// This field may not be changed through updates unless the type field is
    /// also being changed to ExternalName (which requires this field to be
    /// empty) or the type field is being changed from ExternalName (in which
    /// case this field may optionally be specified, as describe above).  Valid
    /// values are "None", empty string (""), or a valid IP address.  Setting
    /// this to "None" makes a "headless service" (no virtual IP), which is
    /// useful when direct endpoint connections are preferred and proxying is
    /// not required.  Only applies to types ClusterIP, NodePort, and
    /// LoadBalancer. If this field is specified when creating a Service of type
    /// ExternalName, creation will fail. This field will be wiped when updating
    /// a Service to type ExternalName.  If this field is not specified, it will
    /// be initialized from the clusterIP field.  If this field is specified,
    /// clients must ensure that clusterIPs[0] and clusterIP have the same
    /// value.
    /// 
    /// 
    /// This field may hold a maximum of two entries (dual-stack IPs, in either order).
    /// These IPs must correspond to the values of the ipFamilies field. Both
    /// clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterIPs")]
    pub cluster_i_ps: Option<Vec<String>>,
    /// externalIPs is a list of IP addresses for which nodes in the cluster
    /// will also accept traffic for this service.  These IPs are not managed by
    /// Kubernetes.  The user is responsible for ensuring that traffic arrives
    /// at a node with this IP.  A common example is external load-balancers
    /// that are not part of the Kubernetes system.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalIPs")]
    pub external_i_ps: Option<Vec<String>>,
    /// externalName is the external reference that discovery mechanisms will
    /// return as an alias for this service (e.g. a DNS CNAME record). No
    /// proxying will be involved.  Must be a lowercase RFC-1123 hostname
    /// (<https://tools.ietf.org/html/rfc1123)> and requires `type` to be "ExternalName".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalName")]
    pub external_name: Option<String>,
    /// externalTrafficPolicy describes how nodes distribute service traffic they
    /// receive on one of the Service's "externally-facing" addresses (NodePorts,
    /// ExternalIPs, and LoadBalancer IPs). If set to "Local", the proxy will configure
    /// the service in a way that assumes that external load balancers will take care
    /// of balancing the service traffic between nodes, and so each node will deliver
    /// traffic only to the node-local endpoints of the service, without masquerading
    /// the client source IP. (Traffic mistakenly sent to a node with no endpoints will
    /// be dropped.) The default value, "Cluster", uses the standard behavior of
    /// routing to all endpoints evenly (possibly modified by topology and other
    /// features). Note that traffic sent to an External IP or LoadBalancer IP from
    /// within the cluster will always get "Cluster" semantics, but clients sending to
    /// a NodePort from within the cluster may need to take traffic policy into account
    /// when picking a node.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalTrafficPolicy")]
    pub external_traffic_policy: Option<String>,
    /// healthCheckNodePort specifies the healthcheck nodePort for the service.
    /// This only applies when type is set to LoadBalancer and
    /// externalTrafficPolicy is set to Local. If a value is specified, is
    /// in-range, and is not in use, it will be used.  If not specified, a value
    /// will be automatically allocated.  External systems (e.g. load-balancers)
    /// can use this port to determine if a given node holds endpoints for this
    /// service or not.  If this field is specified when creating a Service
    /// which does not need it, creation will fail. This field will be wiped
    /// when updating a Service to no longer need it (e.g. changing type).
    /// This field cannot be updated once set.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "healthCheckNodePort")]
    pub health_check_node_port: Option<i32>,
    /// InternalTrafficPolicy describes how nodes distribute service traffic they
    /// receive on the ClusterIP. If set to "Local", the proxy will assume that pods
    /// only want to talk to endpoints of the service on the same node as the pod,
    /// dropping the traffic if there are no local endpoints. The default value,
    /// "Cluster", uses the standard behavior of routing to all endpoints evenly
    /// (possibly modified by topology and other features).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "internalTrafficPolicy")]
    pub internal_traffic_policy: Option<String>,
    /// IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this
    /// service. This field is usually assigned automatically based on cluster
    /// configuration and the ipFamilyPolicy field. If this field is specified
    /// manually, the requested family is available in the cluster,
    /// and ipFamilyPolicy allows it, it will be used; otherwise creation of
    /// the service will fail. This field is conditionally mutable: it allows
    /// for adding or removing a secondary IP family, but it does not allow
    /// changing the primary IP family of the Service. Valid values are "IPv4"
    /// and "IPv6".  This field only applies to Services of types ClusterIP,
    /// NodePort, and LoadBalancer, and does apply to "headless" services.
    /// This field will be wiped when updating a Service to type ExternalName.
    /// 
    /// 
    /// This field may hold a maximum of two entries (dual-stack families, in
    /// either order).  These families must correspond to the values of the
    /// clusterIPs field, if specified. Both clusterIPs and ipFamilies are
    /// governed by the ipFamilyPolicy field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ipFamilies")]
    pub ip_families: Option<Vec<String>>,
    /// IPFamilyPolicy represents the dual-stack-ness requested or required by
    /// this Service. If there is no value provided, then this field will be set
    /// to SingleStack. Services can be "SingleStack" (a single IP family),
    /// "PreferDualStack" (two IP families on dual-stack configured clusters or
    /// a single IP family on single-stack clusters), or "RequireDualStack"
    /// (two IP families on dual-stack configured clusters, otherwise fail). The
    /// ipFamilies and clusterIPs fields depend on the value of this field. This
    /// field will be wiped when updating a service to type ExternalName.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ipFamilyPolicy")]
    pub ip_family_policy: Option<String>,
    /// loadBalancerClass is the class of the load balancer implementation this Service belongs to.
    /// If specified, the value of this field must be a label-style identifier, with an optional prefix,
    /// e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users.
    /// This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load
    /// balancer implementation is used, today this is typically done through the cloud provider integration,
    /// but should apply for any default implementation. If set, it is assumed that a load balancer
    /// implementation is watching for Services with a matching class. Any default load balancer
    /// implementation (e.g. cloud providers) should ignore Services that set this field.
    /// This field can only be set when creating or updating a Service to type 'LoadBalancer'.
    /// Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerClass")]
    pub load_balancer_class: Option<String>,
    /// Only applies to Service Type: LoadBalancer.
    /// This feature depends on whether the underlying cloud-provider supports specifying
    /// the loadBalancerIP when a load balancer is created.
    /// This field will be ignored if the cloud-provider does not support the feature.
    /// Deprecated: This field was under-specified and its meaning varies across implementations.
    /// Using it is non-portable and it may not support dual-stack.
    /// Users are encouraged to use implementation-specific annotations when available.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerIP")]
    pub load_balancer_ip: Option<String>,
    /// If specified and supported by the platform, this will restrict traffic through the cloud-provider
    /// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
    /// cloud-provider does not support the feature."
    /// More info: <https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerSourceRanges")]
    pub load_balancer_source_ranges: Option<Vec<String>>,
    /// Supports "ClientIP" and "None". Used to maintain session affinity.
    /// Enable client IP based session affinity.
    /// Must be ClientIP or None.
    /// Defaults to None.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionAffinity")]
    pub session_affinity: Option<String>,
    /// sessionAffinityConfig contains the configurations of session affinity.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionAffinityConfig")]
    pub session_affinity_config: Option<CouchbaseClusterNetworkingAdminConsoleServiceTemplateSpecSessionAffinityConfig>,
    /// type determines how the Service is exposed. Defaults to ClusterIP. Valid
    /// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
    /// "ClusterIP" allocates a cluster-internal IP address for load-balancing
    /// to endpoints. Endpoints are determined by the selector or if that is not
    /// specified, by manual construction of an Endpoints object or
    /// EndpointSlice objects. If clusterIP is "None", no virtual IP is
    /// allocated and the endpoints are published as a set of endpoints rather
    /// than a virtual IP.
    /// "NodePort" builds on ClusterIP and allocates a port on every node which
    /// routes to the same endpoints as the clusterIP.
    /// "LoadBalancer" builds on NodePort and creates an external load-balancer
    /// (if supported in the current cloud) which routes to the same endpoints
    /// as the clusterIP.
    /// "ExternalName" aliases this service to the specified externalName.
    /// Several other fields do not apply to ExternalName services.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

/// sessionAffinityConfig contains the configurations of session affinity.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingAdminConsoleServiceTemplateSpecSessionAffinityConfig {
    /// clientIP contains the configurations of Client IP based session affinity.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientIP")]
    pub client_ip: Option<CouchbaseClusterNetworkingAdminConsoleServiceTemplateSpecSessionAffinityConfigClientIp>,
}

/// clientIP contains the configurations of Client IP based session affinity.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingAdminConsoleServiceTemplateSpecSessionAffinityConfigClientIp {
    /// timeoutSeconds specifies the seconds of ClientIP type session sticky time.
    /// The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP".
    /// Default value is 10800(for 3 hours).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
    pub timeout_seconds: Option<i32>,
}

/// Networking defines Couchbase cluster networking options such as network
/// topology, TLS and DDNS settings.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingAdminConsoleServiceType {
    NodePort,
    LoadBalancer,
}

/// CloudNativeGateway is used to provision a gRPC gateway proxying a Couchbase
/// cluster.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct CouchbaseClusterNetworkingCloudNativeGateway {
    /// Image is the Cloud Native Gateway image to be used to run the sidecar container.
    /// No validation is carried out as this can be any arbitrary repo and tag.
    pub image: String,
    /// DEVELOPER PREVIEW - This feature is in developer preview.
    /// LogLevel controls the verbosity of cloud native logs.  This field must be one of
    /// "fatal", "panic", "dpanic", "error", "warn", "info", "debug" defaulting to "info".
    #[serde(rename = "logLevel")]
    pub log_level: CouchbaseClusterNetworkingCloudNativeGatewayLogLevel,
    /// TerminationGracePeriodSeconds specifies the grace period for the container to
    /// terminate. Defaults to 75 seconds.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
    pub termination_grace_period_seconds: Option<i64>,
    /// TLS defines the TLS configuration for the Cloud Native Gateway server including
    /// server and client certificate configuration, and TLS security policies.
    /// If no TLS config are explicitly provided, the operator generates/manages self-signed certs/keys
    /// and creates a k8s secret named `couchbase-cloud-native-gateway-self-signed-secret-<cluster-name>`
    /// unique to a Couchbase cluster, which is volume mounted to the cb k8s pod.
    /// This action could be overidden at the outset or later, by using the below
    /// TLS config or generating the secret of same name as
    /// `couchbase-cloud-native-gateway-self-signed-secret-<cluster-name>` with certificates
    /// conforming to the keys of well-known type "kubernetes.io/tls" with "tls.crt" and "tls.key".
    /// N.B. The secret is on per cluster basis so it's advised to use the unique cluster name else
    /// would be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tls: Option<CouchbaseClusterNetworkingCloudNativeGatewayTls>,
}

/// CloudNativeGateway is used to provision a gRPC gateway proxying a Couchbase
/// cluster.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingCloudNativeGatewayLogLevel {
    #[serde(rename = "fatal")]
    Fatal,
    #[serde(rename = "panic")]
    Panic,
    #[serde(rename = "dpanic")]
    Dpanic,
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "warn")]
    Warn,
    #[serde(rename = "info")]
    Info,
    #[serde(rename = "debug")]
    Debug,
}

/// TLS defines the TLS configuration for the Cloud Native Gateway server including
/// server and client certificate configuration, and TLS security policies.
/// If no TLS config are explicitly provided, the operator generates/manages self-signed certs/keys
/// and creates a k8s secret named `couchbase-cloud-native-gateway-self-signed-secret-<cluster-name>`
/// unique to a Couchbase cluster, which is volume mounted to the cb k8s pod.
/// This action could be overidden at the outset or later, by using the below
/// TLS config or generating the secret of same name as
/// `couchbase-cloud-native-gateway-self-signed-secret-<cluster-name>` with certificates
/// conforming to the keys of well-known type "kubernetes.io/tls" with "tls.crt" and "tls.key".
/// N.B. The secret is on per cluster basis so it's advised to use the unique cluster name else
/// would be ignored.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingCloudNativeGatewayTls {
    /// ServerSecretName specifies the secret name, in the same namespace as the cluster,
    /// that contains Cloud Native Gateway gRPC server TLS data.
    /// The secret is expected to contain "tls.crt" and
    /// "tls.key" as per the kubernetes.io/tls secret type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverSecretName")]
    pub server_secret_name: Option<String>,
}

/// DNS defines information required for Dynamic DNS support.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingDns {
    /// Domain is the domain to create pods in.  When populated the Operator
    /// will annotate the admin console and per-pod services with the key
    /// "external-dns.alpha.kubernetes.io/hostname".  These annotations can
    /// be used directly by a Kubernetes External-DNS controller to replicate
    /// load balancer service IP addresses into a public DNS server.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub domain: Option<String>,
}

/// ExposedFeatureServiceTemplate provides a template used by the Operator to create
/// and manage per-pod services.  This allows services to be annotated, the
/// service type defined and any other options that Kubernetes provides.  When using
/// a LoadBalancer service type, TLS and dynamic DNS must also be enabled. The Operator
/// reserves the right to modify or replace any field.  More info:
/// <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#service-v1-core>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingExposedFeatureServiceTemplate {
    /// Standard objects metadata.  This is a curated version for use with Couchbase
    /// resource templates.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<CouchbaseClusterNetworkingExposedFeatureServiceTemplateMetadata>,
    /// ServiceSpec describes the attributes that a user creates on a service.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub spec: Option<CouchbaseClusterNetworkingExposedFeatureServiceTemplateSpec>,
}

/// Standard objects metadata.  This is a curated version for use with Couchbase
/// resource templates.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingExposedFeatureServiceTemplateMetadata {
    /// Annotations is an unstructured key value map stored with a resource that
    /// may be set by external tools to store and retrieve arbitrary metadata. They
    /// are not queryable and should be preserved when modifying objects. More
    /// info: <http://kubernetes.io/docs/user-guide/annotations>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services. More info: <http://kubernetes.io/docs/user-guide/labels>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// ServiceSpec describes the attributes that a user creates on a service.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingExposedFeatureServiceTemplateSpec {
    /// allocateLoadBalancerNodePorts defines if NodePorts will be automatically
    /// allocated for services with type LoadBalancer.  Default is "true". It
    /// may be set to "false" if the cluster load-balancer does not rely on
    /// NodePorts.  If the caller requests specific NodePorts (by specifying a
    /// value), those requests will be respected, regardless of this field.
    /// This field may only be set for services with type LoadBalancer and will
    /// be cleared if the type is changed to any other type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allocateLoadBalancerNodePorts")]
    pub allocate_load_balancer_node_ports: Option<bool>,
    /// clusterIP is the IP address of the service and is usually assigned
    /// randomly. If an address is specified manually, is in-range (as per
    /// system configuration), and is not in use, it will be allocated to the
    /// service; otherwise creation of the service will fail. This field may not
    /// be changed through updates unless the type field is also being changed
    /// to ExternalName (which requires this field to be blank) or the type
    /// field is being changed from ExternalName (in which case this field may
    /// optionally be specified, as describe above).  Valid values are "None",
    /// empty string (""), or a valid IP address. Setting this to "None" makes a
    /// "headless service" (no virtual IP), which is useful when direct endpoint
    /// connections are preferred and proxying is not required.  Only applies to
    /// types ClusterIP, NodePort, and LoadBalancer. If this field is specified
    /// when creating a Service of type ExternalName, creation will fail. This
    /// field will be wiped when updating a Service to type ExternalName.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterIP")]
    pub cluster_ip: Option<String>,
    /// ClusterIPs is a list of IP addresses assigned to this service, and are
    /// usually assigned randomly.  If an address is specified manually, is
    /// in-range (as per system configuration), and is not in use, it will be
    /// allocated to the service; otherwise creation of the service will fail.
    /// This field may not be changed through updates unless the type field is
    /// also being changed to ExternalName (which requires this field to be
    /// empty) or the type field is being changed from ExternalName (in which
    /// case this field may optionally be specified, as describe above).  Valid
    /// values are "None", empty string (""), or a valid IP address.  Setting
    /// this to "None" makes a "headless service" (no virtual IP), which is
    /// useful when direct endpoint connections are preferred and proxying is
    /// not required.  Only applies to types ClusterIP, NodePort, and
    /// LoadBalancer. If this field is specified when creating a Service of type
    /// ExternalName, creation will fail. This field will be wiped when updating
    /// a Service to type ExternalName.  If this field is not specified, it will
    /// be initialized from the clusterIP field.  If this field is specified,
    /// clients must ensure that clusterIPs[0] and clusterIP have the same
    /// value.
    /// 
    /// 
    /// This field may hold a maximum of two entries (dual-stack IPs, in either order).
    /// These IPs must correspond to the values of the ipFamilies field. Both
    /// clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterIPs")]
    pub cluster_i_ps: Option<Vec<String>>,
    /// externalIPs is a list of IP addresses for which nodes in the cluster
    /// will also accept traffic for this service.  These IPs are not managed by
    /// Kubernetes.  The user is responsible for ensuring that traffic arrives
    /// at a node with this IP.  A common example is external load-balancers
    /// that are not part of the Kubernetes system.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalIPs")]
    pub external_i_ps: Option<Vec<String>>,
    /// externalName is the external reference that discovery mechanisms will
    /// return as an alias for this service (e.g. a DNS CNAME record). No
    /// proxying will be involved.  Must be a lowercase RFC-1123 hostname
    /// (<https://tools.ietf.org/html/rfc1123)> and requires `type` to be "ExternalName".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalName")]
    pub external_name: Option<String>,
    /// externalTrafficPolicy describes how nodes distribute service traffic they
    /// receive on one of the Service's "externally-facing" addresses (NodePorts,
    /// ExternalIPs, and LoadBalancer IPs). If set to "Local", the proxy will configure
    /// the service in a way that assumes that external load balancers will take care
    /// of balancing the service traffic between nodes, and so each node will deliver
    /// traffic only to the node-local endpoints of the service, without masquerading
    /// the client source IP. (Traffic mistakenly sent to a node with no endpoints will
    /// be dropped.) The default value, "Cluster", uses the standard behavior of
    /// routing to all endpoints evenly (possibly modified by topology and other
    /// features). Note that traffic sent to an External IP or LoadBalancer IP from
    /// within the cluster will always get "Cluster" semantics, but clients sending to
    /// a NodePort from within the cluster may need to take traffic policy into account
    /// when picking a node.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalTrafficPolicy")]
    pub external_traffic_policy: Option<String>,
    /// healthCheckNodePort specifies the healthcheck nodePort for the service.
    /// This only applies when type is set to LoadBalancer and
    /// externalTrafficPolicy is set to Local. If a value is specified, is
    /// in-range, and is not in use, it will be used.  If not specified, a value
    /// will be automatically allocated.  External systems (e.g. load-balancers)
    /// can use this port to determine if a given node holds endpoints for this
    /// service or not.  If this field is specified when creating a Service
    /// which does not need it, creation will fail. This field will be wiped
    /// when updating a Service to no longer need it (e.g. changing type).
    /// This field cannot be updated once set.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "healthCheckNodePort")]
    pub health_check_node_port: Option<i32>,
    /// InternalTrafficPolicy describes how nodes distribute service traffic they
    /// receive on the ClusterIP. If set to "Local", the proxy will assume that pods
    /// only want to talk to endpoints of the service on the same node as the pod,
    /// dropping the traffic if there are no local endpoints. The default value,
    /// "Cluster", uses the standard behavior of routing to all endpoints evenly
    /// (possibly modified by topology and other features).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "internalTrafficPolicy")]
    pub internal_traffic_policy: Option<String>,
    /// IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this
    /// service. This field is usually assigned automatically based on cluster
    /// configuration and the ipFamilyPolicy field. If this field is specified
    /// manually, the requested family is available in the cluster,
    /// and ipFamilyPolicy allows it, it will be used; otherwise creation of
    /// the service will fail. This field is conditionally mutable: it allows
    /// for adding or removing a secondary IP family, but it does not allow
    /// changing the primary IP family of the Service. Valid values are "IPv4"
    /// and "IPv6".  This field only applies to Services of types ClusterIP,
    /// NodePort, and LoadBalancer, and does apply to "headless" services.
    /// This field will be wiped when updating a Service to type ExternalName.
    /// 
    /// 
    /// This field may hold a maximum of two entries (dual-stack families, in
    /// either order).  These families must correspond to the values of the
    /// clusterIPs field, if specified. Both clusterIPs and ipFamilies are
    /// governed by the ipFamilyPolicy field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ipFamilies")]
    pub ip_families: Option<Vec<String>>,
    /// IPFamilyPolicy represents the dual-stack-ness requested or required by
    /// this Service. If there is no value provided, then this field will be set
    /// to SingleStack. Services can be "SingleStack" (a single IP family),
    /// "PreferDualStack" (two IP families on dual-stack configured clusters or
    /// a single IP family on single-stack clusters), or "RequireDualStack"
    /// (two IP families on dual-stack configured clusters, otherwise fail). The
    /// ipFamilies and clusterIPs fields depend on the value of this field. This
    /// field will be wiped when updating a service to type ExternalName.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ipFamilyPolicy")]
    pub ip_family_policy: Option<String>,
    /// loadBalancerClass is the class of the load balancer implementation this Service belongs to.
    /// If specified, the value of this field must be a label-style identifier, with an optional prefix,
    /// e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users.
    /// This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load
    /// balancer implementation is used, today this is typically done through the cloud provider integration,
    /// but should apply for any default implementation. If set, it is assumed that a load balancer
    /// implementation is watching for Services with a matching class. Any default load balancer
    /// implementation (e.g. cloud providers) should ignore Services that set this field.
    /// This field can only be set when creating or updating a Service to type 'LoadBalancer'.
    /// Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerClass")]
    pub load_balancer_class: Option<String>,
    /// Only applies to Service Type: LoadBalancer.
    /// This feature depends on whether the underlying cloud-provider supports specifying
    /// the loadBalancerIP when a load balancer is created.
    /// This field will be ignored if the cloud-provider does not support the feature.
    /// Deprecated: This field was under-specified and its meaning varies across implementations.
    /// Using it is non-portable and it may not support dual-stack.
    /// Users are encouraged to use implementation-specific annotations when available.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerIP")]
    pub load_balancer_ip: Option<String>,
    /// If specified and supported by the platform, this will restrict traffic through the cloud-provider
    /// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
    /// cloud-provider does not support the feature."
    /// More info: <https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerSourceRanges")]
    pub load_balancer_source_ranges: Option<Vec<String>>,
    /// Supports "ClientIP" and "None". Used to maintain session affinity.
    /// Enable client IP based session affinity.
    /// Must be ClientIP or None.
    /// Defaults to None.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionAffinity")]
    pub session_affinity: Option<String>,
    /// sessionAffinityConfig contains the configurations of session affinity.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionAffinityConfig")]
    pub session_affinity_config: Option<CouchbaseClusterNetworkingExposedFeatureServiceTemplateSpecSessionAffinityConfig>,
    /// type determines how the Service is exposed. Defaults to ClusterIP. Valid
    /// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
    /// "ClusterIP" allocates a cluster-internal IP address for load-balancing
    /// to endpoints. Endpoints are determined by the selector or if that is not
    /// specified, by manual construction of an Endpoints object or
    /// EndpointSlice objects. If clusterIP is "None", no virtual IP is
    /// allocated and the endpoints are published as a set of endpoints rather
    /// than a virtual IP.
    /// "NodePort" builds on ClusterIP and allocates a port on every node which
    /// routes to the same endpoints as the clusterIP.
    /// "LoadBalancer" builds on NodePort and creates an external load-balancer
    /// (if supported in the current cloud) which routes to the same endpoints
    /// as the clusterIP.
    /// "ExternalName" aliases this service to the specified externalName.
    /// Several other fields do not apply to ExternalName services.
    /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

/// sessionAffinityConfig contains the configurations of session affinity.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingExposedFeatureServiceTemplateSpecSessionAffinityConfig {
    /// clientIP contains the configurations of Client IP based session affinity.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientIP")]
    pub client_ip: Option<CouchbaseClusterNetworkingExposedFeatureServiceTemplateSpecSessionAffinityConfigClientIp>,
}

/// clientIP contains the configurations of Client IP based session affinity.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingExposedFeatureServiceTemplateSpecSessionAffinityConfigClientIp {
    /// timeoutSeconds specifies the seconds of ClientIP type session sticky time.
    /// The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP".
    /// Default value is 10800(for 3 hours).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
    pub timeout_seconds: Option<i32>,
}

/// Networking defines Couchbase cluster networking options such as network
/// topology, TLS and DDNS settings.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingExposedFeatureServiceType {
    NodePort,
    LoadBalancer,
}

/// Networking defines Couchbase cluster networking options such as network
/// topology, TLS and DDNS settings.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingExposedFeatureTrafficPolicy {
    Cluster,
    Local,
}

/// Networking defines Couchbase cluster networking options such as network
/// topology, TLS and DDNS settings.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingNetworkPlatform {
    Istio,
}

/// TLS defines the TLS configuration for the cluster including
/// server and client certificate configuration, and TLS security policies.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTls {
    /// AllowPlainTextCertReload allows the reload of TLS certificates in plain text.
    /// This option should only be enabled as a means to recover connectivity with
    /// server in the event that any of the server certificates expire. When enabled
    /// the Operator only attempts plain text cert reloading when expired certificates
    /// are detected.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowPlainTextCertReload")]
    pub allow_plain_text_cert_reload: Option<bool>,
    /// CipherSuites specifies a list of cipher suites for Couchbase server to select
    /// from when negotiating TLS handshakes with a client.  Suites are not validated
    /// by the Operator.  Run "openssl ciphers -v" in a Couchbase server pod to
    /// interrogate supported values.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cipherSuites")]
    pub cipher_suites: Option<Vec<String>>,
    /// ClientCertificatePaths defines where to look in client certificates in order
    /// to extract the user name.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientCertificatePaths")]
    pub client_certificate_paths: Option<Vec<CouchbaseClusterNetworkingTlsClientCertificatePaths>>,
    /// ClientCertificatePolicy defines the client authentication policy to use.
    /// If set, the Operator expects TLS configuration to contain a valid certificate/key pair
    /// for the Administrator account.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientCertificatePolicy")]
    pub client_certificate_policy: Option<CouchbaseClusterNetworkingTlsClientCertificatePolicy>,
    /// NodeToNodeEncryption specifies whether to encrypt data between Couchbase nodes
    /// within the same cluster.  This may come at the expense of performance.  When
    /// control plane only encryption is used, only cluster management traffic is encrypted
    /// between nodes.  When all, all traffic is encrypted, including database documents.
    /// When strict mode is used, it is the same as all, but also disables all plaintext
    /// ports.  Strict mode is only available on Couchbase Server versions 7.1 and greater.
    /// Node to node encryption can only be used when TLS certificates are managed by the
    /// Operator.  This field must be either "ControlPlaneOnly", "All", or "Strict".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeToNodeEncryption")]
    pub node_to_node_encryption: Option<CouchbaseClusterNetworkingTlsNodeToNodeEncryption>,
    /// PassphraseConfig configures the passphrase key to use with encrypted certificates.
    /// The passphrase may be registered with Couchbase Server using a local script or a
    /// rest endpoint. Private key encryption is only available on Couchbase Server
    /// versions 7.1 and greater.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub passphrase: Option<CouchbaseClusterNetworkingTlsPassphrase>,
    /// RootCAs defines a set of secrets that reside in this namespace that contain
    /// additional CA certificates that should be installed in Couchbase.  The CA
    /// certificates that are defined here are in addition to those defined for the
    /// cluster, optionally by couchbaseclusters.spec.networking.tls.secretSource, and
    /// thus should not be duplicated.  Each Secret referred to must be of well-known type
    /// "kubernetes.io/tls" and must contain one or more CA certificates under the key "tls.crt".
    /// Multiple root CA certificates are only supported on Couchbase Server 7.1 and greater,
    /// and not with legacy couchbaseclusters.spec.networking.tls.static configuration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "rootCAs")]
    pub root_c_as: Option<Vec<String>>,
    /// SecretSource enables the user to specify a secret conforming to the Kubernetes TLS
    /// secret specification that is used for the Couchbase server certificate, and optionally
    /// the Operator's client certificate, providing cert-manager compatibility without having
    /// to specify a separate root CA.  A server CA certificate must be supplied by one of the
    /// provided methods. Certificates referred to must conform to the keys of well-known type
    /// "kubernetes.io/tls" with "tls.crt" and "tls.key". If the "tls.key" is an encrypted
    /// private key then the secret type can be the generic Opaque type since "kubernetes.io/tls"
    /// type secrets cannot verify encrypted keys.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretSource")]
    pub secret_source: Option<CouchbaseClusterNetworkingTlsSecretSource>,
    /// DEPRECATED - by couchbaseclusters.spec.networking.tls.secretSource.
    /// Static enables user to generate static x509 certificates and keys,
    /// put them into Kubernetes secrets, and specify them here.  Static secrets
    /// are Couchbase specific, and follow no well-known standards.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "static")]
    pub r#static: Option<CouchbaseClusterNetworkingTlsStatic>,
    /// TLSMinimumVersion specifies the minimum TLS version the Couchbase server can
    /// negotiate with a client.  Must be one of TLS1.0, TLS1.1 TLS1.2 or TLS1.3,
    /// defaulting to TLS1.2.  TLS1.3 is only valid for Couchbase Server 7.1.0 onward.
    /// TLS1.0 and TLS1.1 are not valid for Couchbase Server 7.6.0 onward.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tlsMinimumVersion")]
    pub tls_minimum_version: Option<CouchbaseClusterNetworkingTlsTlsMinimumVersion>,
}

/// ClientCertificatePath defines how to extract a username from a client ceritficate.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTlsClientCertificatePaths {
    /// Delimiter if specified allows a suffix to be stripped from the username, once
    /// extracted from the certificate path.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub delimiter: Option<String>,
    /// Path defines where in the X.509 specification to extract the username from.
    /// This field must be either "subject.cn", "san.uri", "san.dnsname" or  "san.email".
    pub path: String,
    /// Prefix allows a prefix to be stripped from the username, once extracted from the
    /// certificate path.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,
}

/// TLS defines the TLS configuration for the cluster including
/// server and client certificate configuration, and TLS security policies.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingTlsClientCertificatePolicy {
    #[serde(rename = "enable")]
    Enable,
    #[serde(rename = "mandatory")]
    Mandatory,
}

/// TLS defines the TLS configuration for the cluster including
/// server and client certificate configuration, and TLS security policies.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingTlsNodeToNodeEncryption {
    ControlPlaneOnly,
    All,
    Strict,
}

/// PassphraseConfig configures the passphrase key to use with encrypted certificates.
/// The passphrase may be registered with Couchbase Server using a local script or a
/// rest endpoint. Private key encryption is only available on Couchbase Server
/// versions 7.1 and greater.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTlsPassphrase {
    /// PassphraseRestConfig is the configuration to register a private key passphrase with a rest endpoint.
    /// When the private key is accessed, Couchbase Server attempts to extract the password by means of the
    /// specified endpoint. The response status must be 200 and the response text must be the exact passphrase
    /// excluding newlines and extraneous spaces.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rest: Option<CouchbaseClusterNetworkingTlsPassphraseRest>,
    /// PassphraseScriptConfig is the configuration to register a private key passphrase with a script.
    /// The Operator auto-provisions the underlying script so this config simply provides a mechanism
    /// to perform the decryption of the Couchbase Private Key using a local script.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub script: Option<CouchbaseClusterNetworkingTlsPassphraseScript>,
}

/// PassphraseRestConfig is the configuration to register a private key passphrase with a rest endpoint.
/// When the private key is accessed, Couchbase Server attempts to extract the password by means of the
/// specified endpoint. The response status must be 200 and the response text must be the exact passphrase
/// excluding newlines and extraneous spaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTlsPassphraseRest {
    /// AddressFamily is the address family to use. By default inet (meaning IPV4) is used.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "addressFamily")]
    pub address_family: Option<CouchbaseClusterNetworkingTlsPassphraseRestAddressFamily>,
    /// Headers is a map of one or more key-value pairs to pass alongside the Get request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub headers: Option<BTreeMap<String, String>>,
    /// Timeout is  the number of milliseconds that must elapse before the call is timed out.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<i64>,
    /// URL is the endpoint to be called to retrieve the passphrase.
    /// URL will be called using the GET method and may use http/https protocol.
    pub url: String,
    /// VerifyPeer ensures peer verification is performed when Https is used.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "verifyPeer")]
    pub verify_peer: Option<bool>,
}

/// PassphraseRestConfig is the configuration to register a private key passphrase with a rest endpoint.
/// When the private key is accessed, Couchbase Server attempts to extract the password by means of the
/// specified endpoint. The response status must be 200 and the response text must be the exact passphrase
/// excluding newlines and extraneous spaces.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingTlsPassphraseRestAddressFamily {
    #[serde(rename = "inet")]
    Inet,
    #[serde(rename = "inet6")]
    Inet6,
}

/// PassphraseScriptConfig is the configuration to register a private key passphrase with a script.
/// The Operator auto-provisions the underlying script so this config simply provides a mechanism
/// to perform the decryption of the Couchbase Private Key using a local script.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTlsPassphraseScript {
    /// Secret is the secret containing the passphrase string. The secret is expected
    /// to contain "passphrase" key with the passphrase string as a value.
    pub secret: String,
}

/// SecretSource enables the user to specify a secret conforming to the Kubernetes TLS
/// secret specification that is used for the Couchbase server certificate, and optionally
/// the Operator's client certificate, providing cert-manager compatibility without having
/// to specify a separate root CA.  A server CA certificate must be supplied by one of the
/// provided methods. Certificates referred to must conform to the keys of well-known type
/// "kubernetes.io/tls" with "tls.crt" and "tls.key". If the "tls.key" is an encrypted
/// private key then the secret type can be the generic Opaque type since "kubernetes.io/tls"
/// type secrets cannot verify encrypted keys.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTlsSecretSource {
    /// ClientSecretName specifies the secret name, in the same namespace as the cluster,
    /// the contains client TLS data.  The secret is expected to contain "tls.crt" and
    /// "tls.key" as per the Kubernetes.io/tls secret type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientSecretName")]
    pub client_secret_name: Option<String>,
    /// ServerSecretName specifies the secret name, in the same namespace as the cluster,
    /// that contains server TLS data.  The secret is expected to contain "tls.crt" and
    /// "tls.key" as per the kubernetes.io/tls secret type.  It may also contain "ca.crt".
    /// Only a single PEM formated x509 certificate can be provided to "ca.crt".
    /// The single certificate may also bundle together multiple root CA certificates.
    /// Multiple root CA certificates are only supported on Couchbase Server 7.1 and greater.
    #[serde(rename = "serverSecretName")]
    pub server_secret_name: String,
}

/// DEPRECATED - by couchbaseclusters.spec.networking.tls.secretSource.
/// Static enables user to generate static x509 certificates and keys,
/// put them into Kubernetes secrets, and specify them here.  Static secrets
/// are Couchbase specific, and follow no well-known standards.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterNetworkingTlsStatic {
    /// OperatorSecret is a secret name containing TLS certs used by operator to
    /// talk securely to this cluster.  The secret must contain a CA certificate (data key
    /// ca.crt).  If client authentication is enabled, then the secret must also contain
    /// a client certificate chain (data key "couchbase-operator.crt") and private key
    /// (data key "couchbase-operator.key").
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "operatorSecret")]
    pub operator_secret: Option<String>,
    /// ServerSecret is a secret name containing TLS certs used by each Couchbase member pod
    /// for the communication between Couchbase server and its clients.  The secret must
    /// contain a certificate chain (data key "chain.pem") and a private
    /// key (data key "pkey.key").  The private key must be in the PKCS#1 RSA
    /// format.  The certificate chain must have a required set of X.509v3 subject alternative
    /// names for all cluster addressing modes.  See the Operator TLS documentation for more
    /// information.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverSecret")]
    pub server_secret: Option<String>,
}

/// TLS defines the TLS configuration for the cluster including
/// server and client certificate configuration, and TLS security policies.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterNetworkingTlsTlsMinimumVersion {
    #[serde(rename = "TLS1.0")]
    Tls10,
    #[serde(rename = "TLS1.1")]
    Tls11,
    #[serde(rename = "TLS1.2")]
    Tls12,
    #[serde(rename = "TLS1.3")]
    Tls13,
}

/// ClusterSpec is the specification for a CouchbaseCluster resources, and allows
/// the cluster to be customized.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterPlatform {
    #[serde(rename = "aws")]
    Aws,
    #[serde(rename = "gce")]
    Gce,
    #[serde(rename = "azure")]
    Azure,
}

/// ClusterSpec is the specification for a CouchbaseCluster resources, and allows
/// the cluster to be customized.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterRecoveryPolicy {
    PrioritizeDataIntegrity,
    PrioritizeUptime,
}

/// When `spec.upgradeStrategy` is set to `RollingUpgrade` it will, by default, upgrade one pod
/// at a time.  If this field is specified then that number can be increased.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterRollingUpgrade {
    /// MaxUpgradable allows the number of pods affected by an upgrade at any
    /// one time to be increased.  By default a rolling upgrade will
    /// upgrade one pod at a time.  This field allows that limit to be removed.
    /// This field must be greater than zero.
    /// The smallest of `maxUpgradable` and `maxUpgradablePercent` takes precedence if
    /// both are defined.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxUpgradable")]
    pub max_upgradable: Option<i64>,
    /// MaxUpgradablePercent allows the number of pods affected by an upgrade at any
    /// one time to be increased.  By default a rolling upgrade will
    /// upgrade one pod at a time.  This field allows that limit to be removed.
    /// This field must be an integer percentage, e.g. "10%", in the range 1% to 100%.
    /// Percentages are relative to the total cluster size, and rounded down to
    /// the nearest whole number, with a minimum of 1.  For example, a 10 pod
    /// cluster, and 25% allowed to upgrade, would yield 2.5 pods per iteration,
    /// rounded down to 2.
    /// The smallest of `maxUpgradable` and `maxUpgradablePercent` takes precedence if
    /// both are defined.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxUpgradablePercent")]
    pub max_upgradable_percent: Option<String>,
}

/// Security defines Couchbase cluster security options such as the administrator
/// account username and password, and user RBAC settings.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurity {
    /// AdminSecret is the name of a Kubernetes secret to use for administrator authentication.
    /// The admin secret must contain the keys "username" and "password".  The password data
    /// must be at least 6 characters in length, and not contain the any of the characters
    /// `()<>,;:\"/[]?={}`.
    #[serde(rename = "adminSecret")]
    pub admin_secret: String,
    /// LDAP provides settings to authenticate and authorize LDAP users with Couchbase Server.
    /// When specified, the Operator keeps these settings in sync with Cocuhbase Server's
    /// LDAP configuration. Leave empty to manually manage LDAP configuration.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ldap: Option<CouchbaseClusterSecurityLdap>,
    /// PodSecurityContext allows the configuration of the security context for all
    /// Couchbase server pods.  When using persistent volumes you may need to set
    /// the fsGroup field in order to write to the volume.  For non-root clusters
    /// you must also set runAsUser to 1000, corresponding to the Couchbase user
    /// in official container images.  More info:
    /// <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "podSecurityContext")]
    pub pod_security_context: Option<CouchbaseClusterSecurityPodSecurityContext>,
    /// RBAC is the options provided for enabling and selecting RBAC User resources to manage.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rbac: Option<CouchbaseClusterSecurityRbac>,
    /// SecurityContext defines the security options the container should be run with.
    /// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
    /// Use securityContext.allowPrivilegeEscalation field to grant more privileges than its parent process.
    /// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityContext")]
    pub security_context: Option<CouchbaseClusterSecuritySecurityContext>,
    /// UISessionTimeout sets how long, in minutes, before a user is declared inactive
    /// and signed out from the Couchbase Server UI.
    /// 0 represents no time out.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "uiSessionTimeout")]
    pub ui_session_timeout: Option<i64>,
}

/// LDAP provides settings to authenticate and authorize LDAP users with Couchbase Server.
/// When specified, the Operator keeps these settings in sync with Cocuhbase Server's
/// LDAP configuration. Leave empty to manually manage LDAP configuration.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityLdap {
    /// AuthenticationEnabled allows users who attempt to access Couchbase Server without having been
    /// added as local users to be authenticated against the specified LDAP Host(s).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "authenticationEnabled")]
    pub authentication_enabled: Option<bool>,
    /// AuthorizationEnabled allows authenticated LDAP users to be authorized with RBAC roles granted to
    /// any Couchbase Server group associated with the user.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "authorizationEnabled")]
    pub authorization_enabled: Option<bool>,
    /// DN to use for searching users and groups synchronization. More info:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bindDN")]
    pub bind_dn: Option<String>,
    /// BindSecret is the name of a Kubernetes secret to use containing password for LDAP user binding.
    /// The bindSecret must have a key with the name "password" and a value which corresponds to the
    /// password of the binding LDAP user.
    #[serde(rename = "bindSecret")]
    pub bind_secret: String,
    /// DEPRECATED - Field is ignored, use tlsSecret.
    /// CA Certificate in PEM format to be used in LDAP server certificate validation.
    /// This cert is the string form of the secret provided to `spec.tls.tlsSecret`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cacert: Option<String>,
    /// Lifetime of values in cache in milliseconds. Default 300000 ms.  More info:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cacheValueLifetime")]
    pub cache_value_lifetime: Option<i64>,
    /// Encryption determines how the connection with the LDAP server should be encrypted.
    /// Encryption may set as either StartTLSExtension, TLS, or false.
    /// When set to "false" then no verification of the LDAP hostname is performed.
    /// When Encryption is StartTLSExtension, or TLS is set then the default behavior is to
    /// use the certificate already loaded into the Couchbase Cluster for certificate validation,
    /// otherwise `ldap.tlsSecret` may be set to override The Couchbase certificate.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption: Option<CouchbaseClusterSecurityLdapEncryption>,
    /// LDAP query, to get the users' groups by username in RFC4516 format.  More info:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "groupsQuery")]
    pub groups_query: Option<String>,
    /// List of LDAP hosts to provide authentication-support for Couchbase Server.
    /// Host name must be a valid IP address or DNS Name e.g openldap.default.svc, 10.0.92.147.
    pub hosts: Vec<String>,
    /// Sets middlebox compatibility mode for LDAP. This option is only available on
    /// Couchbase Server 7.6.0+.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "middleboxCompMode")]
    pub middlebox_comp_mode: Option<bool>,
    /// If enabled Couchbase server will try to recursively search for groups
    /// for every discovered ldap group. groups_query will be user for the search.
    /// More info:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nestedGroupsEnabled")]
    pub nested_groups_enabled: Option<bool>,
    /// Maximum number of recursive groups requests the server is allowed to perform.
    /// Requires NestedGroupsEnabled.  Values between 1 and 100: the default is 10.
    /// More info:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nestedGroupsMaxDepth")]
    pub nested_groups_max_depth: Option<i64>,
    /// LDAP port.
    /// This is typically 389 for LDAP, and 636 for LDAPS.
    pub port: i64,
    /// Whether server certificate validation be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverCertValidation")]
    pub server_cert_validation: Option<bool>,
    /// TLSSecret is the name of a Kubernetes secret to use explcitly for LDAP ca cert.
    /// If TLSSecret is not provided, certificates found in `couchbaseclusters.spec.networking.tls.rootCAs`
    /// will be used instead.
    /// If provided, the secret must contain the ca to be used under the name "ca.crt".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tlsSecret")]
    pub tls_secret: Option<String>,
    /// User to distinguished name (DN) mapping. If none is specified,
    /// the username is used as the user’s distinguished name.  More info:
    /// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "userDNMapping")]
    pub user_dn_mapping: Option<CouchbaseClusterSecurityLdapUserDnMapping>,
}

/// LDAP provides settings to authenticate and authorize LDAP users with Couchbase Server.
/// When specified, the Operator keeps these settings in sync with Cocuhbase Server's
/// LDAP configuration. Leave empty to manually manage LDAP configuration.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterSecurityLdapEncryption {
    None,
    #[serde(rename = "StartTLSExtension")]
    StartTlsExtension,
    #[serde(rename = "TLS")]
    Tls,
}

/// User to distinguished name (DN) mapping. If none is specified,
/// the username is used as the user’s distinguished name.  More info:
/// <https://docs.couchbase.com/server/current/manage/manage-security/configure-ldap.html>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityLdapUserDnMapping {
    /// Query is the LDAP query to run to map from Couchbase user to LDAP distinguished name.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub query: Option<String>,
    /// This field specifies list of templates to use for providing username to DN mapping.
    /// The template may contain a placeholder specified as `%u` to represent the Couchbase
    /// user who is attempting to gain access.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub template: Option<String>,
}

/// PodSecurityContext allows the configuration of the security context for all
/// Couchbase server pods.  When using persistent volumes you may need to set
/// the fsGroup field in order to write to the volume.  For non-root clusters
/// you must also set runAsUser to 1000, corresponding to the Couchbase user
/// in official container images.  More info:
/// <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityPodSecurityContext {
    /// A special supplemental group that applies to all containers in a pod.
    /// Some volume types allow the Kubelet to change the ownership of that volume
    /// to be owned by the pod:
    /// 
    /// 
    /// 1. The owning GID will be the FSGroup
    /// 2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
    /// 3. The permission bits are OR'd with rw-rw----
    /// 
    /// 
    /// If unset, the Kubelet will not modify the ownership and permissions of any volume.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsGroup")]
    pub fs_group: Option<i64>,
    /// fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
    /// before being exposed inside Pod. This field will only apply to
    /// volume types which support fsGroup based ownership(and permissions).
    /// It will have no effect on ephemeral volume types such as: secret, configmaps
    /// and emptydir.
    /// Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsGroupChangePolicy")]
    pub fs_group_change_policy: Option<String>,
    /// The GID to run the entrypoint of the container process.
    /// Uses runtime default if unset.
    /// May also be set in SecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence
    /// for that container.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
    pub run_as_group: Option<i64>,
    /// Indicates that the container must run as a non-root user.
    /// If true, the Kubelet will validate the image at runtime to ensure that it
    /// does not run as UID 0 (root) and fail to start the container if it does.
    /// If unset or false, no such validation will be performed.
    /// May also be set in SecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
    pub run_as_non_root: Option<bool>,
    /// The UID to run the entrypoint of the container process.
    /// Defaults to user specified in image metadata if unspecified.
    /// May also be set in SecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence
    /// for that container.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
    pub run_as_user: Option<i64>,
    /// The SELinux context to be applied to all containers.
    /// If unspecified, the container runtime will allocate a random SELinux context for each
    /// container.  May also be set in SecurityContext.  If set in
    /// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
    /// takes precedence for that container.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
    pub se_linux_options: Option<CouchbaseClusterSecurityPodSecurityContextSeLinuxOptions>,
    /// The seccomp options to use by the containers in this pod.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
    pub seccomp_profile: Option<CouchbaseClusterSecurityPodSecurityContextSeccompProfile>,
    /// A list of groups applied to the first process run in each container, in addition
    /// to the container's primary GID, the fsGroup (if specified), and group memberships
    /// defined in the container image for the uid of the container process. If unspecified,
    /// no additional groups are added to any container. Note that group memberships
    /// defined in the container image for the uid of the container process are still effective,
    /// even if they are not included in this list.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "supplementalGroups")]
    pub supplemental_groups: Option<Vec<i64>>,
    /// Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
    /// sysctls (by the container runtime) might fail to launch.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sysctls: Option<Vec<CouchbaseClusterSecurityPodSecurityContextSysctls>>,
    /// The Windows specific settings applied to all containers.
    /// If unspecified, the options within a container's SecurityContext will be used.
    /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
    /// Note that this field cannot be set when spec.os.name is linux.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
    pub windows_options: Option<CouchbaseClusterSecurityPodSecurityContextWindowsOptions>,
}

/// The SELinux context to be applied to all containers.
/// If unspecified, the container runtime will allocate a random SELinux context for each
/// container.  May also be set in SecurityContext.  If set in
/// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
/// takes precedence for that container.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityPodSecurityContextSeLinuxOptions {
    /// Level is SELinux level label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub level: Option<String>,
    /// Role is a SELinux role label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Type is a SELinux type label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    /// User is a SELinux user label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
}

/// The seccomp options to use by the containers in this pod.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityPodSecurityContextSeccompProfile {
    /// localhostProfile indicates a profile defined in a file on the node should be used.
    /// The profile must be preconfigured on the node to work.
    /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
    /// Must be set if type is "Localhost". Must NOT be set for any other type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
    pub localhost_profile: Option<String>,
    /// type indicates which kind of seccomp profile will be applied.
    /// Valid options are:
    /// 
    /// 
    /// Localhost - a profile defined in a file on the node should be used.
    /// RuntimeDefault - the container runtime default profile should be used.
    /// Unconfined - no profile should be applied.
    #[serde(rename = "type")]
    pub r#type: String,
}

/// Sysctl defines a kernel parameter to be set
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityPodSecurityContextSysctls {
    /// Name of a property to set
    pub name: String,
    /// Value of a property to set
    pub value: String,
}

/// The Windows specific settings applied to all containers.
/// If unspecified, the options within a container's SecurityContext will be used.
/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
/// Note that this field cannot be set when spec.os.name is linux.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityPodSecurityContextWindowsOptions {
    /// GMSACredentialSpec is where the GMSA admission webhook
    /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
    /// GMSA credential spec named by the GMSACredentialSpecName field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
    pub gmsa_credential_spec: Option<String>,
    /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
    pub gmsa_credential_spec_name: Option<String>,
    /// HostProcess determines if a container should be run as a 'Host Process' container.
    /// All of a Pod's containers must have the same effective HostProcess value
    /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
    /// In addition, if HostProcess is true then HostNetwork must also be set to true.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
    pub host_process: Option<bool>,
    /// The UserName in Windows to run the entrypoint of the container process.
    /// Defaults to the user specified in image metadata if unspecified.
    /// May also be set in PodSecurityContext. If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
    pub run_as_user_name: Option<String>,
}

/// RBAC is the options provided for enabling and selecting RBAC User resources to manage.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityRbac {
    /// Managed defines whether RBAC is managed by us or the clients.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// Selector is a label selector used to list RBAC resources in the namespace
    /// that are managed by the Operator.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<CouchbaseClusterSecurityRbacSelector>,
}

/// Selector is a label selector used to list RBAC resources in the namespace
/// that are managed by the Operator.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityRbacSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterSecurityRbacSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityRbacSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// SecurityContext defines the security options the container should be run with.
/// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
/// Use securityContext.allowPrivilegeEscalation field to grant more privileges than its parent process.
/// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecuritySecurityContext {
    /// AllowPrivilegeEscalation controls whether a process can gain more
    /// privileges than its parent process. This bool directly controls if
    /// the no_new_privs flag will be set on the container process.
    /// AllowPrivilegeEscalation is true always when the container is:
    /// 1) run as Privileged
    /// 2) has CAP_SYS_ADMIN
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowPrivilegeEscalation")]
    pub allow_privilege_escalation: Option<bool>,
    /// The capabilities to add/drop when running containers.
    /// Defaults to the default set of capabilities granted by the container runtime.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub capabilities: Option<CouchbaseClusterSecuritySecurityContextCapabilities>,
    /// Run container in privileged mode.
    /// Processes in privileged containers are essentially equivalent to root on the host.
    /// Defaults to false.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub privileged: Option<bool>,
    /// procMount denotes the type of proc mount to use for the containers.
    /// The default is DefaultProcMount which uses the container runtime defaults for
    /// readonly paths and masked paths.
    /// This requires the ProcMountType feature flag to be enabled.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "procMount")]
    pub proc_mount: Option<String>,
    /// Whether this container has a read-only root filesystem.
    /// Default is false.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnlyRootFilesystem")]
    pub read_only_root_filesystem: Option<bool>,
    /// The GID to run the entrypoint of the container process.
    /// Uses runtime default if unset.
    /// May also be set in PodSecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
    pub run_as_group: Option<i64>,
    /// Indicates that the container must run as a non-root user.
    /// If true, the Kubelet will validate the image at runtime to ensure that it
    /// does not run as UID 0 (root) and fail to start the container if it does.
    /// If unset or false, no such validation will be performed.
    /// May also be set in PodSecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
    pub run_as_non_root: Option<bool>,
    /// The UID to run the entrypoint of the container process.
    /// Defaults to user specified in image metadata if unspecified.
    /// May also be set in PodSecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
    pub run_as_user: Option<i64>,
    /// The SELinux context to be applied to the container.
    /// If unspecified, the container runtime will allocate a random SELinux context for each
    /// container.  May also be set in PodSecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
    pub se_linux_options: Option<CouchbaseClusterSecuritySecurityContextSeLinuxOptions>,
    /// The seccomp options to use by this container. If seccomp options are
    /// provided at both the pod & container level, the container options
    /// override the pod options.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
    pub seccomp_profile: Option<CouchbaseClusterSecuritySecurityContextSeccompProfile>,
    /// The Windows specific settings applied to all containers.
    /// If unspecified, the options from the PodSecurityContext will be used.
    /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
    /// Note that this field cannot be set when spec.os.name is linux.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
    pub windows_options: Option<CouchbaseClusterSecuritySecurityContextWindowsOptions>,
}

/// The capabilities to add/drop when running containers.
/// Defaults to the default set of capabilities granted by the container runtime.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecuritySecurityContextCapabilities {
    /// Added capabilities
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub add: Option<Vec<String>>,
    /// Removed capabilities
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub drop: Option<Vec<String>>,
}

/// The SELinux context to be applied to the container.
/// If unspecified, the container runtime will allocate a random SELinux context for each
/// container.  May also be set in PodSecurityContext.  If set in both SecurityContext and
/// PodSecurityContext, the value specified in SecurityContext takes precedence.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecuritySecurityContextSeLinuxOptions {
    /// Level is SELinux level label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub level: Option<String>,
    /// Role is a SELinux role label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Type is a SELinux type label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    /// User is a SELinux user label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
}

/// The seccomp options to use by this container. If seccomp options are
/// provided at both the pod & container level, the container options
/// override the pod options.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecuritySecurityContextSeccompProfile {
    /// localhostProfile indicates a profile defined in a file on the node should be used.
    /// The profile must be preconfigured on the node to work.
    /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
    /// Must be set if type is "Localhost". Must NOT be set for any other type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
    pub localhost_profile: Option<String>,
    /// type indicates which kind of seccomp profile will be applied.
    /// Valid options are:
    /// 
    /// 
    /// Localhost - a profile defined in a file on the node should be used.
    /// RuntimeDefault - the container runtime default profile should be used.
    /// Unconfined - no profile should be applied.
    #[serde(rename = "type")]
    pub r#type: String,
}

/// The Windows specific settings applied to all containers.
/// If unspecified, the options from the PodSecurityContext will be used.
/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
/// Note that this field cannot be set when spec.os.name is linux.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecuritySecurityContextWindowsOptions {
    /// GMSACredentialSpec is where the GMSA admission webhook
    /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
    /// GMSA credential spec named by the GMSACredentialSpecName field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
    pub gmsa_credential_spec: Option<String>,
    /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
    pub gmsa_credential_spec_name: Option<String>,
    /// HostProcess determines if a container should be run as a 'Host Process' container.
    /// All of a Pod's containers must have the same effective HostProcess value
    /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
    /// In addition, if HostProcess is true then HostNetwork must also be set to true.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
    pub host_process: Option<bool>,
    /// The UserName in Windows to run the entrypoint of the container process.
    /// Defaults to the user specified in image metadata if unspecified.
    /// May also be set in PodSecurityContext. If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
    pub run_as_user_name: Option<String>,
}

/// DEPRECATED - by spec.security.securityContext
/// SecurityContext allows the configuration of the security context for all
/// Couchbase server pods.  When using persistent volumes you may need to set
/// the fsGroup field in order to write to the volume.  For non-root clusters
/// you must also set runAsUser to 1000, corresponding to the Couchbase user
/// in official container images.  More info:
/// <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityContext {
    /// A special supplemental group that applies to all containers in a pod.
    /// Some volume types allow the Kubelet to change the ownership of that volume
    /// to be owned by the pod:
    /// 
    /// 
    /// 1. The owning GID will be the FSGroup
    /// 2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
    /// 3. The permission bits are OR'd with rw-rw----
    /// 
    /// 
    /// If unset, the Kubelet will not modify the ownership and permissions of any volume.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsGroup")]
    pub fs_group: Option<i64>,
    /// fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
    /// before being exposed inside Pod. This field will only apply to
    /// volume types which support fsGroup based ownership(and permissions).
    /// It will have no effect on ephemeral volume types such as: secret, configmaps
    /// and emptydir.
    /// Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsGroupChangePolicy")]
    pub fs_group_change_policy: Option<String>,
    /// The GID to run the entrypoint of the container process.
    /// Uses runtime default if unset.
    /// May also be set in SecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence
    /// for that container.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
    pub run_as_group: Option<i64>,
    /// Indicates that the container must run as a non-root user.
    /// If true, the Kubelet will validate the image at runtime to ensure that it
    /// does not run as UID 0 (root) and fail to start the container if it does.
    /// If unset or false, no such validation will be performed.
    /// May also be set in SecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
    pub run_as_non_root: Option<bool>,
    /// The UID to run the entrypoint of the container process.
    /// Defaults to user specified in image metadata if unspecified.
    /// May also be set in SecurityContext.  If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence
    /// for that container.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
    pub run_as_user: Option<i64>,
    /// The SELinux context to be applied to all containers.
    /// If unspecified, the container runtime will allocate a random SELinux context for each
    /// container.  May also be set in SecurityContext.  If set in
    /// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
    /// takes precedence for that container.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
    pub se_linux_options: Option<CouchbaseClusterSecurityContextSeLinuxOptions>,
    /// The seccomp options to use by the containers in this pod.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
    pub seccomp_profile: Option<CouchbaseClusterSecurityContextSeccompProfile>,
    /// A list of groups applied to the first process run in each container, in addition
    /// to the container's primary GID, the fsGroup (if specified), and group memberships
    /// defined in the container image for the uid of the container process. If unspecified,
    /// no additional groups are added to any container. Note that group memberships
    /// defined in the container image for the uid of the container process are still effective,
    /// even if they are not included in this list.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "supplementalGroups")]
    pub supplemental_groups: Option<Vec<i64>>,
    /// Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
    /// sysctls (by the container runtime) might fail to launch.
    /// Note that this field cannot be set when spec.os.name is windows.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sysctls: Option<Vec<CouchbaseClusterSecurityContextSysctls>>,
    /// The Windows specific settings applied to all containers.
    /// If unspecified, the options within a container's SecurityContext will be used.
    /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
    /// Note that this field cannot be set when spec.os.name is linux.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
    pub windows_options: Option<CouchbaseClusterSecurityContextWindowsOptions>,
}

/// The SELinux context to be applied to all containers.
/// If unspecified, the container runtime will allocate a random SELinux context for each
/// container.  May also be set in SecurityContext.  If set in
/// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
/// takes precedence for that container.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityContextSeLinuxOptions {
    /// Level is SELinux level label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub level: Option<String>,
    /// Role is a SELinux role label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Type is a SELinux type label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    /// User is a SELinux user label that applies to the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
}

/// The seccomp options to use by the containers in this pod.
/// Note that this field cannot be set when spec.os.name is windows.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityContextSeccompProfile {
    /// localhostProfile indicates a profile defined in a file on the node should be used.
    /// The profile must be preconfigured on the node to work.
    /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
    /// Must be set if type is "Localhost". Must NOT be set for any other type.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
    pub localhost_profile: Option<String>,
    /// type indicates which kind of seccomp profile will be applied.
    /// Valid options are:
    /// 
    /// 
    /// Localhost - a profile defined in a file on the node should be used.
    /// RuntimeDefault - the container runtime default profile should be used.
    /// Unconfined - no profile should be applied.
    #[serde(rename = "type")]
    pub r#type: String,
}

/// Sysctl defines a kernel parameter to be set
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityContextSysctls {
    /// Name of a property to set
    pub name: String,
    /// Value of a property to set
    pub value: String,
}

/// The Windows specific settings applied to all containers.
/// If unspecified, the options within a container's SecurityContext will be used.
/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
/// Note that this field cannot be set when spec.os.name is linux.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterSecurityContextWindowsOptions {
    /// GMSACredentialSpec is where the GMSA admission webhook
    /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
    /// GMSA credential spec named by the GMSACredentialSpecName field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
    pub gmsa_credential_spec: Option<String>,
    /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
    pub gmsa_credential_spec_name: Option<String>,
    /// HostProcess determines if a container should be run as a 'Host Process' container.
    /// All of a Pod's containers must have the same effective HostProcess value
    /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
    /// In addition, if HostProcess is true then HostNetwork must also be set to true.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
    pub host_process: Option<bool>,
    /// The UserName in Windows to run the entrypoint of the container process.
    /// Defaults to the user specified in image metadata if unspecified.
    /// May also be set in PodSecurityContext. If set in both SecurityContext and
    /// PodSecurityContext, the value specified in SecurityContext takes precedence.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
    pub run_as_user_name: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServers {
    /// AutoscaledEnabled defines whether the autoscaling feature is enabled for this class.
    /// When true, the Operator will create a CouchbaseAutoscaler resource for this
    /// server class.  The CouchbaseAutoscaler implements the Kubernetes scale API and
    /// can be controlled by the Kubernetes horizontal pod autoscaler (HPA).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoscaleEnabled")]
    pub autoscale_enabled: Option<bool>,
    /// Env allows the setting of environment variables in the Couchbase server container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub env: Option<Vec<CouchbaseClusterServersEnv>>,
    /// EnvFrom allows the setting of environment variables in the Couchbase server container.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "envFrom")]
    pub env_from: Option<Vec<CouchbaseClusterServersEnvFrom>>,
    /// Image is the container image name that will be used to launch Couchbase
    /// server instances in this server class. You cannot downgrade the Couchbase
    /// version. Across spec.image and all server classes there can only be two
    /// different Couchbase images. Updating this field to a value different than
    /// spec.image will cause an automatic upgrade of the server class. If it isn't
    /// specified then the cluster image will be used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    /// Name is a textual name for the server configuration and must be unique.
    /// The name is used by the operator to uniquely identify a server class,
    /// and map pods back to an intended configuration.
    pub name: String,
    /// Pod defines a template used to create pod for each Couchbase server
    /// instance.  Modifying pod metadata such as labels and annotations will
    /// update the pod in-place.  Any other modification will result in a cluster
    /// upgrade in order to fulfill the request. The Operator reserves the right
    /// to modify or replace any field.  More info:
    /// <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#pod-v1-core>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pod: Option<CouchbaseClusterServersPod>,
    /// Resources are the resource requirements for the Couchbase server container.
    /// This field overrides any automatic allocation as defined by
    /// `spec.autoResourceAllocation`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<CouchbaseClusterServersResources>,
    /// ServerGroups define the set of availability zones you want to distribute
    /// pods over, and construct Couchbase server groups for.  By default, most
    /// cloud providers will label nodes with the key "topology.kubernetes.io/zone",
    /// the values associated with that key are used here to provide explicit
    /// scheduling by the Operator.  You may manually label nodes using the
    /// "topology.kubernetes.io/zone" key, to provide failure-domain
    /// aware scheduling when none is provided for you.  Global server groups are
    /// applied to all server classes, and may be overridden on a per-server class
    /// basis to give more control over scheduling and server groups.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverGroups")]
    pub server_groups: Option<Vec<String>>,
    /// Services is the set of Couchbase services to run on this server class.
    /// At least one class must contain the data service.  The field may contain
    /// any of "data", "index", "query", "search", "eventing" or "analytics".
    /// Each service may only be specified once. An empty list can also be specified
    /// for a serviceless class ("[]") if Couchbase version is 7.6.0 or greater.
    pub services: Vec<String>,
    /// Size is the expected requested of the server class.  This field
    /// must be greater than or equal to 1.
    pub size: i64,
    /// VolumeMounts define persistent volume claims to attach to pod.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeMounts")]
    pub volume_mounts: Option<CouchbaseClusterServersVolumeMounts>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnv {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded
    /// using the previously defined environment variables in the container and
    /// any service environment variables. If a variable cannot be resolved,
    /// the reference in the input string will be unchanged. Double $$ are reduced
    /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    /// Escaped references will never be expanded, regardless of whether the variable
    /// exists or not.
    /// Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<CouchbaseClusterServersEnvValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<CouchbaseClusterServersEnvValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<CouchbaseClusterServersEnvValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests
    /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
    pub resource_field_ref: Option<CouchbaseClusterServersEnvValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<CouchbaseClusterServersEnvValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvValueFromConfigMapKeyRef {
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvValueFromFieldRef {
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests
/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvValueFromResourceFieldRef {
    /// Container name: required for volumes, optional for env vars
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvValueFromSecretKeyRef {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// EnvFromSource represents the source of a set of ConfigMaps
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvFrom {
    /// The ConfigMap to select from
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapRef")]
    pub config_map_ref: Option<CouchbaseClusterServersEnvFromConfigMapRef>,
    /// An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,
    /// The Secret to select from
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<CouchbaseClusterServersEnvFromSecretRef>,
}

/// The ConfigMap to select from
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvFromConfigMapRef {
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// The Secret to select from
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersEnvFromSecretRef {
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Pod defines a template used to create pod for each Couchbase server
/// instance.  Modifying pod metadata such as labels and annotations will
/// update the pod in-place.  Any other modification will result in a cluster
/// upgrade in order to fulfill the request. The Operator reserves the right
/// to modify or replace any field.  More info:
/// <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#pod-v1-core>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPod {
    /// Standard objects metadata.  This is a curated version for use with Couchbase
    /// resource templates.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<CouchbaseClusterServersPodMetadata>,
    /// PodSpec is a description of a pod.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub spec: Option<CouchbaseClusterServersPodSpec>,
}

/// Standard objects metadata.  This is a curated version for use with Couchbase
/// resource templates.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodMetadata {
    /// Annotations is an unstructured key value map stored with a resource that
    /// may be set by external tools to store and retrieve arbitrary metadata. They
    /// are not queryable and should be preserved when modifying objects. More
    /// info: <http://kubernetes.io/docs/user-guide/annotations>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services. More info: <http://kubernetes.io/docs/user-guide/labels>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// PodSpec is a description of a pod.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpec {
    /// Optional duration in seconds the pod may be active on the node relative to
    /// StartTime before the system will actively try to mark it failed and kill associated containers.
    /// Value must be a positive integer.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "activeDeadlineSeconds")]
    pub active_deadline_seconds: Option<i64>,
    /// If specified, the pod's scheduling constraints
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub affinity: Option<CouchbaseClusterServersPodSpecAffinity>,
    /// AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "automountServiceAccountToken")]
    pub automount_service_account_token: Option<bool>,
    /// Specifies the DNS parameters of a pod.
    /// Parameters specified here will be merged to the generated DNS
    /// configuration based on DNSPolicy.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dnsConfig")]
    pub dns_config: Option<CouchbaseClusterServersPodSpecDnsConfig>,
    /// Set DNS policy for the pod.
    /// Defaults to "ClusterFirst".
    /// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
    /// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
    /// To have DNS options set along with hostNetwork, you have to specify DNS policy
    /// explicitly to 'ClusterFirstWithHostNet'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dnsPolicy")]
    pub dns_policy: Option<String>,
    /// EnableServiceLinks indicates whether information about services should be injected into pod's
    /// environment variables, matching the syntax of Docker links.
    /// Optional: Defaults to true.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enableServiceLinks")]
    pub enable_service_links: Option<bool>,
    /// Use the host's ipc namespace.
    /// Optional: Default to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostIPC")]
    pub host_ipc: Option<bool>,
    /// Host networking requested for this pod. Use the host's network namespace.
    /// If this option is set, the ports that will be used must be specified.
    /// Default to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostNetwork")]
    pub host_network: Option<bool>,
    /// Use the host's pid namespace.
    /// Optional: Default to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostPID")]
    pub host_pid: Option<bool>,
    /// Use the host's user namespace.
    /// Optional: Default to true.
    /// If set to true or not present, the pod will be run in the host user namespace, useful
    /// for when the pod needs a feature only available to the host user namespace, such as
    /// loading a kernel module with CAP_SYS_MODULE.
    /// When set to false, a new userns is created for the pod. Setting false is useful for
    /// mitigating container breakout vulnerabilities even allowing users to run their
    /// containers as root without actually having root privileges on the host.
    /// This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostUsers")]
    pub host_users: Option<bool>,
    /// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
    /// If specified, these secrets will be passed to individual puller implementations for them to use.
    /// More info: <https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullSecrets")]
    pub image_pull_secrets: Option<Vec<CouchbaseClusterServersPodSpecImagePullSecrets>>,
    /// NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
    /// the scheduler simply schedules this pod onto that node, assuming that it fits resource
    /// requirements.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeName")]
    pub node_name: Option<String>,
    /// NodeSelector is a selector which must be true for the pod to fit on a node.
    /// Selector which must match a node's labels for the pod to be scheduled on that node.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/assign-pod-node/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeSelector")]
    pub node_selector: Option<BTreeMap<String, String>>,
    /// Specifies the OS of the containers in the pod.
    /// Some pod and container fields are restricted if this is set.
    /// 
    /// 
    /// If the OS field is set to linux, the following fields must be unset:
    /// -securityContext.windowsOptions
    /// 
    /// 
    /// If the OS field is set to windows, following fields must be unset:
    /// - spec.hostPID
    /// - spec.hostIPC
    /// - spec.hostUsers
    /// - spec.securityContext.seLinuxOptions
    /// - spec.securityContext.seccompProfile
    /// - spec.securityContext.fsGroup
    /// - spec.securityContext.fsGroupChangePolicy
    /// - spec.securityContext.sysctls
    /// - spec.shareProcessNamespace
    /// - spec.securityContext.runAsUser
    /// - spec.securityContext.runAsGroup
    /// - spec.securityContext.supplementalGroups
    /// - spec.containers[*].securityContext.seLinuxOptions
    /// - spec.containers[*].securityContext.seccompProfile
    /// - spec.containers[*].securityContext.capabilities
    /// - spec.containers[*].securityContext.readOnlyRootFilesystem
    /// - spec.containers[*].securityContext.privileged
    /// - spec.containers[*].securityContext.allowPrivilegeEscalation
    /// - spec.containers[*].securityContext.procMount
    /// - spec.containers[*].securityContext.runAsUser
    /// - spec.containers[*].securityContext.runAsGroup
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub os: Option<CouchbaseClusterServersPodSpecOs>,
    /// Overhead represents the resource overhead associated with running a pod for a given RuntimeClass.
    /// This field will be autopopulated at admission time by the RuntimeClass admission controller. If
    /// the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests.
    /// The RuntimeClass admission controller will reject Pod create requests which have the overhead already
    /// set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value
    /// defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero.
    /// More info: <https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub overhead: Option<BTreeMap<String, IntOrString>>,
    /// PreemptionPolicy is the Policy for preempting pods with lower priority.
    /// One of Never, PreemptLowerPriority.
    /// Defaults to PreemptLowerPriority if unset.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preemptionPolicy")]
    pub preemption_policy: Option<String>,
    /// The priority value. Various system components use this field to find the
    /// priority of the pod. When Priority Admission Controller is enabled, it
    /// prevents users from setting this field. The admission controller populates
    /// this field from PriorityClassName.
    /// The higher the value, the higher the priority.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub priority: Option<i32>,
    /// If specified, indicates the pod's priority. "system-node-critical" and
    /// "system-cluster-critical" are two special keywords which indicate the
    /// highest priorities with the former being the highest priority. Any other
    /// name must be defined by creating a PriorityClass object with that name.
    /// If not specified, the pod priority will be default or zero if there is no
    /// default.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "priorityClassName")]
    pub priority_class_name: Option<String>,
    /// ResourceClaims defines which ResourceClaims must be allocated
    /// and reserved before the Pod is allowed to start. The resources
    /// will be made available to those containers which consume them
    /// by name.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceClaims")]
    pub resource_claims: Option<Vec<CouchbaseClusterServersPodSpecResourceClaims>>,
    /// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
    /// to run this pod.  If no RuntimeClass resource matches the named class, the pod will not be run.
    /// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
    /// empty definition that uses the default runtime handler.
    /// More info: <https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runtimeClassName")]
    pub runtime_class_name: Option<String>,
    /// If specified, the pod will be dispatched by specified scheduler.
    /// If not specified, the pod will be dispatched by default scheduler.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulerName")]
    pub scheduler_name: Option<String>,
    /// SchedulingGates is an opaque list of values that if specified will block scheduling the pod.
    /// If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
    /// scheduler will not attempt to schedule the pod.
    /// 
    /// 
    /// SchedulingGates can only be set at pod creation time, and be removed only afterwards.
    /// 
    /// 
    /// This is a beta feature enabled by the PodSchedulingReadiness feature gate.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulingGates")]
    pub scheduling_gates: Option<Vec<CouchbaseClusterServersPodSpecSchedulingGates>>,
    /// DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.
    /// Deprecated: Use serviceAccountName instead.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccount")]
    pub service_account: Option<String>,
    /// ServiceAccountName is the name of the ServiceAccount to use to run this pod.
    /// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountName")]
    pub service_account_name: Option<String>,
    /// If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default).
    /// In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname).
    /// In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN.
    /// If a pod does not have FQDN, this has no effect.
    /// Default to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "setHostnameAsFQDN")]
    pub set_hostname_as_fqdn: Option<bool>,
    /// Share a single process namespace between all of the containers in a pod.
    /// When this is set containers will be able to view and signal processes from other containers
    /// in the same pod, and the first process in each container will not be assigned PID 1.
    /// HostPID and ShareProcessNamespace cannot both be set.
    /// Optional: Default to false.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "shareProcessNamespace")]
    pub share_process_namespace: Option<bool>,
    /// Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
    /// Value must be non-negative integer. The value zero indicates stop immediately via
    /// the kill signal (no opportunity to shut down).
    /// If this value is nil, the default grace period will be used instead.
    /// The grace period is the duration in seconds after the processes running in the pod are sent
    /// a termination signal and the time when the processes are forcibly halted with a kill signal.
    /// Set this value longer than the expected cleanup time for your process.
    /// Defaults to 30 seconds.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
    pub termination_grace_period_seconds: Option<i64>,
    /// If specified, the pod's tolerations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tolerations: Option<Vec<CouchbaseClusterServersPodSpecTolerations>>,
    /// TopologySpreadConstraints describes how a group of pods ought to spread across topology
    /// domains. Scheduler will schedule pods in a way which abides by the constraints.
    /// All topologySpreadConstraints are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "topologySpreadConstraints")]
    pub topology_spread_constraints: Option<Vec<CouchbaseClusterServersPodSpecTopologySpreadConstraints>>,
}

/// If specified, the pod's scheduling constraints
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinity {
    /// Describes node affinity scheduling rules for the pod.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeAffinity")]
    pub node_affinity: Option<CouchbaseClusterServersPodSpecAffinityNodeAffinity>,
    /// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "podAffinity")]
    pub pod_affinity: Option<CouchbaseClusterServersPodSpecAffinityPodAffinity>,
    /// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "podAntiAffinity")]
    pub pod_anti_affinity: Option<CouchbaseClusterServersPodSpecAffinityPodAntiAffinity>,
}

/// Describes node affinity scheduling rules for the pod.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinity {
    /// The scheduler will prefer to schedule pods to nodes that satisfy
    /// the affinity expressions specified by this field, but it may choose
    /// a node that violates one or more of the expressions. The node that is
    /// most preferred is the one with the greatest sum of weights, i.e.
    /// for each node that meets all of the scheduling requirements (resource
    /// request, requiredDuringScheduling affinity expressions, etc.),
    /// compute a sum by iterating through the elements of this field and adding
    /// "weight" to the sum if the node matches the corresponding matchExpressions; the
    /// node(s) with the highest sum are the most preferred.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferredDuringSchedulingIgnoredDuringExecution")]
    pub preferred_during_scheduling_ignored_during_execution: Option<Vec<CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
    /// If the affinity requirements specified by this field are not met at
    /// scheduling time, the pod will not be scheduled onto the node.
    /// If the affinity requirements specified by this field cease to be met
    /// at some point during pod execution (e.g. due to an update), the system
    /// may or may not try to eventually evict the pod from its node.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requiredDuringSchedulingIgnoredDuringExecution")]
    pub required_during_scheduling_ignored_during_execution: Option<CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
}

/// An empty preferred scheduling term matches all objects with implicit weight 0
/// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {
    /// A node selector term, associated with the corresponding weight.
    pub preference: CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference,
    /// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
    pub weight: i32,
}

/// A node selector term, associated with the corresponding weight.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference {
    /// A list of node selector requirements by node's labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions>>,
    /// A list of node selector requirements by node's fields.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
    pub match_fields: Option<Vec<CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator
/// that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions {
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. If the operator is Gt or Lt, the values
    /// array must have a single element, which will be interpreted as an integer.
    /// This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator
/// that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields {
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. If the operator is Gt or Lt, the values
    /// array must have a single element, which will be interpreted as an integer.
    /// This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// If the affinity requirements specified by this field are not met at
/// scheduling time, the pod will not be scheduled onto the node.
/// If the affinity requirements specified by this field cease to be met
/// at some point during pod execution (e.g. due to an update), the system
/// may or may not try to eventually evict the pod from its node.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {
    /// Required. A list of node selector terms. The terms are ORed.
    #[serde(rename = "nodeSelectorTerms")]
    pub node_selector_terms: Vec<CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms>,
}

/// A null or empty node selector term matches no objects. The requirements of
/// them are ANDed.
/// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {
    /// A list of node selector requirements by node's labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions>>,
    /// A list of node selector requirements by node's fields.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
    pub match_fields: Option<Vec<CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator
/// that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions {
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. If the operator is Gt or Lt, the values
    /// array must have a single element, which will be interpreted as an integer.
    /// This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator
/// that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields {
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. If the operator is Gt or Lt, the values
    /// array must have a single element, which will be interpreted as an integer.
    /// This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinity {
    /// The scheduler will prefer to schedule pods to nodes that satisfy
    /// the affinity expressions specified by this field, but it may choose
    /// a node that violates one or more of the expressions. The node that is
    /// most preferred is the one with the greatest sum of weights, i.e.
    /// for each node that meets all of the scheduling requirements (resource
    /// request, requiredDuringScheduling affinity expressions, etc.),
    /// compute a sum by iterating through the elements of this field and adding
    /// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
    /// node(s) with the highest sum are the most preferred.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferredDuringSchedulingIgnoredDuringExecution")]
    pub preferred_during_scheduling_ignored_during_execution: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
    /// If the affinity requirements specified by this field are not met at
    /// scheduling time, the pod will not be scheduled onto the node.
    /// If the affinity requirements specified by this field cease to be met
    /// at some point during pod execution (e.g. due to a pod label update), the
    /// system may or may not try to eventually evict the pod from its node.
    /// When there are multiple elements, the lists of nodes corresponding to each
    /// podAffinityTerm are intersected, i.e. all terms must be satisfied.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requiredDuringSchedulingIgnoredDuringExecution")]
    pub required_during_scheduling_ignored_during_execution: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>>,
}

/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {
    /// Required. A pod affinity term, associated with the corresponding weight.
    #[serde(rename = "podAffinityTerm")]
    pub pod_affinity_term: CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
    /// weight associated with matching the corresponding podAffinityTerm,
    /// in the range 1-100.
    pub weight: i32,
}

/// Required. A pod affinity term, associated with the corresponding weight.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
    /// A label query over the set of namespaces that the term applies to.
    /// The term is applied to the union of the namespaces selected by this field
    /// and the ones listed in the namespaces field.
    /// null selector and null or empty namespaces list means "this pod's namespace".
    /// An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to.
    /// The term is applied to the union of the namespaces listed in this field
    /// and the ones selected by namespaceSelector.
    /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
    /// whose value of the label with key topologyKey matches that of any node on which any of the
    /// selected pods is running.
    /// Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to.
/// The term is applied to the union of the namespaces selected by this field
/// and the ones listed in the namespaces field.
/// null selector and null or empty namespaces list means "this pod's namespace".
/// An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Defines a set of pods (namely those matching the labelSelector
/// relative to the given namespace(s)) that this pod should be
/// co-located (affinity) or not co-located (anti-affinity) with,
/// where co-located is defined as running on a node whose value of
/// the label with key <topologyKey> matches that of any node on which
/// a pod of the set of pods is running
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
    /// A label query over the set of namespaces that the term applies to.
    /// The term is applied to the union of the namespaces selected by this field
    /// and the ones listed in the namespaces field.
    /// null selector and null or empty namespaces list means "this pod's namespace".
    /// An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to.
    /// The term is applied to the union of the namespaces listed in this field
    /// and the ones selected by namespaceSelector.
    /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
    /// whose value of the label with key topologyKey matches that of any node on which any of the
    /// selected pods is running.
    /// Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to.
/// The term is applied to the union of the namespaces selected by this field
/// and the ones listed in the namespaces field.
/// null selector and null or empty namespaces list means "this pod's namespace".
/// An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinity {
    /// The scheduler will prefer to schedule pods to nodes that satisfy
    /// the anti-affinity expressions specified by this field, but it may choose
    /// a node that violates one or more of the expressions. The node that is
    /// most preferred is the one with the greatest sum of weights, i.e.
    /// for each node that meets all of the scheduling requirements (resource
    /// request, requiredDuringScheduling anti-affinity expressions, etc.),
    /// compute a sum by iterating through the elements of this field and adding
    /// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
    /// node(s) with the highest sum are the most preferred.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferredDuringSchedulingIgnoredDuringExecution")]
    pub preferred_during_scheduling_ignored_during_execution: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
    /// If the anti-affinity requirements specified by this field are not met at
    /// scheduling time, the pod will not be scheduled onto the node.
    /// If the anti-affinity requirements specified by this field cease to be met
    /// at some point during pod execution (e.g. due to a pod label update), the
    /// system may or may not try to eventually evict the pod from its node.
    /// When there are multiple elements, the lists of nodes corresponding to each
    /// podAffinityTerm are intersected, i.e. all terms must be satisfied.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requiredDuringSchedulingIgnoredDuringExecution")]
    pub required_during_scheduling_ignored_during_execution: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution>>,
}

/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution {
    /// Required. A pod affinity term, associated with the corresponding weight.
    #[serde(rename = "podAffinityTerm")]
    pub pod_affinity_term: CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
    /// weight associated with matching the corresponding podAffinityTerm,
    /// in the range 1-100.
    pub weight: i32,
}

/// Required. A pod affinity term, associated with the corresponding weight.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
    /// A label query over the set of namespaces that the term applies to.
    /// The term is applied to the union of the namespaces selected by this field
    /// and the ones listed in the namespaces field.
    /// null selector and null or empty namespaces list means "this pod's namespace".
    /// An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to.
    /// The term is applied to the union of the namespaces listed in this field
    /// and the ones selected by namespaceSelector.
    /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
    /// whose value of the label with key topologyKey matches that of any node on which any of the
    /// selected pods is running.
    /// Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to.
/// The term is applied to the union of the namespaces selected by this field
/// and the ones listed in the namespaces field.
/// null selector and null or empty namespaces list means "this pod's namespace".
/// An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Defines a set of pods (namely those matching the labelSelector
/// relative to the given namespace(s)) that this pod should be
/// co-located (affinity) or not co-located (anti-affinity) with,
/// where co-located is defined as running on a node whose value of
/// the label with key <topologyKey> matches that of any node on which
/// a pod of the set of pods is running
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
    /// A label query over the set of namespaces that the term applies to.
    /// The term is applied to the union of the namespaces selected by this field
    /// and the ones listed in the namespaces field.
    /// null selector and null or empty namespaces list means "this pod's namespace".
    /// An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to.
    /// The term is applied to the union of the namespaces listed in this field
    /// and the ones selected by namespaceSelector.
    /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
    /// whose value of the label with key topologyKey matches that of any node on which any of the
    /// selected pods is running.
    /// Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to.
/// The term is applied to the union of the namespaces selected by this field
/// and the ones listed in the namespaces field.
/// null selector and null or empty namespaces list means "this pod's namespace".
/// An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Specifies the DNS parameters of a pod.
/// Parameters specified here will be merged to the generated DNS
/// configuration based on DNSPolicy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecDnsConfig {
    /// A list of DNS name server IP addresses.
    /// This will be appended to the base nameservers generated from DNSPolicy.
    /// Duplicated nameservers will be removed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub nameservers: Option<Vec<String>>,
    /// A list of DNS resolver options.
    /// This will be merged with the base options generated from DNSPolicy.
    /// Duplicated entries will be removed. Resolution options given in Options
    /// will override those that appear in the base DNSPolicy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub options: Option<Vec<CouchbaseClusterServersPodSpecDnsConfigOptions>>,
    /// A list of DNS search domains for host-name lookup.
    /// This will be appended to the base search paths generated from DNSPolicy.
    /// Duplicated search paths will be removed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub searches: Option<Vec<String>>,
}

/// PodDNSConfigOption defines DNS resolver options of a pod.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecDnsConfigOptions {
    /// Required.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// LocalObjectReference contains enough information to let you locate the
/// referenced object inside the same namespace.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecImagePullSecrets {
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// Specifies the OS of the containers in the pod.
/// Some pod and container fields are restricted if this is set.
/// 
/// 
/// If the OS field is set to linux, the following fields must be unset:
/// -securityContext.windowsOptions
/// 
/// 
/// If the OS field is set to windows, following fields must be unset:
/// - spec.hostPID
/// - spec.hostIPC
/// - spec.hostUsers
/// - spec.securityContext.seLinuxOptions
/// - spec.securityContext.seccompProfile
/// - spec.securityContext.fsGroup
/// - spec.securityContext.fsGroupChangePolicy
/// - spec.securityContext.sysctls
/// - spec.shareProcessNamespace
/// - spec.securityContext.runAsUser
/// - spec.securityContext.runAsGroup
/// - spec.securityContext.supplementalGroups
/// - spec.containers[*].securityContext.seLinuxOptions
/// - spec.containers[*].securityContext.seccompProfile
/// - spec.containers[*].securityContext.capabilities
/// - spec.containers[*].securityContext.readOnlyRootFilesystem
/// - spec.containers[*].securityContext.privileged
/// - spec.containers[*].securityContext.allowPrivilegeEscalation
/// - spec.containers[*].securityContext.procMount
/// - spec.containers[*].securityContext.runAsUser
/// - spec.containers[*].securityContext.runAsGroup
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecOs {
    /// Name is the name of the operating system. The currently supported values are linux and windows.
    /// Additional value may be defined in future and can be one of:
    /// <https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration>
    /// Clients should expect to handle additional values and treat unrecognized values in this field as os: null
    pub name: String,
}

/// PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
/// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
/// Containers that need access to the ResourceClaim reference it with this name.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecResourceClaims {
    /// Name uniquely identifies this resource claim inside the pod.
    /// This must be a DNS_LABEL.
    pub name: String,
    /// Source describes where to find the ResourceClaim.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<CouchbaseClusterServersPodSpecResourceClaimsSource>,
}

/// Source describes where to find the ResourceClaim.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecResourceClaimsSource {
    /// ResourceClaimName is the name of a ResourceClaim object in the same
    /// namespace as this pod.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceClaimName")]
    pub resource_claim_name: Option<String>,
    /// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
    /// object in the same namespace as this pod.
    /// 
    /// 
    /// The template will be used to create a new ResourceClaim, which will
    /// be bound to this pod. When this pod is deleted, the ResourceClaim
    /// will also be deleted. The pod name and resource name, along with a
    /// generated component, will be used to form a unique name for the
    /// ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
    /// 
    /// 
    /// This field is immutable and no changes will be made to the
    /// corresponding ResourceClaim by the control plane after creating the
    /// ResourceClaim.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceClaimTemplateName")]
    pub resource_claim_template_name: Option<String>,
}

/// PodSchedulingGate is associated to a Pod to guard its scheduling.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecSchedulingGates {
    /// Name of the scheduling gate.
    /// Each scheduling gate must have a unique name field.
    pub name: String,
}

/// The pod this Toleration is attached to tolerates any taint that matches
/// the triple <key,value,effect> using the matching operator <operator>.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecTolerations {
    /// Effect indicates the taint effect to match. Empty means match all taint effects.
    /// When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub effect: Option<String>,
    /// Key is the taint key that the toleration applies to. Empty means match all taint keys.
    /// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// Operator represents a key's relationship to the value.
    /// Valid operators are Exists and Equal. Defaults to Equal.
    /// Exists is equivalent to wildcard for value, so that a pod can
    /// tolerate all taints of a particular category.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub operator: Option<String>,
    /// TolerationSeconds represents the period of time the toleration (which must be
    /// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
    /// it is not set, which means tolerate the taint forever (do not evict). Zero and
    /// negative values will be treated as 0 (evict immediately) by the system.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tolerationSeconds")]
    pub toleration_seconds: Option<i64>,
    /// Value is the taint value the toleration matches to.
    /// If the operator is Exists, the value should be empty, otherwise just a regular string.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// TopologySpreadConstraint specifies how to spread matching pods among the given topology.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecTopologySpreadConstraints {
    /// LabelSelector is used to find matching pods.
    /// Pods that match this label selector are counted to determine the number of pods
    /// in their corresponding topology domain.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<CouchbaseClusterServersPodSpecTopologySpreadConstraintsLabelSelector>,
    /// MatchLabelKeys is a set of pod label keys to select the pods over which
    /// spreading will be calculated. The keys are used to lookup values from the
    /// incoming pod labels, those key-value labels are ANDed with labelSelector
    /// to select the group of existing pods over which spreading will be calculated
    /// for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
    /// MatchLabelKeys cannot be set when LabelSelector isn't set.
    /// Keys that don't exist in the incoming pod labels will
    /// be ignored. A null or empty list means only match against labelSelector.
    /// 
    /// 
    /// This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
    pub match_label_keys: Option<Vec<String>>,
    /// MaxSkew describes the degree to which pods may be unevenly distributed.
    /// When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
    /// between the number of matching pods in the target topology and the global minimum.
    /// The global minimum is the minimum number of matching pods in an eligible domain
    /// or zero if the number of eligible domains is less than MinDomains.
    /// For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
    /// labelSelector spread as 2/2/1:
    /// In this case, the global minimum is 1.
    /// | zone1 | zone2 | zone3 |
    /// |  P P  |  P P  |   P   |
    /// - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
    /// scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
    /// violate MaxSkew(1).
    /// - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
    /// When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
    /// to topologies that satisfy it.
    /// It's a required field. Default value is 1 and 0 is not allowed.
    #[serde(rename = "maxSkew")]
    pub max_skew: i32,
    /// MinDomains indicates a minimum number of eligible domains.
    /// When the number of eligible domains with matching topology keys is less than minDomains,
    /// Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
    /// And when the number of eligible domains with matching topology keys equals or greater than minDomains,
    /// this value has no effect on scheduling.
    /// As a result, when the number of eligible domains is less than minDomains,
    /// scheduler won't schedule more than maxSkew Pods to those domains.
    /// If value is nil, the constraint behaves as if MinDomains is equal to 1.
    /// Valid values are integers greater than 0.
    /// When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
    /// 
    /// 
    /// For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
    /// labelSelector spread as 2/2/2:
    /// | zone1 | zone2 | zone3 |
    /// |  P P  |  P P  |  P P  |
    /// The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
    /// In this situation, new pod with the same labelSelector cannot be scheduled,
    /// because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
    /// it will violate MaxSkew.
    /// 
    /// 
    /// This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minDomains")]
    pub min_domains: Option<i32>,
    /// NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
    /// when calculating pod topology spread skew. Options are:
    /// - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
    /// - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
    /// 
    /// 
    /// If this value is nil, the behavior is equivalent to the Honor policy.
    /// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeAffinityPolicy")]
    pub node_affinity_policy: Option<String>,
    /// NodeTaintsPolicy indicates how we will treat node taints when calculating
    /// pod topology spread skew. Options are:
    /// - Honor: nodes without taints, along with tainted nodes for which the incoming pod
    /// has a toleration, are included.
    /// - Ignore: node taints are ignored. All nodes are included.
    /// 
    /// 
    /// If this value is nil, the behavior is equivalent to the Ignore policy.
    /// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeTaintsPolicy")]
    pub node_taints_policy: Option<String>,
    /// TopologyKey is the key of node labels. Nodes that have a label with this key
    /// and identical values are considered to be in the same topology.
    /// We consider each <key, value> as a "bucket", and try to put balanced number
    /// of pods into each bucket.
    /// We define a domain as a particular instance of a topology.
    /// Also, we define an eligible domain as a domain whose nodes meet the requirements of
    /// nodeAffinityPolicy and nodeTaintsPolicy.
    /// e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
    /// And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
    /// It's a required field.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
    /// WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
    /// the spread constraint.
    /// - DoNotSchedule (default) tells the scheduler not to schedule it.
    /// - ScheduleAnyway tells the scheduler to schedule the pod in any location,
    ///   but giving higher precedence to topologies that would help reduce the
    ///   skew.
    /// A constraint is considered "Unsatisfiable" for an incoming pod
    /// if and only if every possible node assignment for that pod would violate
    /// "MaxSkew" on some topology.
    /// For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
    /// labelSelector spread as 3/1/1:
    /// | zone1 | zone2 | zone3 |
    /// | P P P |   P   |   P   |
    /// If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
    /// to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
    /// MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
    /// won't make it *more* imbalanced.
    /// It's a required field.
    #[serde(rename = "whenUnsatisfiable")]
    pub when_unsatisfiable: String,
}

/// LabelSelector is used to find matching pods.
/// Pods that match this label selector are counted to determine the number of pods
/// in their corresponding topology domain.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecTopologySpreadConstraintsLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterServersPodSpecTopologySpreadConstraintsLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersPodSpecTopologySpreadConstraintsLabelSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Resources are the resource requirements for the Couchbase server container.
/// This field overrides any automatic allocation as defined by
/// `spec.autoResourceAllocation`.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims,
    /// that are used by this container.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<CouchbaseClusterServersResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required.
    /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of
    /// the Pod where this field is used. It makes that resource available
    /// inside a container.
    pub name: String,
}

/// VolumeMounts define persistent volume claims to attach to pod.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterServersVolumeMounts {
    /// AnalyticsClaims are persistent volumes that encompass analytics storage associated
    /// with the analytics service.  Analytics claims can only be used on server classes
    /// running the analytics service, and must be used in conjunction with the default claim.
    /// This field allows the analytics service to use different storage media (e.g. SSD), and
    /// scale horizontally, to improve performance of this service.  This field references a volume
    /// claim template name as defined in "spec.volumeClaimTemplates".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub analytics: Option<Vec<String>>,
    /// DataClaim is a persistent volume that encompasses key/value storage associated
    /// with the data service.  The data claim can only be used on server classes running
    /// the data service, and must be used in conjunction with the default claim.  This
    /// field allows the data service to use different storage media (e.g. SSD) to
    /// improve performance of this service.  This field references a volume
    /// claim template name as defined in "spec.volumeClaimTemplates".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<String>,
    /// DefaultClaim is a persistent volume that encompasses all Couchbase persistent
    /// data, including document storage, indexes and logs.  The default volume can be
    /// used with any server class.  Use of the default claim allows the Operator to
    /// recover failed pods from the persistent volume far quicker than if the pod were
    /// using ephemeral storage.  The default claim cannot be used at the same time
    /// as the logs claim within the same server class.  This field references a volume
    /// claim template name as defined in "spec.volumeClaimTemplates".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub default: Option<String>,
    /// IndexClaim s a persistent volume that encompasses index storage associated
    /// with the index and search services.  The index claim can only be used on server classes running
    /// the index or search services, and must be used in conjunction with the default claim.  This
    /// field allows the index and/or search service to use different storage media (e.g. SSD) to
    /// improve performance of this service. This field references a volume
    /// claim template name as defined in "spec.volumeClaimTemplates".
    /// Whilst this references index primarily, note that the full text search (FTS) service
    /// also uses this same mount.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub index: Option<String>,
    /// LogsClaim is a persistent volume that encompasses only Couchbase server logs to aid
    /// with supporting the product.  The logs claim can only be used on server classes running
    /// the following services: query, search & eventing.  The logs claim cannot be used at the same
    /// time as the default claim within the same server class.  This field references a volume
    /// claim template name as defined in "spec.volumeClaimTemplates".
    /// Whilst the logs claim can be used with the search service, the recommendation is to use the
    /// default claim for these. The reason for this is that a failure of these nodes will require
    /// indexes to be rebuilt and subsequent performance impact.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub logs: Option<String>,
}

/// ClusterSpec is the specification for a CouchbaseCluster resources, and allows
/// the cluster to be customized.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterUpgradeProcess {
    SwapRebalance,
    DeltaRecovery,
    InPlaceUpgrade,
}

/// ClusterSpec is the specification for a CouchbaseCluster resources, and allows
/// the cluster to be customized.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum CouchbaseClusterUpgradeStrategy {
    RollingUpgrade,
    ImmediateUpgrade,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplates {
    /// Standard objects metadata.  This is a curated version for use with Couchbase
    /// resource templates.
    pub metadata: CouchbaseClusterVolumeClaimTemplatesMetadata,
    /// PersistentVolumeClaimSpec describes the common attributes of storage devices
    /// and allows a Source for provider-specific attributes
    pub spec: CouchbaseClusterVolumeClaimTemplatesSpec,
}

/// Standard objects metadata.  This is a curated version for use with Couchbase
/// resource templates.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesMetadata {
    /// Annotations is an unstructured key value map stored with a resource that
    /// may be set by external tools to store and retrieve arbitrary metadata. They
    /// are not queryable and should be preserved when modifying objects. More
    /// info: <http://kubernetes.io/docs/user-guide/annotations>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services. More info: <http://kubernetes.io/docs/user-guide/labels>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
    /// Name must be unique within a namespace. Is required when creating
    /// resources, although some resources may allow a client to request the
    /// generation of an appropriate name automatically. Name is primarily intended
    /// for creation idempotence and configuration definition. Cannot be updated.
    /// More info: <http://kubernetes.io/docs/user-guide/identifiers#names>
    pub name: String,
}

/// PersistentVolumeClaimSpec describes the common attributes of storage devices
/// and allows a Source for provider-specific attributes
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesSpec {
    /// accessModes contains the desired access modes the volume should have.
    /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "accessModes")]
    pub access_modes: Option<Vec<String>>,
    /// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
    /// volume is desired. This may be any object from a non-empty API group (non
    /// core object) or a PersistentVolumeClaim object.
    /// When this field is specified, volume binding will only succeed if the type of
    /// the specified object matches some installed volume populator or dynamic
    /// provisioner.
    /// This field will replace the functionality of the dataSource field and as such
    /// if both fields are non-empty, they must have the same value. For backwards
    /// compatibility, when namespace isn't specified in dataSourceRef,
    /// both fields (dataSource and dataSourceRef) will be set to the same
    /// value automatically if one of them is empty and the other is non-empty.
    /// When namespace is specified in dataSourceRef,
    /// dataSource isn't set to the same value and must be empty.
    /// There are three important differences between dataSource and dataSourceRef:
    /// * While dataSource only allows two specific types of objects, dataSourceRef
    ///   allows any non-core object, as well as PersistentVolumeClaim objects.
    /// * While dataSource ignores disallowed values (dropping them), dataSourceRef
    ///   preserves all values, and generates an error if a disallowed value is
    ///   specified.
    /// * While dataSource only allows local objects, dataSourceRef allows objects
    ///   in any namespaces.
    /// (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
    /// (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataSourceRef")]
    pub data_source_ref: Option<CouchbaseClusterVolumeClaimTemplatesSpecDataSourceRef>,
    /// resources represents the minimum resources the volume should have.
    /// If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
    /// that are lower than previous value but must still be higher than capacity recorded in the
    /// status field of the claim.
    /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<CouchbaseClusterVolumeClaimTemplatesSpecResources>,
    /// selector is a label query over volumes to consider for binding.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<CouchbaseClusterVolumeClaimTemplatesSpecSelector>,
    /// storageClassName is the name of the StorageClass required by the claim.
    /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageClassName")]
    pub storage_class_name: Option<String>,
    /// volumeMode defines what type of volume is required by the claim.
    /// Value of Filesystem is implied when not included in claim spec.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeMode")]
    pub volume_mode: Option<String>,
    /// volumeName is the binding reference to the PersistentVolume backing this claim.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeName")]
    pub volume_name: Option<String>,
}

/// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
/// volume is desired. This may be any object from a non-empty API group (non
/// core object) or a PersistentVolumeClaim object.
/// When this field is specified, volume binding will only succeed if the type of
/// the specified object matches some installed volume populator or dynamic
/// provisioner.
/// This field will replace the functionality of the dataSource field and as such
/// if both fields are non-empty, they must have the same value. For backwards
/// compatibility, when namespace isn't specified in dataSourceRef,
/// both fields (dataSource and dataSourceRef) will be set to the same
/// value automatically if one of them is empty and the other is non-empty.
/// When namespace is specified in dataSourceRef,
/// dataSource isn't set to the same value and must be empty.
/// There are three important differences between dataSource and dataSourceRef:
/// * While dataSource only allows two specific types of objects, dataSourceRef
///   allows any non-core object, as well as PersistentVolumeClaim objects.
/// * While dataSource ignores disallowed values (dropping them), dataSourceRef
///   preserves all values, and generates an error if a disallowed value is
///   specified.
/// * While dataSource only allows local objects, dataSourceRef allows objects
///   in any namespaces.
/// (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
/// (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesSpecDataSourceRef {
    /// APIGroup is the group for the resource being referenced.
    /// If APIGroup is not specified, the specified Kind must be in the core API group.
    /// For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
    /// Namespace is the namespace of resource being referenced
    /// Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
    /// (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// resources represents the minimum resources the volume should have.
/// If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
/// that are lower than previous value but must still be higher than capacity recorded in the
/// status field of the claim.
/// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesSpecResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims,
    /// that are used by this container.
    /// 
    /// 
    /// This is an alpha field and requires enabling the
    /// DynamicResourceAllocation feature gate.
    /// 
    /// 
    /// This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<CouchbaseClusterVolumeClaimTemplatesSpecResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required.
    /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
    /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesSpecResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of
    /// the Pod where this field is used. It makes that resource available
    /// inside a container.
    pub name: String,
}

/// selector is a label query over volumes to consider for binding.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesSpecSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterVolumeClaimTemplatesSpecSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterVolumeClaimTemplatesSpecSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// XDCR defines whether the Operator should manage XDCR, remote clusters and how
/// to lookup replication resources.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterXdcr {
    /// Managed defines whether XDCR is managed by the operator or not.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// RemoteClusters is a set of named remote clusters to establish replications to.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "remoteClusters")]
    pub remote_clusters: Option<Vec<CouchbaseClusterXdcrRemoteClusters>>,
}

/// RemoteCluster is a reference to a remote cluster for XDCR.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterXdcrRemoteClusters {
    /// AuthenticationSecret is a secret used to authenticate when establishing a
    /// remote connection.  It is only required when not using mTLS.  The secret
    /// must contain a username (secret key "username") and password (secret key
    /// "password").
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "authenticationSecret")]
    pub authentication_secret: Option<String>,
    /// Hostname is the connection string to use to connect the remote cluster.  To use IPv6, place brackets (`[`, `]`) around the IPv6 value.
    pub hostname: String,
    /// Name of the remote cluster.
    /// Note that, -operator-managed is added as suffix by operator automatically
    /// to the name in order to diffrentiate from non operator managed remote clusters.
    pub name: String,
    /// Replications are replication streams from this cluster to the remote one.
    /// This field defines how to look up CouchbaseReplication resources.  By default
    /// any CouchbaseReplication resources in the namespace will be considered.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replications: Option<CouchbaseClusterXdcrRemoteClustersReplications>,
    /// TLS if specified references a resource containing the necessary certificate
    /// data for an encrypted connection.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tls: Option<CouchbaseClusterXdcrRemoteClustersTls>,
    /// UUID of the remote cluster.  The UUID of a CouchbaseCluster resource
    /// is advertised in the status.clusterId field of the resource.
    pub uuid: String,
}

/// Replications are replication streams from this cluster to the remote one.
/// This field defines how to look up CouchbaseReplication resources.  By default
/// any CouchbaseReplication resources in the namespace will be considered.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterXdcrRemoteClustersReplications {
    /// Selector allows CouchbaseReplication resources to be filtered
    /// based on labels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<CouchbaseClusterXdcrRemoteClustersReplicationsSelector>,
}

/// Selector allows CouchbaseReplication resources to be filtered
/// based on labels.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterXdcrRemoteClustersReplicationsSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<CouchbaseClusterXdcrRemoteClustersReplicationsSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterXdcrRemoteClustersReplicationsSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values.
    /// Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn,
    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
    /// the values array must be empty. This array is replaced during a strategic
    /// merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// TLS if specified references a resource containing the necessary certificate
/// data for an encrypted connection.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterXdcrRemoteClustersTls {
    /// Secret references a secret containing the CA certificate (data key "ca"),
    /// and optionally a client certificate (data key "certificate") and key
    /// (data key "key").
    pub secret: String,
}

/// ClusterStatus defines any read-only status fields for the Couchbase server cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterStatus {
    /// Allocations shows memory allocations within server classes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub allocations: Option<Vec<CouchbaseClusterStatusAllocations>>,
    /// Autscalers describes all the autoscalers managed by the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub autoscalers: Option<Vec<String>>,
    /// Buckets describes all the buckets managed by the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub buckets: Option<Vec<CouchbaseClusterStatusBuckets>>,
    /// ClusterID is the unique cluster UUID.  This is generated every time
    /// a new cluster is created, so may vary over the lifetime of a cluster
    /// if it is recreated by disaster recovery mechanisms.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterId")]
    pub cluster_id: Option<String>,
    /// Current service state of the Couchbase cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// ControlPaused indicates if the Operator has acknowledged and paused the
    /// control of the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "controlPaused")]
    pub control_paused: Option<bool>,
    /// CurrentVersion is the current Couchbase version.  This reflects the
    /// version of the whole cluster, therefore during upgrade, it is only
    /// updated when the upgrade has completed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "currentVersion")]
    pub current_version: Option<String>,
    /// Groups describes all the groups managed by the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub groups: Option<Vec<String>>,
    /// LastUpdateTime is the time that the cluster object was last updated.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastUpdateTime")]
    pub last_update_time: Option<String>,
    /// Members are the Couchbase members in the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub members: Option<CouchbaseClusterStatusMembers>,
    /// Size is the current size of the cluster in terms of pods.  Individual
    /// pod status conditions are listed in the members status.
    pub size: i64,
    /// Users describes all the users managed by the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub users: Option<Vec<String>>,
}

/// ServerClassStatus summarizes memory allocations to make configuration easier.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterStatusAllocations {
    /// AllocatedMemory defines the total memory allocated for constrained Couchbase services.
    /// More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allocatedMemory")]
    pub allocated_memory: Option<String>,
    /// AllocatedMemoryPercent is set when memory resources are requested and define how much of
    /// the requested memory is allocated to constrained Couchbase services.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allocatedMemoryPercent")]
    pub allocated_memory_percent: Option<i64>,
    /// AnalyticsServiceAllocation is set when the analytics service is enabled for this class and
    /// defines how much memory this service consumes per pod.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsServiceAllocation")]
    pub analytics_service_allocation: Option<String>,
    /// DataServiceAllocation is set when the data service is enabled for this class and
    /// defines how much memory this service consumes per pod.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataServiceAllocation")]
    pub data_service_allocation: Option<String>,
    /// EventingServiceAllocation is set when the eventing service is enabled for this class and
    /// defines how much memory this service consumes per pod.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventingServiceAllocation")]
    pub eventing_service_allocation: Option<String>,
    /// IndexServiceAllocation is set when the index service is enabled for this class and
    /// defines how much memory this service consumes per pod.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "indexServiceAllocation")]
    pub index_service_allocation: Option<String>,
    /// Name is the name of the server class defined in spec.servers
    pub name: String,
    /// RequestedMemory, if set, defines the Kubernetes resource request for the server class.
    /// More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requestedMemory")]
    pub requested_memory: Option<String>,
    /// SearchServiceAllocation is set when the search service is enabled for this class and
    /// defines how much memory this service consumes per pod.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "searchServiceAllocation")]
    pub search_service_allocation: Option<String>,
    /// UnusedMemory is set when memory resources are requested and is the difference between
    /// the requestedMemory and allocatedMemory.  More info:
    /// <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "unusedMemory")]
    pub unused_memory: Option<String>,
    /// UnusedMemoryPercent is set when memory resources are requested and defines how much
    /// requested memory is not allocated.  Couchbase server expects at least a 20% overhead.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "unusedMemoryPercent")]
    pub unused_memory_percent: Option<i64>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterStatusBuckets {
    /// CompressionMode defines how documents are compressed.
    #[serde(rename = "compressionMode")]
    pub compression_mode: String,
    /// ConflictResolution is relevant for `couchbase` and `ephemeral` bucket types
    /// and indicates how to resolve conflicts when using multi-master XDCR.
    #[serde(rename = "conflictResolution")]
    pub conflict_resolution: String,
    /// EnableFlush is whether a client can delete all documents in a bucket.
    #[serde(rename = "enableFlush")]
    pub enable_flush: bool,
    /// EnableIndexReplica is whether indexes against bucket documents are replicated.
    #[serde(rename = "enableIndexReplica")]
    pub enable_index_replica: bool,
    /// EvictionPolicy is relevant for `couchbase` and `ephemeral` bucket types
    /// and indicates how documents are evicted from memory when it is exhausted.
    #[serde(rename = "evictionPolicy")]
    pub eviction_policy: String,
    /// IoPriority is `low` or `high` depending on the number of threads
    /// spawned for data processing.
    #[serde(rename = "ioPriority")]
    pub io_priority: String,
    /// BucketMemoryQuota is the bucket memory quota in megabytes.
    #[serde(rename = "memoryQuota")]
    pub memory_quota: i64,
    /// BucketName is the full name of the bucket.
    pub name: String,
    /// BucketPassword will never be populated.
    pub password: String,
    /// BucketReplicas is the number of data replicas.
    pub replicas: i64,
    /// BucketStorageBackend is the storage backend of the bucket.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageBackend")]
    pub storage_backend: Option<String>,
    /// BucketType is the type of the bucket.
    #[serde(rename = "type")]
    pub r#type: String,
}

/// Members are the Couchbase members in the cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CouchbaseClusterStatusMembers {
    /// Ready are the Couchbase members that are clustered and ready to serve
    /// client requests.  The member names are the same as the Couchbase pod names.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ready: Option<Vec<String>>,
    /// Unready are the Couchbase members not clustered or unready to serve
    /// client requests.  The member names are the same as the Couchbase pod names.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unready: Option<Vec<String>>,
}