Skip to content

Commit b081b11

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents 3050ded + d943b2e commit b081b11

File tree

3 files changed

+48
-10
lines changed

3 files changed

+48
-10
lines changed

connectors/postgres/k8s-docs/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,22 @@ The final link is the environment variable that instructs Redis Connect to use t
127127

128128
## 4. Configure the Redis Connect Deployment Manifests
129129

130-
Update both the `redis-connect-postgres-stage.yaml` and `redis-connect-postgres-start.yaml` to map the appropriate environment variables in the `env:` section. Notable, the `REDISCONNECT_SOURCE_USERNAME`, `REDISCONNECT_SOURCE_PASSWORD`, `REDISCONNECT_TARGET_USERNAME` and `REDISCONNECT_TARGET_PASSWORD`.
130+
Update both the `redis-connect-postgres-stage.yaml` and `redis-connect-postgres-start.yaml` to map the appropriate environment variables in the `env:` section. Notable, the `REDISCONNECT_SOURCE_USERNAME`, `REDISCONNECT_SOURCE_PASSWORD`, `REDISCONNECT_TARGET_USERNAME` and `REDISCONNECT_TARGET_PASSWORD`.
131+
132+
Examples are provided to populate environment variables from the manifest/yaml, from configmap, and from k8s secrets for sensitive info such as credentials:
133+
134+
```
135+
- name: REDISCONNECT_SOURCE_PASSWORD
136+
value: admin123
137+
# valueFrom:
138+
# configMapKeyRef:
139+
# key: REDISCONNECT_SOURCE_PASSWORD
140+
# name: redis-connect-postgres-config
141+
# valueFrom:
142+
# secretKeyRef:
143+
# key: password
144+
# name: redis-connect-secret
145+
```
131146

132147
## 5. Stage the Redis Connect Job
133148

connectors/postgres/k8s-docs/redis-connect-postgres-stage.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ spec:
1515
containers:
1616
- name: redis-connect-postgres # Container name
1717
image: redislabs/redis-connect-postgres:pre-release-alpine #repo/image:tag
18-
# #### comment out the following two lines for troubleshooting
18+
# #### uncomment the following two lines for troubleshooting
1919
# command: [ "/bin/bash", "-c", "--" ]
2020
# args: [ "while true; do sleep 30; done;" ]
2121
# ####
2222
command: [ "/opt/redislabs/redis-connect-postgres/bin/redisconnect.sh", "stage"]
2323
imagePullPolicy: Always # IfNotPresent # Always pull image
2424
resources:
2525
limits:
26-
cpu: "1000m"
27-
memory: "1024Mi"
28-
requests:
2926
cpu: "500m"
3027
memory: "256Mi"
28+
requests:
29+
cpu: "250m"
30+
memory: "256Mi"
3131
ports:
3232
- containerPort: 8282 # exposed container port to the REST API
3333
protocol: TCP
@@ -62,12 +62,20 @@ spec:
6262
# configMapKeyRef:
6363
# key: REDISCONNECT_SOURCE_USERNAME
6464
# name: redis-connect-postgres-config
65+
# valueFrom:
66+
# secretKeyRef:
67+
# key: username
68+
# name: redis-connect-secret
6569
- name: REDISCONNECT_SOURCE_PASSWORD
6670
value: admin123
6771
# valueFrom:
6872
# configMapKeyRef:
6973
# key: REDISCONNECT_SOURCE_PASSWORD
7074
# name: redis-connect-postgres-config
75+
# valueFrom:
76+
# secretKeyRef:
77+
# key: password
78+
# name: redis-connect-secret
7179
- name: REDISCONNECT_JAVA_OPTIONS
7280
value: "-XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1g"
7381
# valueFrom:

connectors/postgres/k8s-docs/redis-connect-postgres-start.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
labels:
66
app: redis-connect-postgres # deployment label
77
spec:
8-
replicas: 1 # a single replica pod
8+
replicas: 2 # replicas for HA
99
selector:
1010
matchLabels:
1111
app: redis-connect-postgres # which pods is the deployment managing, as defined by the pod template
@@ -14,17 +14,24 @@ spec:
1414
labels:
1515
app: redis-connect-postgres
1616
spec:
17+
affinity:
18+
podAntiAffinity:
19+
requiredDuringSchedulingIgnoredDuringExecution:
20+
- labelSelector:
21+
matchExpressions:
22+
- key: app
23+
operator: In
24+
values:
25+
- redis-connect-postgres # must match Deployment:metadata:labels:app
26+
topologyKey: "kubernetes.io/hostname"
1727
containers:
1828
- name: redis-connect-postgres # Container name
1929
image: redislabs/redis-connect-postgres:pre-release-alpine #repo/image:tag
20-
#### comment out the following two lines while you are setting up your
30+
#### uncomment the following two lines while you are setting up your
2131
# command: [ "/bin/bash", "-c", "--" ]
2232
# args: [ "while true; do sleep 30; done;" ]
2333
####
24-
####
25-
# command: [ "/opt/redislabs/redis-connect-postgres/bin/redisconnect.sh", "stage"]
2634
command: ["/opt/redislabs/redis-connect-postgres/bin/redisconnect.sh", "start"]
27-
####
2835
imagePullPolicy: Always # IfNotPresent # Always pull image
2936
resources:
3037
limits:
@@ -67,12 +74,20 @@ spec:
6774
# configMapKeyRef:
6875
# key: REDISCONNECT_SOURCE_USERNAME
6976
# name: redis-connect-postgres-config
77+
# valueFrom:
78+
# secretKeyRef:
79+
# key: username
80+
# name: redis-connect-secret
7081
- name: REDISCONNECT_SOURCE_PASSWORD
7182
value: admin123
7283
# valueFrom:
7384
# configMapKeyRef:
7485
# key: REDISCONNECT_SOURCE_PASSWORD
7586
# name: redis-connect-postgres-config
87+
# valueFrom:
88+
# secretKeyRef:
89+
# key: password
90+
# name: redis-connect-secret
7691
- name: REDISCONNECT_JAVA_OPTIONS
7792
value: "-XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1g"
7893
# valueFrom:

0 commit comments

Comments
 (0)