Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDPT-2264 Revert isolated cron deployments PR #773 and #772 #793

Merged
merged 4 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 0 additions & 161 deletions deploy/development/deployment.tpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,167 +62,6 @@ spec:
name: ${KUBE_NAMESPACE}-base64-secrets
key: IPS_FORMATTED

- name: fpm
wilson1000 marked this conversation as resolved.
Show resolved Hide resolved
image: ${ECR_URL}:${IMAGE_TAG_FPM}
resources:
limits:
# If a pod exceeds its CPU limit, Kubernetes will simply throttle the pod.
cpu: "4"
# If a pod exceeds its memory limit, Kubernetes will kill the pod.
memory: 2000Mi
requests:
cpu: 500m
memory: 600Mi
volumeMounts:
- name: uploads
mountPath: /var/www/html/public/app/uploads
- name: php-socket
mountPath: /sock
securityContext:
runAsUser: 101
# Check frequently during startup, so that scaling up can happen as fast as possible.
startupProbe:
exec:
command:
- /usr/local/bin/fpm-health/fpm-readiness.sh
failureThreshold: 20
periodSeconds: 5
# Don't route traffic to this pod if the container is not ready.
readinessProbe:
exec:
command:
- /usr/local/bin/fpm-health/fpm-readiness.sh
periodSeconds: 10
failureThreshold: 1
# Restart the container if it fails liveness script.
livenessProbe:
exec:
command:
- /usr/local/bin/fpm-health/fpm-liveness.sh
periodSeconds: 10
env:
- name: AWS_S3_BUCKET
valueFrom:
secretKeyRef:
name: s3-bucket-output
key: bucket_name
- name: AWS_CLOUDFRONT_PUBLIC_KEYS_OBJECT
valueFrom:
secretKeyRef:
name: cloudfront-output
key: cloudfront_public_keys
- name: DB_HOST
valueFrom:
secretKeyRef:
name: rds-output
key: rds_instance_address
- name: DB_NAME
valueFrom:
secretKeyRef:
name: rds-output
key: database_name
- name: DB_USER
valueFrom:
secretKeyRef:
name: rds-output
key: database_username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: rds-output
key: database_password
- name: OPENSEARCH_URL
valueFrom:
secretKeyRef:
name: central-digital-product-team-opensearch-proxy-url
key: proxy_url
- name: BASIC_AUTH
valueFrom:
secretKeyRef:
name: basic-auth-secret
key: auth
- name: CACHE_HOST
valueFrom:
secretKeyRef:
name: elasticache-output
key: primary_endpoint_address
- name: CACHE_PASSWORD
valueFrom:
secretKeyRef:
name: elasticache-output
key: auth_token
envFrom:
- configMapRef:
name: ${KUBE_NAMESPACE}
- secretRef:
name: ${KUBE_NAMESPACE}-secrets
- secretRef:
name: ${KUBE_NAMESPACE}-base64-secrets
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${KUBE_NAMESPACE}-cron
namespace: ${KUBE_NAMESPACE}
labels:
app: ${KUBE_NAMESPACE}-cron
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 100%
selector:
matchLabels:
app: ${KUBE_NAMESPACE}-cron
template:
metadata:
labels:
app: ${KUBE_NAMESPACE}-cron
spec:
volumes:
- name: uploads
emptyDir: { }
- name: php-socket
emptyDir: { }
terminationGracePeriodSeconds: 35
serviceAccountName: ${KUBE_NAMESPACE}-service
containers:
- name: nginx
image: ${ECR_URL}:${IMAGE_TAG_NGINX}
resources:
limits:
cpu: 500m
memory: 250Mi
requests:
cpu: 50m
memory: 100Mi
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: uploads
mountPath: /var/www/html/public/app/uploads
- name: php-socket
mountPath: /sock
securityContext:
runAsUser: 101
readinessProbe:
httpGet:
path: /readiness
port: 8080
livenessProbe:
httpGet:
path: /liveness
port: 8080
env:
- name: IPS_FORMATTED
valueFrom:
secretKeyRef:
name: ${KUBE_NAMESPACE}-base64-secrets
key: IPS_FORMATTED

- name: cron
image: ${ECR_URL}:${IMAGE_TAG_CRON}
resources:
Expand Down
161 changes: 0 additions & 161 deletions deploy/production/deployment.tpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,167 +62,6 @@ spec:
name: ${KUBE_NAMESPACE}-base64-secrets
key: IPS_FORMATTED

