Skip to content

Commit fc3cfdb

Browse files
committed
clowder: run migrations in a separate container
1 parent 4bed70a commit fc3cfdb

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

openshift/clowder/clowd-app.yaml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,83 @@ objects:
110110
enabled: true
111111
apiPath: automation-hub
112112

113+
- name: "migration${SUFFIX}"
114+
minReplicas: ${{MIGRATION_REPLICAS}}
115+
podSpec:
116+
name: migration
117+
image: ${IMAGE_NAME}:${IMAGE_TAG}
118+
args: ['bash', '-c', 'while true; do sleep 86400; done']
119+
initContainers:
120+
- args: ['manage', 'migrate']
121+
inheritEnv: true
122+
resources:
123+
limits:
124+
cpu: ${{MIGRATION_CPU_LIMIT}}
125+
memory: ${{MIGRATION_MEMORY_LIMIT}}
126+
requests:
127+
cpu: ${{MIGRATION_CPU_REQUEST}}
128+
memory: ${{MIGRATION_MEMORY_REQUEST}}
129+
livenessProbe:
130+
exec:
131+
command:
132+
- date
133+
initialDelaySeconds: 30
134+
timeoutSeconds: 10
135+
periodSeconds: 30
136+
successThreshold: 1
137+
failureThreshold: 6
138+
readinessProbe:
139+
exec:
140+
command:
141+
- date
142+
initialDelaySeconds: 30
143+
timeoutSeconds: 1
144+
periodSeconds: 30
145+
successThreshold: 1
146+
failureThreshold: 3
147+
env:
148+
- name: PULP_GALAXY_DEPLOYMENT_MODE
149+
value: 'insights'
150+
- name: PULP_CONTENT_ORIGIN
151+
value: ${{CONTENT_ORIGIN}}
152+
- name: PULP_CONTENT_PATH_PREFIX
153+
value: /api/automation-hub/pulp/content/
154+
- name: ENABLE_SIGNING
155+
value: ${ENABLE_SIGNING}
156+
- name: GNUPGHOME
157+
value: ${GNUPGHOME}
158+
volumeMounts:
159+
- name: pulp-key
160+
mountPath: /etc/pulp/certs/database_fields.symmetric.key
161+
subPath: database_fields.symmetric.key
162+
readOnly: true
163+
- name: signing-gpg-key
164+
mountPath: /tmp/ansible-sign.key
165+
subPath: ansible-sign.key
166+
readOnly: true
167+
- name: signing-script
168+
mountPath: /var/lib/pulp/scripts
169+
readOnly: true
170+
volumes:
171+
- name: pulp-key
172+
secret:
173+
secretName: pulp-key
174+
- name: signing-gpg-key
175+
secret:
176+
secretName: signing-gpg-key
177+
- name: signing-script
178+
secret:
179+
defaultMode: 0555
180+
secretName: signing-script
181+
113182
- name: "galaxy-api${SUFFIX}"
114183
minReplicas: ${{GALAXY_API_REPLICAS}}
115184
podSpec:
116185
name: galaxy-api
117186
image: ${IMAGE_NAME}:${IMAGE_TAG}
118187
args: ['run', 'api']
119188
initContainers:
120-
- args: ['manage', 'migrate']
189+
- args: ['wait-for-migrations']
121190
inheritEnv: true
122191
resources:
123192
limits:
@@ -436,6 +505,18 @@ parameters:
436505
- name: NGINX_CPU_LIMIT
437506
value: 200m
438507

508+
# migration resource requirements
509+
- name: MIGRATION_REPLICAS
510+
value: '1'
511+
- name: MIGRATION_MEMORY_REQUEST
512+
value: 1Gi
513+
- name: MIGRATION_MEMORY_LIMIT
514+
value: 2Gi
515+
- name: MIGRATION_CPU_REQUEST
516+
value: 200m
517+
- name: MIGRATION_CPU_LIMIT
518+
value: '1'
519+
439520
# galaxy-api resource requirements
440521
- name: GALAXY_API_REPLICAS
441522
value: '1'

0 commit comments

Comments
 (0)