Skip to content

Commit 098b0d7

Browse files
gkechhors
andauthored
K8SPSMDB-1359 control the disabling of the authorization through mongo config (#2144)
* K8SPSMDB-1359 control the disabling of the authorization through mongo config * add tests * improve logic for cr check * improve comment * bring back the auth order * restore default cr * remove one pod test changes * when auth is disabled, skip tls config * remove tls disabling if auth is disabled * add e2e test structure * fixes for the auth configuration, tls and clusterAuthMode * adjustments * add user on the list to be created when cluster started from no auth * fixes for the role of user admin * remove creating the user again * add fixes for e2e test * add empty lines * run e2e test as part of pr and release pipelines * cr: improve custom replset name configuration impl * remove sleeps from e2e test --------- Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent 3b79001 commit 098b0d7

File tree

17 files changed

+532
-30
lines changed

17 files changed

+532
-30
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
switched to db myApp
2+
{ "_id" : , "x" : 100500 }
3+
{ "_id" : , "x" : 200500 }
4+
{ "_id" : , "x" : 200501 }
5+
bye
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
switched to db myApp
2+
{ "_id" : , "x" : 100500 }
3+
{ "_id" : , "x" : 100501 }
4+
bye
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
switched to db myApp
2+
{ "_id" : , "x" : 100500 }
3+
{ "_id" : , "x" : 200500 }
4+
bye
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
switched to db myApp
2+
{ "_id" : , "x" : 100500 }
3+
bye
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
switched to db myApp
2+
{ "_id" : , "x" : 100500 }
3+
bye
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: psmdb.percona.com/v1
2+
kind: PerconaServerMongoDBBackup
3+
metadata:
4+
finalizers:
5+
- percona.com/delete-backup
6+
name: backup-minio
7+
spec:
8+
clusterName: some-name
9+
storageName: minio
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
apiVersion: psmdb.percona.com/v1
2+
kind: PerconaServerMongoDB
3+
metadata:
4+
name: some-name
5+
spec:
6+
image:
7+
imagePullPolicy: Always
8+
updateStrategy: SmartUpdate
9+
secrets:
10+
users: some-users
11+
tls:
12+
mode: disabled
13+
unsafeFlags:
14+
tls: true
15+
backup:
16+
enabled: true
17+
image: perconalab/percona-server-mongodb-operator:1.1.0-backup
18+
storages:
19+
minio:
20+
type: s3
21+
s3:
22+
credentialsSecret: minio-secret
23+
region: us-east-1
24+
bucket: operator-testing
25+
endpointUrl: http://minio-service:9000/
26+
insecureSkipTLSVerify: false
27+
sharding:
28+
enabled: true
29+
configsvrReplSet:
30+
size: 3
31+
affinity:
32+
antiAffinityTopologyKey: none
33+
configuration: |
34+
net:
35+
port: 27018
36+
security:
37+
authorization: disabled
38+
volumeSpec:
39+
persistentVolumeClaim:
40+
resources:
41+
requests:
42+
storage: 3Gi
43+
expose:
44+
enabled: true
45+
type: ClusterIP
46+
47+
mongos:
48+
size: 3
49+
affinity:
50+
antiAffinityTopologyKey: none
51+
configuration: |
52+
net:
53+
port: 27019
54+
expose:
55+
type: ClusterIP
56+
57+
replsets:
58+
- name: rs0
59+
affinity:
60+
antiAffinityTopologyKey: none
61+
expose:
62+
enabled: true
63+
type: ClusterIP
64+
resources:
65+
limits:
66+
cpu: 500m
67+
memory: 1G
68+
requests:
69+
cpu: 100m
70+
memory: 0.1G
71+
volumeSpec:
72+
persistentVolumeClaim:
73+
resources:
74+
requests:
75+
storage: 1Gi
76+
size: 3
77+
configuration: |
78+
net:
79+
port: 27016
80+
security:
81+
authorization: disabled
82+
- name: rs1
83+
affinity:
84+
antiAffinityTopologyKey: none
85+
expose:
86+
enabled: true
87+
type: ClusterIP
88+
resources:
89+
limits:
90+
cpu: 500m
91+
memory: 1G
92+
requests:
93+
cpu: 100m
94+
memory: 0.1G
95+
volumeSpec:
96+
persistentVolumeClaim:
97+
resources:
98+
requests:
99+
storage: 1Gi
100+
size: 3
101+
configuration: |
102+
net:
103+
port: 27016
104+
security:
105+
authorization: disabled
106+
- name: rs2
107+
affinity:
108+
antiAffinityTopologyKey: none
109+
expose:
110+
enabled: true
111+
type: ClusterIP
112+
resources:
113+
limits:
114+
cpu: 500m
115+
memory: 1G
116+
requests:
117+
cpu: 100m
118+
memory: 0.1G
119+
volumeSpec:
120+
persistentVolumeClaim:
121+
resources:
122+
requests:
123+
storage: 1Gi
124+
size: 3
125+
configuration: |
126+
net:
127+
port: 27016
128+
security:
129+
authorization: disabled
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
apiVersion: psmdb.percona.com/v1
2+
kind: PerconaServerMongoDB
3+
metadata:
4+
name: some-name
5+
spec:
6+
image:
7+
imagePullPolicy: Always
8+
updateStrategy: SmartUpdate
9+
secrets:
10+
users: some-users
11+
tls:
12+
mode: preferTLS
13+
backup:
14+
enabled: true
15+
image: perconalab/percona-server-mongodb-operator:1.1.0-backup
16+
storages:
17+
minio:
18+
type: s3
19+
s3:
20+
credentialsSecret: minio-secret
21+
region: us-east-1
22+
bucket: operator-testing
23+
endpointUrl: http://minio-service:9000/
24+
insecureSkipTLSVerify: false
25+
sharding:
26+
enabled: true
27+
28+
configsvrReplSet:
29+
size: 3
30+
affinity:
31+
antiAffinityTopologyKey: none
32+
configuration: |
33+
net:
34+
port: 27018
35+
volumeSpec:
36+
persistentVolumeClaim:
37+
resources:
38+
requests:
39+
storage: 3Gi
40+
expose:
41+
enabled: true
42+
type: ClusterIP
43+
44+
mongos:
45+
size: 3
46+
affinity:
47+
antiAffinityTopologyKey: none
48+
configuration: |
49+
net:
50+
port: 27019
51+
expose:
52+
type: ClusterIP
53+
54+
replsets:
55+
- name: rs0
56+
affinity:
57+
antiAffinityTopologyKey: none
58+
expose:
59+
enabled: true
60+
type: ClusterIP
61+
resources:
62+
limits:
63+
cpu: 500m
64+
memory: 1G
65+
requests:
66+
cpu: 100m
67+
memory: 0.1G
68+
volumeSpec:
69+
persistentVolumeClaim:
70+
resources:
71+
requests:
72+
storage: 1Gi
73+
size: 3
74+
configuration: |
75+
net:
76+
port: 27016
77+
- name: rs1
78+
affinity:
79+
antiAffinityTopologyKey: none
80+
expose:
81+
enabled: true
82+
type: ClusterIP
83+
resources:
84+
limits:
85+
cpu: 500m
86+
memory: 1G
87+
requests:
88+
cpu: 100m
89+
memory: 0.1G
90+
volumeSpec:
91+
persistentVolumeClaim:
92+
resources:
93+
requests:
94+
storage: 1Gi
95+
size: 3
96+
configuration: |
97+
net:
98+
port: 27016
99+
- name: rs2
100+
affinity:
101+
antiAffinityTopologyKey: none
102+
expose:
103+
enabled: true
104+
type: ClusterIP
105+
resources:
106+
limits:
107+
cpu: 500m
108+
memory: 1G
109+
requests:
110+
cpu: 100m
111+
memory: 0.1G
112+
volumeSpec:
113+
persistentVolumeClaim:
114+
resources:
115+
requests:
116+
storage: 1Gi
117+
size: 3
118+
configuration: |
119+
net:
120+
port: 27016
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: psmdb.percona.com/v1
2+
kind: PerconaServerMongoDBRestore
3+
metadata:
4+
name:
5+
spec:
6+
clusterName: some-name
7+
backupName:

0 commit comments

Comments
 (0)