malert commit

This commit is contained in:
Jay Sharma
2023-07-28 07:13:51 +05:30
parent 8c2a392196
commit b26739f4e9
14 changed files with 65 additions and 298 deletions

View File

@@ -1,5 +0,0 @@
FROM wyveo/nginx-php-fpm:php80
RUN cd ..
COPY wp/* /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
RUN chmod +xw -R /usr/share/nginx/

View File

@@ -1,75 +0,0 @@
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
#listen 443 ssl;
#ssl_certificate /usr/share/nginx/html/cert.pem;
#ssl_certificate /usr/share/nginx/html/lifeline-local.pem;
#ssl_certificate_key /usr/share/nginx/html/key.pem;
root /usr/share/nginx/html;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name lifeline-web.pantheonlocal.com;
#server_name local.lifeline-prod.com;
# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
sendfile off;
# Security - Hide nginx version number in error pages and Server header
server_tokens off;
# Add stdout logging
error_log /dev/stdout error;
access_log /dev/stdout;
# reduce the data that needs to be sent over network
gzip on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml application/json text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.php
try_files $uri $uri/ /index.php?$args;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on socket
#
#~ \.php$
location ~ [^/]\.php(/|$) {
#try_files $uri $uri/ /index.php?$query_string;
try_files $uri $uri/ /index.php?$args;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 5d;
}
# deny access to . files, for security
#
location ~ /\. {
log_not_found off;
deny all;
}
}

View File

@@ -2,9 +2,9 @@ apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: common-job-pod name: common-job-pod
namespace: lifeline-web namespace: medicalalert-web
labels: labels:
app: lifeline-web app: medicalalert-web
rds: enable rds: enable
spec: spec:
affinity: affinity:
@@ -19,12 +19,12 @@ spec:
- arm64 - arm64
containers: containers:
- name: common-job - name: common-job
image: ubuntu:latest image: wyveo/nginx-php-fpm:php74
envFrom: envFrom:
- secretRef: - secretRef:
name: lifeline-web-secrets name: medicalalert-web-secrets
- configMapRef: - configMapRef:
name: lifeline-web-cm name: medicalalert-web-cm
command: ["bash"] command: ["bash"]
args: args:
- -c - -c
@@ -32,6 +32,16 @@ spec:
volumeMounts: volumeMounts:
- mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads - mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads
name: persistent-storage name: persistent-storage
- mountPath: /usr/share/nginx/subdomain/dev01
name: persistent-storage-dev01
- mountPath: /usr/share/nginx/subdomain/dev02
name: persistent-storage-dev02
- mountPath: /usr/share/nginx/subdomain/dev03
name: persistent-storage-dev03
- mountPath: /usr/share/nginx/subdomain/dev04
name: persistent-storage-dev04
- mountPath: /usr/share/nginx/subdomain/dev05
name: persistent-storage-dev05
imagePullSecrets: imagePullSecrets:
- name: regcred - name: regcred
nodeSelector: nodeSelector:
@@ -40,4 +50,20 @@ spec:
volumes: volumes:
- name: persistent-storage - name: persistent-storage
persistentVolumeClaim: persistentVolumeClaim:
claimName: efs-claim-lifeline claimName: efs-claim-medicalalert
- name: persistent-storage-dev01
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev01
- name: persistent-storage-dev02
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev02
- name: persistent-storage-dev03
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev03
- name: persistent-storage-dev04
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev04
- name: persistent-storage-dev05
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev05

View File

@@ -6,12 +6,12 @@ metadata:
labels: labels:
app: medicalalert-web app: medicalalert-web
data: data:
DB_HOST: dev-medicalalert-ecommerce.c5om7w6xopq1.us-east-1.rds.amazonaws.com DB_HOST: qa-medicalalert-ecommerce.c5om7w6xopq1.us-east-1.rds.amazonaws.com
ENV: dev ENV: qa
WP_DEBUG: "false" WP_DEBUG: "false"
DB_CHARSET: utf8 DB_CHARSET: utf8
DB_COLLATE: utf8_general_ci DB_COLLATE: utf8_general_ci
CACHE_HOST: master.redis-cache-all-be-caresage.cqsmse.use1.cache.amazonaws.com CACHE_HOST: master.redis-cache-all-be-caresage.cqsmse.use1.cache.amazonaws.com
CACHE_PORT: "6379" CACHE_PORT: "6379"
DB_NAME: "pantheon" DB_NAME: "www"
DB_USER: "pantheon" DB_USER: "pantheon"

View File

@@ -6,7 +6,7 @@ metadata:
labels: labels:
app: medicalalert-web app: medicalalert-web
name: medicalalert-web name: medicalalert-web
namespace: caresage-web namespace: medicalalert-web
spec: spec:
progressDeadlineSeconds: 600 progressDeadlineSeconds: 600
replicas: 1 replicas: 1
@@ -55,15 +55,15 @@ spec:
protocol: TCP protocol: TCP
resources: resources:
limits: limits:
cpu: 200m cpu: 500m
memory: 300Mi memory: 700Mi
requests: requests:
cpu: 100m cpu: 300m
memory: 100Mi memory: 500Mi
terminationMessagePath: /dev/termination-log terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File terminationMessagePolicy: File
volumeMounts: volumeMounts:
- mountPath: /usr/share/nginx/html/wp-content/uploads - mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads
name: persistent-storage name: persistent-storage
- mountPath: /etc/nginx/conf.d/ - mountPath: /etc/nginx/conf.d/
name: default-conf name: default-conf
@@ -78,15 +78,8 @@ spec:
volumes: volumes:
- name: persistent-storage - name: persistent-storage
persistentVolumeClaim: persistentVolumeClaim:
claimName: efs-claim claimName: efs-claim-medicalalert
- name: default-conf - name: default-conf
configMap: configMap:
defaultMode: 420 defaultMode: 420
name: medicalalert-web-default-conf-cm name: medicalalert-web-default-conf-cm

View File

@@ -1,98 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "11"
labels:
app: medicalalert-web
name: medicalalert-web
namespace: caresage-web
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: medicalalert-web
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
kubectl.kubernetes.io/restartedAt: "2023-06-08T17:04:19-04:00"
creationTimestamp: null
labels:
app: medicalalert-web
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
containers:
- env:
- name: ENVIRONMENT
value: dev
image: 716593996126.dkr.ecr.us-east-1.amazonaws.com/medicalalert-web:v01
envFrom:
- secretRef:
name: medicalalert-web-secrets
- configMapRef:
name: medicalalert-web-cm
imagePullPolicy: Always
name: medicalalert-web
ports:
- containerPort: 80
name: http
protocol: TCP
resources:
limits:
cpu: 200m
memory: 300Mi
requests:
cpu: 100m
memory: 100Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /usr/share/nginx/html/wp-content/uploads
name: persistent-storage
- mountPath: /etc/nginx/conf.d/
name: default-conf
- mountPath: /var/lib/nginx/cache
name: cache
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: regcred
nodeSelector:
kubernetes.io/os: linux
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim-medicalalert
- name: default-conf
configMap:
defaultMode: 420
name: medicalalert-web-default-conf-cm
- name: cache
emptyDir: {}

View File

@@ -1,16 +1,10 @@
apiVersion: batch/v1 apiVersion: v1
kind: Job kind: Pod
metadata: metadata:
name: common-jobs name: common-job-pod
namespace: caresage-exec namespace: medicalalert-web
labels: labels:
app: lifeline-web app: medicalalert-web
rds: enable
spec:
template:
metadata:
labels:
app: lifeline-web
rds: enable rds: enable
spec: spec:
affinity: affinity:
@@ -24,19 +18,19 @@ spec:
- amd64 - amd64
- arm64 - arm64
containers: containers:
- name: common-jobs - name: common-job
image: bitnami/percona-xtrabackup:latest image: wyveo/nginx-php-fpm:php74
envFrom: envFrom:
- secretRef: - secretRef:
name: lifeline-web-secrets name: medicalalert-web-secrets
- configMapRef: - configMapRef:
name: lifeline-web-cm name: medicalalert-web-cm
command: ["bash"] command: ["bash"]
args: args:
- -c - -c
- cp -rf /usr/share/nginx/html/wp-content/uploads/common-jobs.sh /root/ && /root/common-jobs.sh $JOBNAME - sleep infinity
volumeMounts: volumeMounts:
- mountPath: /usr/share/nginx/html/wp-content/uploads - mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads
name: persistent-storage name: persistent-storage
imagePullSecrets: imagePullSecrets:
- name: regcred - name: regcred
@@ -46,5 +40,5 @@ spec:
volumes: volumes:
- name: persistent-storage - name: persistent-storage
persistentVolumeClaim: persistentVolumeClaim:
claimName: efs-claim claimName: efs-claim-medicalalert

View File

@@ -1,13 +1,12 @@
---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: efs-claim-medicalalert name: efs-claim-medicalalert
namespace: caresage-web namespace: medicalalert-web
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
storageClassName: efs-sc storageClassName: efs-sc-qa-ecommerce
resources: resources:
requests: requests:
storage: 10Gi storage: 5Gi

View File

@@ -3,9 +3,11 @@ apiVersion: storage.k8s.io/v1
metadata: metadata:
name: efs-sc name: efs-sc
provisioner: efs.csi.aws.com provisioner: efs.csi.aws.com
#reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: Immediate
parameters: parameters:
provisioningMode: efs-ap provisioningMode: efs-ap
# reclaimPolicy: Retain
fileSystemId: fs-01d898a0e680dbd45 fileSystemId: fs-01d898a0e680dbd45
directoryPerms: "700" directoryPerms: "700"
gidRangeStart: "1000" # optional gidRangeStart: "1000" # optional

View File

@@ -2,7 +2,7 @@ apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: medicalalert-web-hpa name: medicalalert-web-hpa
namespace: caresage-web namespace: medicalalert-web
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1

69
pod.tpl
View File

@@ -1,69 +0,0 @@
apiVersion: v1
kind: Pod
metadata:
name: common-job-pod
namespace: medicalalert-web
labels:
app: medicalalert-web
rds: enable
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
containers:
- name: common-job
image: wyveo/nginx-php-fpm:php74
envFrom:
- secretRef:
name: medicalalert-web-secrets
- configMapRef:
name: medicalalert-web-cm
command: ["bash"]
args:
- -c
- sleep infinity
volumeMounts:
- mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads
name: persistent-storage
- mountPath: /usr/share/nginx/subdomain/dev01
name: persistent-storage-dev01
- mountPath: /usr/share/nginx/subdomain/dev02
name: persistent-storage-dev02
- mountPath: /usr/share/nginx/subdomain/dev03
name: persistent-storage-dev03
- mountPath: /usr/share/nginx/subdomain/dev04
name: persistent-storage-dev04
- mountPath: /usr/share/nginx/subdomain/dev05
name: persistent-storage-dev05
imagePullSecrets:
- name: regcred
nodeSelector:
kubernetes.io/os: linux
restartPolicy: Never
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim-medicalalert
- name: persistent-storage-dev01
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev01
- name: persistent-storage-dev02
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev02
- name: persistent-storage-dev03
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev03
- name: persistent-storage-dev04
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev04
- name: persistent-storage-dev05
persistentVolumeClaim:
claimName: efs-claim-medicalalert-dev05