-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adjustments for k8s deployment (#7531)
* chore: handle TERM in datatracker-start.sh * chore: delay celery start if migration needed * chore: skip-checks when migrating * chore: label beat/celery as deleteBeforeUpgrade Used by the infra-k8s deployment process to flag these as needing to be shut down before a new release rolls out. * chore: increase termination grace periods
- Loading branch information
1 parent
bdc4b61
commit c1941df
Showing
5 changed files
with
171 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,63 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: beat | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: beat | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: beat | ||
spec: | ||
securityContext: | ||
runAsNonRoot: true | ||
containers: | ||
- name: beat | ||
image: "ghcr.io/ietf-tools/datatracker:$APP_IMAGE_TAG" | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8000 | ||
name: http | ||
protocol: TCP | ||
volumeMounts: | ||
- name: dt-vol | ||
mountPath: /a | ||
- name: dt-tmp | ||
mountPath: /tmp | ||
- name: dt-cfg | ||
mountPath: /workspace/ietf/settings_local.py | ||
subPath: settings_local.py | ||
env: | ||
- name: "CONTAINER_ROLE" | ||
value: "beat" | ||
envFrom: | ||
- configMapRef: | ||
name: django-config | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
volumes: | ||
# To be overriden with the actual shared volume | ||
- name: dt-vol | ||
- name: dt-tmp | ||
emptyDir: | ||
sizeLimit: "2Gi" | ||
- name: dt-cfg | ||
configMap: | ||
name: files-cfgmap | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 30 | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: beat | ||
labels: | ||
deleteBeforeUpgrade: yes | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: beat | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: beat | ||
spec: | ||
securityContext: | ||
runAsNonRoot: true | ||
containers: | ||
- name: beat | ||
image: "ghcr.io/ietf-tools/datatracker:$APP_IMAGE_TAG" | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8000 | ||
name: http | ||
protocol: TCP | ||
volumeMounts: | ||
- name: dt-vol | ||
mountPath: /a | ||
- name: dt-tmp | ||
mountPath: /tmp | ||
- name: dt-cfg | ||
mountPath: /workspace/ietf/settings_local.py | ||
subPath: settings_local.py | ||
env: | ||
- name: "CONTAINER_ROLE" | ||
value: "beat" | ||
envFrom: | ||
- configMapRef: | ||
name: django-config | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
volumes: | ||
# To be overriden with the actual shared volume | ||
- name: dt-vol | ||
- name: dt-tmp | ||
emptyDir: | ||
sizeLimit: "2Gi" | ||
- name: dt-cfg | ||
configMap: | ||
name: files-cfgmap | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,82 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: celery | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: celery | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: celery | ||
spec: | ||
securityContext: | ||
runAsNonRoot: true | ||
containers: | ||
# ----------------------------------------------------- | ||
# ScoutAPM Container | ||
# ----------------------------------------------------- | ||
- name: scoutapm | ||
image: "scoutapp/scoutapm:version-1.4.0" | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
exec: | ||
command: | ||
- "sh" | ||
- "-c" | ||
- "./core-agent probe --tcp 0.0.0.0:6590 | grep -q 'Agent found'" | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsUser: 65534 # "nobody" user by default | ||
runAsGroup: 65534 # "nogroup" group by default | ||
# ----------------------------------------------------- | ||
# Celery Container | ||
# ----------------------------------------------------- | ||
- name: celery | ||
image: "ghcr.io/ietf-tools/datatracker:$APP_IMAGE_TAG" | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8000 | ||
name: http | ||
protocol: TCP | ||
volumeMounts: | ||
- name: dt-vol | ||
mountPath: /a | ||
- name: dt-tmp | ||
mountPath: /tmp | ||
- name: dt-cfg | ||
mountPath: /workspace/ietf/settings_local.py | ||
subPath: settings_local.py | ||
env: | ||
- name: "CONTAINER_ROLE" | ||
value: "celery" | ||
envFrom: | ||
- configMapRef: | ||
name: django-config | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
volumes: | ||
# To be overriden with the actual shared volume | ||
- name: dt-vol | ||
- name: dt-tmp | ||
emptyDir: | ||
sizeLimit: "2Gi" | ||
- name: dt-cfg | ||
configMap: | ||
name: files-cfgmap | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 30 | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: celery | ||
labels: | ||
deleteBeforeUpgrade: yes | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: celery | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: celery | ||
spec: | ||
securityContext: | ||
runAsNonRoot: true | ||
containers: | ||
# ----------------------------------------------------- | ||
# ScoutAPM Container | ||
# ----------------------------------------------------- | ||
- name: scoutapm | ||
image: "scoutapp/scoutapm:version-1.4.0" | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
exec: | ||
command: | ||
- "sh" | ||
- "-c" | ||
- "./core-agent probe --tcp 0.0.0.0:6590 | grep -q 'Agent found'" | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsUser: 65534 # "nobody" user by default | ||
runAsGroup: 65534 # "nogroup" group by default | ||
# ----------------------------------------------------- | ||
# Celery Container | ||
# ----------------------------------------------------- | ||
- name: celery | ||
image: "ghcr.io/ietf-tools/datatracker:$APP_IMAGE_TAG" | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8000 | ||
name: http | ||
protocol: TCP | ||
volumeMounts: | ||
- name: dt-vol | ||
mountPath: /a | ||
- name: dt-tmp | ||
mountPath: /tmp | ||
- name: dt-cfg | ||
mountPath: /workspace/ietf/settings_local.py | ||
subPath: settings_local.py | ||
env: | ||
- name: "CONTAINER_ROLE" | ||
value: "celery" | ||
envFrom: | ||
- configMapRef: | ||
name: django-config | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
volumes: | ||
# To be overriden with the actual shared volume | ||
- name: dt-vol | ||
- name: dt-tmp | ||
emptyDir: | ||
sizeLimit: "2Gi" | ||
- name: dt-cfg | ||
configMap: | ||
name: files-cfgmap | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters