Skip to content

Commit 10b1700

Browse files
authored
Syncthing Improvements (#1378)
* DBC22-6710: Add DB Retention Interval to Syncthing * DBC22-6712: Add retry to OpenShift login * DBC22-6715: Add CPU Limit to Syncthing * DBC22-6667: Update oauth-proxy to 4.18
1 parent 44b12bf commit 10b1700

6 files changed

Lines changed: 42 additions & 10 deletions

File tree

.github/actions/oc-setup/action.yaml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,27 @@ runs:
3131
3232
- name: Authenticate and set project
3333
shell: bash
34-
env:
35-
OC_SERVER: ${{ inputs.server }}
36-
OC_TOKEN: ${{ inputs.token }}
37-
OC_NAMESPACE: ${{ inputs.namespace }}
3834
run: |
39-
oc login --server="$OC_SERVER" --token="$OC_TOKEN"
40-
oc project "$OC_NAMESPACE"
35+
attempt=1
36+
max_attempts=3
37+
38+
until [ $attempt -gt $max_attempts ]
39+
do
40+
echo "Attempt $attempt of $max_attempts..."
41+
42+
if oc login --server=${{ inputs.server }} --token=${{ inputs.token }} \
43+
&& oc project ${{ inputs.namespace }}; then
44+
echo "Login successful"
45+
break
46+
fi
47+
48+
if [ $attempt -eq $max_attempts ]; then
49+
echo "All attempts failed"
50+
exit 1
51+
fi
52+
53+
echo "Login failed. Retrying in 30 seconds..."
54+
sleep 30
55+
56+
attempt=$((attempt+1))
57+
done

infrastructure/syncthing/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ spec:
2525
cpu: {{ .Values.deployment.resources.requests.cpu }}
2626
memory: {{ .Values.deployment.resources.requests.memory }}
2727
limits:
28+
cpu: {{ .Values.deployment.resources.limits.cpu }}
2829
memory: {{ .Values.deployment.resources.limits.memory }}
2930
securityContext:
3031
seccompProfile:
@@ -42,6 +43,8 @@ spec:
4243
env:
4344
- name: STTRACE
4445
value: "connections:ERROR,model:WARN"
46+
- name: STDBDELETERETENTIONINTERVAL
47+
value: {{ .Values.deployment.env.dbretention }}
4548
- name: oauth-proxy
4649
image: {{ .Values.deployment.oAuthProxy.image.repository }}:{{ .Values.deployment.oAuthProxy.image.tag }}
4750
imagePullPolicy: Always

infrastructure/syncthing/values-dev.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ deployment:
1414
cpu: 200m
1515
memory: 750Mi
1616
limits:
17+
cpu: 1000m # Syncthing should have a CPU Limit as it has been known to use all available CPU on the node if not limited.
1718
memory: 1Gi
1819
volumeMounts: # List of volume mounts for the deployment. Can add as many as needed.
1920
- name: dev-drivebc-syncthing
@@ -28,11 +29,13 @@ deployment:
2829
mountPath: /app/images/webcams
2930
persistentVolumeClaim:
3031
claimName: dev-drivebc-django-app-images
32+
env:
33+
dbretention: "168h" # 7 days. This is the interval for how long Syncthing will keep deleted files in the database before permanently deleting them.
3134
oAuthProxy:
3235
enabled: true
3336
image:
3437
repository: registry.redhat.io/openshift4/ose-oauth-proxy-rhel9
35-
tag: v4.16
38+
tag: v4.18
3639
resources:
3740
requests:
3841
cpu: 5m

infrastructure/syncthing/values-prod.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ deployment:
1414
cpu: 350m
1515
memory: 1Gi
1616
limits:
17+
cpu: 1000m # Syncthing should have a CPU Limit as it has been known to use all available CPU on the node if not limited.
1718
memory: 1Gi
1819
volumeMounts: # List of volume mounts for the deployment. Can add as many as needed.
1920
- name: prod-drivebc-syncthing
@@ -28,11 +29,13 @@ deployment:
2829
mountPath: /app/images/webcams
2930
persistentVolumeClaim:
3031
claimName: prod-drivebc-django-app-images
32+
env:
33+
dbretention: "168h" # 7 days. This is the interval for how long Syncthing will keep deleted files in the database before permanently deleting them.
3134
oAuthProxy:
3235
enabled: true
3336
image:
3437
repository: registry.redhat.io/openshift4/ose-oauth-proxy-rhel9
35-
tag: v4.16
38+
tag: v4.18
3639
resources:
3740
requests:
3841
cpu: 5m

infrastructure/syncthing/values-test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ deployment:
1414
cpu: 200m
1515
memory: 750Mi
1616
limits:
17+
cpu: 1000m # Syncthing should have a CPU Limit as it has been known to use all available CPU on the node if not limited.
1718
memory: 1Gi
1819
volumeMounts: # List of volume mounts for the deployment. Can add as many as needed.
1920
- name: test-drivebc-syncthing
@@ -28,11 +29,13 @@ deployment:
2829
mountPath: /app/images/webcams
2930
persistentVolumeClaim:
3031
claimName: test-drivebc-django-app-images
32+
env:
33+
dbretention: "168h" # 7 days. This is the interval for how long Syncthing will keep deleted files in the database before permanently deleting them.
3134
oAuthProxy:
3235
enabled: true
3336
image:
3437
repository: registry.redhat.io/openshift4/ose-oauth-proxy-rhel9
35-
tag: v4.16
38+
tag: v4.18
3639
resources:
3740
requests:
3841
cpu: 5m

infrastructure/syncthing/values-uat.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ deployment:
1414
cpu: 250m
1515
memory: 750Mi
1616
limits:
17+
cpu: 1000m # Syncthing should have a CPU Limit as it has been known to use all available CPU on the node if not limited.
1718
memory: 1Gi
1819
volumeMounts: # List of volume mounts for the deployment. Can add as many as needed.
1920
- name: uat-drivebc-syncthing
@@ -28,11 +29,13 @@ deployment:
2829
mountPath: /app/images/webcams
2930
persistentVolumeClaim:
3031
claimName: uat-drivebc-django-app-images
32+
env:
33+
dbretention: "168h" # 7 days. This is the interval for how long Syncthing will keep deleted files in the database before permanently deleting them.
3134
oAuthProxy:
3235
enabled: true
3336
image:
3437
repository: registry.redhat.io/openshift4/ose-oauth-proxy-rhel9
35-
tag: v4.16
38+
tag: v4.18
3639
resources:
3740
requests:
3841
cpu: 5m

0 commit comments

Comments
 (0)