Skip to content

Commit 118fc4c

Browse files
authored
Merge pull request #154 from RedisLabs/6.0.12-5
promote 6.0.12-5
2 parents 0c5c1c1 + b2879e1 commit 118fc4c

26 files changed

+369
-120
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.idea
1+
.idea

README.md

Lines changed: 171 additions & 67 deletions
Large diffs are not rendered by default.

admission.bundle.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ spec:
5757
serviceAccountName: redis-enterprise-admission
5858
containers:
5959
- name: admin
60-
image: redislabs/operator:6.0.8-20
60+
image: redislabs/operator:6.0.12-5
6161
command:
6262
- /usr/local/bin/admission
6363
imagePullPolicy: Always
@@ -86,7 +86,7 @@ spec:
8686
scheme: HTTPS
8787
initContainers:
8888
- name: admin-init
89-
image: redislabs/operator:6.0.8-20
89+
image: redislabs/operator:6.0.12-5
9090
command:
9191
- /usr/local/bin/admission
9292
args:

admission/GESHER.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ This will deploy the admission proxy, and via an included **NamespacedValidating
8686
8787
8. Deployment for the Gesher operator
8888
89-
**Note:** if one is using openshift, one should replace `operator.yaml` with `operator.openshift.yaml`
89+
**Note:** if one is using openshift, one should replace `operator.yaml` with `operator.openshift.yaml`
9090
9191
```shell script
9292
kubectl apply -f gesher/operator.yaml
@@ -239,12 +239,14 @@ $ kubectl apply -f - << EOF
239239
apiVersion: app.redislabs.com/v1alpha1
240240
kind: RedisEnterpriseDatabase
241241
metadata:
242-
name: test-database-custom-resource
242+
name: redis-enterprise-database
243+
spec:
244+
evictionPolicy: illegal
243245
EOF
244246
```
245247
246-
This must fail with an error output by the admission webhook redb.admisison.redislabs that is being denied because it can't get the login credentials for the Redis Enterprise Cluster as none were specified.
248+
This must fail with an error output by the admission webhook proxy.webhook.gesher that is being denied because 'illegal' is not a valid eviction policy.
247249
248250
```shell script
249-
Error from server: error when creating "STDIN": admission webhook "proxy.webhook.gesher" denied the request: proxied webhook webhook denied the request: failed get RedisEnterpriseCluster client: custom resource (RedisEnterpriseCluster) not found: resource name may not be empty
250-
```
251+
Error from server: error when creating "STDIN": admission webhook "proxy.webhook.gesher" denied the request: proxied webhook webhook denied the request: eviction_policy: u'illegal' is not one of [u'volatile-lru', u'volatile-ttl', u'volatile-random', u'allkeys-lru', u'allkeys-random', u'noeviction', u'volatile-lfu', u'allkeys-lfu']
252+
```

admission/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
serviceAccountName: redis-enterprise-admission
1515
containers:
1616
- name: admin
17-
image: redislabs/operator:6.0.8-20
17+
image: redislabs/operator:6.0.12-5
1818
command:
1919
- /usr/local/bin/admission
2020
imagePullPolicy: Always
@@ -43,7 +43,7 @@ spec:
4343
scheme: HTTPS
4444
initContainers:
4545
- name: admin-init
46-
image: redislabs/operator:6.0.8-20
46+
image: redislabs/operator:6.0.12-5
4747
command:
4848
- /usr/local/bin/admission
4949
args:

advanced/psp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: policy/v1beta1
22
kind: PodSecurityPolicy
33
metadata:
44
name: redis-enterprise-psp

bundle.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rules:
2323
resources: ["events"]
2424
verbs: ["create"]
2525
- apiGroups: ["apps"]
26-
resources: ["deployments", "statefulsets"]
26+
resources: ["deployments", "statefulsets", "replicasets"]
2727
verbs: ["*"]
2828
- apiGroups: ["policy"]
2929
resources: ["poddisruptionbudgets"]
@@ -1772,7 +1772,7 @@ spec:
17721772
serviceAccountName: redis-enterprise-operator
17731773
containers:
17741774
- name: redis-enterprise-operator
1775-
image: redislabs/operator:6.0.8-20
1775+
image: redislabs/operator:6.0.12-5
17761776
command:
17771777
- redis-enterprise-operator
17781778
imagePullPolicy: Always
@@ -2123,6 +2123,9 @@ spec:
21232123
description: The name of the K8s secret that holds the password to the
21242124
database.
21252125
type: string
2126+
defaultUser:
2127+
description: Is connecting with a default user allowed?
2128+
type: boolean
21262129
evictionPolicy:
21272130
description: Database eviction policy. see more https://docs.redislabs.com/latest/rs/administering/database-operations/eviction-policy/
21282131
type: string
@@ -2213,6 +2216,26 @@ spec:
22132216
description: In-memory database replication. When enabled, database
22142217
will have replica shard for every master - leading to higher availability.
22152218
type: boolean
2219+
rolesPermissions:
2220+
description: List of Redis Enteprise ACL and Role bindings to apply
2221+
items:
2222+
description: Redis Enterprise Role and ACL Binding
2223+
properties:
2224+
acl:
2225+
description: Acl Name of RolePermissionType
2226+
type: string
2227+
role:
2228+
description: Role Name of RolePermissionType
2229+
type: string
2230+
type:
2231+
description: Type of Redis Enterprise Database Role Permission
2232+
type: string
2233+
required:
2234+
- acl
2235+
- role
2236+
- type
2237+
type: object
2238+
type: array
22162239
shardCount:
22172240
description: Number of database server-side shards
22182241
type: integer
File renamed without changes.

crds/app_v1alpha1_redisenterprisecluster_crd.yaml renamed to crds/v1alpha1/rec_crd.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ kind: CustomResourceDefinition
33
metadata:
44
name: redisenterpriseclusters.app.redislabs.com
55
spec:
6+
additionalPrinterColumns:
7+
- JSONPath: .spec.nodes
8+
name: Nodes
9+
type: string
10+
- JSONPath: .spec.redisEnterpriseImageSpec.versionTag
11+
name: Version
12+
type: string
13+
- JSONPath: .status.state
14+
name: State
15+
type: string
16+
- JSONPath: .status.specStatus
17+
name: Spec Status
18+
type: string
19+
- JSONPath: .status.licenseStatus.licenseState
20+
name: License State
21+
type: string
22+
- JSONPath: .status.licenseStatus.shardsLimit
23+
name: Shards Limit
24+
type: string
25+
- JSONPath: .status.licenseStatus.expirationDate
26+
name: License Expiration Date
27+
type: string
28+
- name: Age
29+
type: date
30+
JSONPath: .metadata.creationTimestamp
631
group: app.redislabs.com
732
names:
833
kind: RedisEnterpriseCluster

crds/app_v1alpha1_redisenterprisedatabase_crd.yaml renamed to crds/v1alpha1/redb_crd.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ spec:
324324
description: The name of the K8s secret that holds the password to the
325325
database.
326326
type: string
327+
defaultUser:
328+
description: Is connecting with a default user allowed?
329+
type: boolean
327330
evictionPolicy:
328331
description: Database eviction policy. see more https://docs.redislabs.com/latest/rs/administering/database-operations/eviction-policy/
329332
type: string
@@ -414,6 +417,26 @@ spec:
414417
description: In-memory database replication. When enabled, database
415418
will have replica shard for every master - leading to higher availability.
416419
type: boolean
420+
rolesPermissions:
421+
description: List of Redis Enteprise ACL and Role bindings to apply
422+
items:
423+
description: Redis Enterprise Role and ACL Binding
424+
properties:
425+
acl:
426+
description: Acl Name of RolePermissionType
427+
type: string
428+
role:
429+
description: Role Name of RolePermissionType
430+
type: string
431+
type:
432+
description: Type of Redis Enterprise Database Role Permission
433+
type: string
434+
required:
435+
- acl
436+
- role
437+
- type
438+
type: object
439+
type: array
417440
shardCount:
418441
description: Number of database server-side shards
419442
type: integer
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: app.redislabs.com/v1
22
kind: RedisEnterpriseCluster
33
metadata:
4-
name: "redis-enterprise"
4+
name: rec
55
spec:
66
# Add fields here
77
nodes: 3

log_collector/log_collector.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,23 @@ def make_dir(directory):
7676
sys.exit()
7777

7878

79+
def _filter_non_existing_namespaces(namespaces):
80+
"""
81+
Filter non-existing namespaces from user's input
82+
"""
83+
return_code, out = run_shell_command("kubectl get ns -o=custom-columns='DATA:metadata.name' --no-headers=true")
84+
if return_code:
85+
return []
86+
res = []
87+
existing_namespaces = set(out.split())
88+
for ns in namespaces:
89+
if ns in existing_namespaces:
90+
res.append(ns)
91+
else:
92+
logger.warning("Namespace %s doesn't exist - Skipping", ns)
93+
return res
94+
95+
7996
def _get_namespaces_to_run_on(namespace):
8097
def _get_namespace_from_config():
8198
config_namespace = get_namespace_from_config()
@@ -94,7 +111,12 @@ def _get_namespace_from_config():
94111
return out.split()
95112

96113
# comma separated string
97-
return namespace.split(',')
114+
namespaces = namespace.split(',')
115+
existing_namespaces = _filter_non_existing_namespaces(namespaces)
116+
if not existing_namespaces:
117+
logger.warning("Input doesn't contain an existing namespace - will use namespace from config")
118+
return _get_namespace_from_config()
119+
return existing_namespaces
98120

99121

100122
def collect_from_ns(namespace, output_dir):
@@ -168,11 +190,10 @@ def collect_pod_rs_logs(namespace, output_dir):
168190
get logs from rs pods that are not ready
169191
"""
170192
rs_pod_logs_dir = os.path.join(output_dir, "rs_pod_logs")
171-
non_ready_rs_pod_names = get_non_ready_rs_pod_names(namespace)
172-
if not non_ready_rs_pod_names:
173-
return
193+
rs_pod_names = get_pod_names(namespace=namespace, selector='redis.io/role=node')
174194
make_dir(rs_pod_logs_dir)
175-
for rs_pod_name in non_ready_rs_pod_names:
195+
# TODO restore usage of get_non_ready_rs_pod_names once RS bug is resolved (RED-51857) # pylint: disable=W0511
196+
for rs_pod_name in rs_pod_names:
176197
pod_log_dir = os.path.join(rs_pod_logs_dir, rs_pod_name)
177198
make_dir(pod_log_dir)
178199
cmd = "kubectl -n {} cp {}:{} {} -c {}".format(namespace,

multi-namespace-redb/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ subjects:
4545
- kind: ServiceAccount
4646
name: redis-enterprise-operator
4747
namespace: NAMESPACE_OF_SERVICE_ACCOUNT
48+
- kind: ServiceAccount
49+
name: redis-enterprise-admission
50+
namespace: NAMESPACE_OF_SERVICE_ACCOUNT
4851
- kind: ServiceAccount
4952
name: NAME_OF_REC_SERVICE_ACCOUNT # service account of the REC, usually the same as the name of the custom resource
5053
namespace: NAMESPACE_OF_SERVICE_ACCOUNT

multi-namespace-redb/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
serviceAccountName: redis-enterprise-operator
1616
containers:
1717
- name: redis-enterprise-operator
18-
image: redislabs/operator-internal:6.0.8-20
18+
image: redislabs/operator:6.0.12-5
1919
command:
2020
- redis-enterprise-operator
2121
imagePullPolicy: Always

openshift.bundle.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ rules:
3939
resources: ["events"]
4040
verbs: ["create"]
4141
- apiGroups: ["apps"]
42-
resources: ["deployments", "statefulsets"]
42+
resources: ["deployments", "statefulsets", "replicasets"]
4343
verbs: ["*"]
4444
- apiGroups: ["policy"]
4545
resources: ["poddisruptionbudgets"]
@@ -1788,7 +1788,7 @@ spec:
17881788
serviceAccount: redis-enterprise-operator
17891789
containers:
17901790
- name: redis-enterprise-operator
1791-
image: redislabs/operator:6.0.8-20
1791+
image: redislabs/operator:6.0.12-5
17921792
securityContext:
17931793
runAsUser: 1001
17941794
command:
@@ -2139,6 +2139,9 @@ spec:
21392139
description: The name of the K8s secret that holds the password to the
21402140
database.
21412141
type: string
2142+
defaultUser:
2143+
description: Is connecting with a default user allowed?
2144+
type: boolean
21422145
evictionPolicy:
21432146
description: Database eviction policy. see more https://docs.redislabs.com/latest/rs/administering/database-operations/eviction-policy/
21442147
type: string
@@ -2229,6 +2232,26 @@ spec:
22292232
description: In-memory database replication. When enabled, database
22302233
will have replica shard for every master - leading to higher availability.
22312234
type: boolean
2235+
rolesPermissions:
2236+
description: List of Redis Enteprise ACL and Role bindings to apply
2237+
items:
2238+
description: Redis Enterprise Role and ACL Binding
2239+
properties:
2240+
acl:
2241+
description: Acl Name of RolePermissionType
2242+
type: string
2243+
role:
2244+
description: Role Name of RolePermissionType
2245+
type: string
2246+
type:
2247+
description: Type of Redis Enterprise Database Role Permission
2248+
type: string
2249+
required:
2250+
- acl
2251+
- role
2252+
- type
2253+
type: object
2254+
type: array
22322255
shardCount:
22332256
description: Number of database server-side shards
22342257
type: integer

openshift/operator_rhel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
serviceAccount: redis-enterprise-operator
1616
containers:
1717
- name: redis-enterprise-operator
18-
image: redislabs/operator:6.0.8-20
18+
image: redislabs/operator:6.0.12-5
1919
securityContext:
2020
runAsUser: 1001
2121
command:

openshift/rec_rhel.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: app.redislabs.com/v1
2+
kind: RedisEnterpriseCluster
3+
metadata:
4+
name: rec
5+
spec:
6+
# Add fields here
7+
nodes: 3
8+
redisEnterpriseImageSpec:
9+
repository: registry.connect.redhat.com/redislabs/redis-enterprise
10+
versionTag: 6.0.12-57.rhel7-openshift
11+
redisEnterpriseServicesRiggerImageSpec:
12+
repository: registry.connect.redhat.com/redislabs/services-manager
13+
bootstrapperImageSpec:
14+
repository: registry.connect.redhat.com/redislabs/redis-enterprise-operator

openshift/redis-enterprise-cluster_rhel.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

openshift/role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rules:
2222
resources: ["events"]
2323
verbs: ["create"]
2424
- apiGroups: ["apps"]
25-
resources: ["deployments", "statefulsets"]
25+
resources: ["deployments", "statefulsets", "replicasets"]
2626
verbs: ["*"]
2727
- apiGroups: ["policy"]
2828
resources: ["poddisruptionbudgets"]

0 commit comments

Comments
 (0)