-
Notifications
You must be signed in to change notification settings - Fork 129
/
Copy pathshardSpecificPodSpec_migration.yaml
80 lines (77 loc) · 2.59 KB
/
shardSpecificPodSpec_migration.yaml
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
# This file is an example of how to migrate from the old deprecated ShardSpecificPodSpec field to the new
# shardOverrides fields, for single cluster deployments.
# The settings specified in shardOverrides are the exact equivalent to the ones in shardSpecificPodSpec, showing how
# to replicate them
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: shardspecificpodspec-migration
namespace: mongodb-test
spec:
# There are 4 shards in this cluster, but the shardSpecificPodSpec field doesn't need to have on entry per shard,
# it can have less
shardCount: 4
mongodsPerShardCount: 2
mongosCount: 1
configServerCount: 3
topology: SingleCluster
type: ShardedCluster
version: 8.0.3
opsManager:
configMapRef:
name: my-project
credentials: my-credentials
persistent: true
shardPodSpec:
# default persistence configuration for all shards in all clusters
persistence:
single:
storage: "5G"
shardSpecificPodSpec: # deprecated way of overriding shards (array)
- persistence: # shard of index 0
single:
storage: "6G"
podTemplate: # Specify resources settings to enterprise database container in shard 0
spec:
containers:
- name: mongodb-enterprise-database
resources:
requests:
cpu: 0.5
memory: 1G
limits:
cpu: 1.0
memory: 2.0G
- persistence: # shard of index 1
single:
storage: "7G"
- persistence: # shard of index 2
single:
storage: "7G"
# The below shardOverrides replicate the same shards configuration as the one specified above in shardSpecificPodSpec
shardOverrides:
- shardNames: [ "shardspecificpodspec-migration-0" ] # overriding shard #0
podSpec:
persistence:
single:
storage: "6G"
statefulSet:
spec:
template:
spec:
containers:
- name: mongodb-enterprise-database
resources:
requests:
cpu: 0.5
memory: 1G
limits:
cpu: 1.0
memory: 2.0G
# The ShardSpecificPodSpec field above has the same configuration for shards 1 and 2. It is possible
# to specify both shard names in the override and not duplicate that configuration
- shardNames: [ "shardspecificpodspec-migration-1", "shardspecificpodspec-migration-2" ]
podSpec:
persistence:
single:
storage: "7G"