- name: fpm
EarthlingDavey marked this conversation as resolved.
Show resolved Hide resolved
image: ${ECR_URL}:${IMAGE_TAG_FPM}
resources:
limits:
# If a pod exceeds its CPU limit, Kubernetes will simply throttle the pod.
cpu: "4"
# If a pod exceeds its memory limit, Kubernetes will kill the pod.
memory: 2000Mi
requests:
cpu: 500m
memory: 600Mi
volumeMounts:
- name: uploads
mountPath: /var/www/html/public/app/uploads
- name: php-socket
mountPath: /sock
securityContext:
runAsUser: 101
# Check frequently during startup, so that scaling up can happen as fast as possible.
startupProbe:
exec:
command:
- /usr/local/bin/fpm-health/fpm-readiness.sh
failureThreshold: 20
periodSeconds: 5
# Don't route traffic to this pod if the container is not ready.
readinessProbe:
exec:
command:
- /usr/local/bin/fpm-health/fpm-readiness.sh
periodSeconds: 10
failureThreshold: 1
# Restart the container if it fails liveness script.
livenessProbe:
exec:
command:
- /usr/local/bin/fpm-health/fpm-liveness.sh
periodSeconds: 10
env:
- name: AWS_S3_BUCKET
valueFrom:
secretKeyRef:
name: s3-bucket-output
key: bucket_name
- name: AWS_CLOUDFRONT_PUBLIC_KEYS_OBJECT
valueFrom:
secretKeyRef:
name: cloudfront-output
key: cloudfront_public_keys
- name: DB_HOST
valueFrom:
secretKeyRef:
name: rds-output
key: rds_instance_address
- name: DB_NAME
valueFrom:
secretKeyRef:
name: rds-output
key: database_name
- name: DB_USER
valueFrom:
secretKeyRef:
name: rds-output
key: database_username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: rds-output
key: database_password
- name: OPENSEARCH_URL
valueFrom:
secretKeyRef:
name: opensearch-output
key: proxy_url
- name: BASIC_AUTH
valueFrom:
secretKeyRef:
name: basic-auth-secret
key: auth
- name: CACHE_HOST
valueFrom:
secretKeyRef:
name: elasticache-output
key: primary_endpoint_address
- name: CACHE_PASSWORD
valueFrom:
secretKeyRef:
name: elasticache-output
key: auth_token
envFrom:
- configMapRef:
name: ${KUBE_NAMESPACE}
- secretRef:
name: ${KUBE_NAMESPACE}-secrets
- secretRef:
name: ${KUBE_NAMESPACE}-base64-secrets
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${KUBE_NAMESPACE}-cron
namespace: ${KUBE_NAMESPACE}
labels:
app: ${KUBE_NAMESPACE}-cron
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 100%
selector:
matchLabels:
app: ${KUBE_NAMESPACE}-cron
template:
metadata:
labels:
app: ${KUBE_NAMESPACE}-cron
spec:
volumes:
- name: uploads
emptyDir: { }
- name: php-socket
emptyDir: { }
terminationGracePeriodSeconds: 35
serviceAccountName: ${KUBE_NAMESPACE}-service
containers:
- name: nginx
image: ${ECR_URL}:${IMAGE_TAG_NGINX}
resources:
limits:
cpu: 500m
memory: 250Mi
requests:
cpu: 50m
memory: 100Mi
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: uploads
mountPath: /var/www/html/public/app/uploads
- name: php-socket
mountPath: /sock
securityContext:
runAsUser: 101
readinessProbe:
httpGet:
path: /readiness
port: 8080
livenessProbe:
httpGet:
path: /liveness
port: 8080
env:
- name: IPS_FORMATTED
valueFrom:
secretKeyRef:
name: ${KUBE_NAMESPACE}-base64-secrets
key: IPS_FORMATTED

- name: cron
image: ${ECR_URL}:${IMAGE_TAG_CRON}
resources:
Expand Down
2 changes: 1 addition & 1 deletion deploy/production/hpa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: intranet-production
minReplicas: 6
minReplicas: 5
EarthlingDavey marked this conversation as resolved.
Show resolved Hide resolved
maxReplicas: 18
metrics:
# fpm
Expand Down
Loading
Loading