diff --git a/build/Dockerfile b/build/Dockerfile deleted file mode 100755 index 8d516754..00000000 --- a/build/Dockerfile +++ /dev/null @@ -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/ diff --git a/build/default.conf b/build/default.conf deleted file mode 100755 index a59e6315..00000000 --- a/build/default.conf +++ /dev/null @@ -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; - } - -} diff --git a/build/dev/pod.tpl b/build/dev/pod.tpl index 445013a1..94984380 100644 --- a/build/dev/pod.tpl +++ b/build/dev/pod.tpl @@ -2,9 +2,9 @@ apiVersion: v1 kind: Pod metadata: name: common-job-pod - namespace: lifeline-web + namespace: medicalalert-web labels: - app: lifeline-web + app: medicalalert-web rds: enable spec: affinity: @@ -19,12 +19,12 @@ spec: - arm64 containers: - name: common-job - image: ubuntu:latest + image: wyveo/nginx-php-fpm:php74 envFrom: - secretRef: - name: lifeline-web-secrets + name: medicalalert-web-secrets - configMapRef: - name: lifeline-web-cm + name: medicalalert-web-cm command: ["bash"] args: - -c @@ -32,6 +32,16 @@ spec: 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: @@ -40,4 +50,20 @@ spec: volumes: - name: persistent-storage 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 + diff --git a/build/ngx_http_headers_more_filter_module-debug.so b/build/ngx_http_headers_more_filter_module-debug.so deleted file mode 100755 index 74c2c394..00000000 Binary files a/build/ngx_http_headers_more_filter_module-debug.so and /dev/null differ diff --git a/build/ngx_http_headers_more_filter_module.so b/build/ngx_http_headers_more_filter_module.so deleted file mode 100755 index 29cbbae7..00000000 Binary files a/build/ngx_http_headers_more_filter_module.so and /dev/null differ diff --git a/build/qa/configmap.yaml b/build/qa/configmap.yaml index 0724d258..9acbe88d 100644 --- a/build/qa/configmap.yaml +++ b/build/qa/configmap.yaml @@ -6,12 +6,12 @@ metadata: labels: app: medicalalert-web data: - DB_HOST: dev-medicalalert-ecommerce.c5om7w6xopq1.us-east-1.rds.amazonaws.com - ENV: dev + DB_HOST: qa-medicalalert-ecommerce.c5om7w6xopq1.us-east-1.rds.amazonaws.com + ENV: qa WP_DEBUG: "false" DB_CHARSET: utf8 DB_COLLATE: utf8_general_ci CACHE_HOST: master.redis-cache-all-be-caresage.cqsmse.use1.cache.amazonaws.com CACHE_PORT: "6379" - DB_NAME: "pantheon" - DB_USER: "pantheon" \ No newline at end of file + DB_NAME: "www" + DB_USER: "pantheon" diff --git a/build/qa/deployment.tpl b/build/qa/deployment.tpl index 506775b3..a0c77be6 100644 --- a/build/qa/deployment.tpl +++ b/build/qa/deployment.tpl @@ -6,7 +6,7 @@ metadata: labels: app: medicalalert-web name: medicalalert-web - namespace: caresage-web + namespace: medicalalert-web spec: progressDeadlineSeconds: 600 replicas: 1 @@ -55,15 +55,15 @@ spec: protocol: TCP resources: limits: - cpu: 200m - memory: 300Mi + cpu: 500m + memory: 700Mi requests: - cpu: 100m - memory: 100Mi + cpu: 300m + memory: 500Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - - mountPath: /usr/share/nginx/html/wp-content/uploads + - mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads name: persistent-storage - mountPath: /etc/nginx/conf.d/ name: default-conf @@ -78,15 +78,8 @@ spec: volumes: - name: persistent-storage persistentVolumeClaim: - claimName: efs-claim + claimName: efs-claim-medicalalert - name: default-conf configMap: defaultMode: 420 name: medicalalert-web-default-conf-cm - - - - - - - diff --git a/build/qa/deployment.yml b/build/qa/deployment.yml deleted file mode 100644 index 7581d4a1..00000000 --- a/build/qa/deployment.yml +++ /dev/null @@ -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: {} - - - - - - - - - diff --git a/build/qa/jobs.tpl b/build/qa/pod.tpl similarity index 54% rename from build/qa/jobs.tpl rename to build/qa/pod.tpl index 194ce018..47af2836 100644 --- a/build/qa/jobs.tpl +++ b/build/qa/pod.tpl @@ -1,18 +1,12 @@ -apiVersion: batch/v1 -kind: Job +apiVersion: v1 +kind: Pod metadata: - name: common-jobs - namespace: caresage-exec + name: common-job-pod + namespace: medicalalert-web labels: - app: lifeline-web + app: medicalalert-web rds: enable spec: - template: - metadata: - labels: - app: lifeline-web - rds: enable - spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -24,19 +18,19 @@ spec: - amd64 - arm64 containers: - - name: common-jobs - image: bitnami/percona-xtrabackup:latest + - name: common-job + image: wyveo/nginx-php-fpm:php74 envFrom: - secretRef: - name: lifeline-web-secrets + name: medicalalert-web-secrets - configMapRef: - name: lifeline-web-cm - command: ["bash"] + name: medicalalert-web-cm + command: ["bash"] args: - -c - - cp -rf /usr/share/nginx/html/wp-content/uploads/common-jobs.sh /root/ && /root/common-jobs.sh $JOBNAME + - sleep infinity volumeMounts: - - mountPath: /usr/share/nginx/html/wp-content/uploads + - mountPath: /usr/share/nginx/subdomain/www/wp-content/uploads name: persistent-storage imagePullSecrets: - name: regcred @@ -46,5 +40,5 @@ spec: volumes: - name: persistent-storage persistentVolumeClaim: - claimName: efs-claim - \ No newline at end of file + claimName: efs-claim-medicalalert + diff --git a/build/qa/pvc.yml b/build/qa/pvc.yml index 097d2d8c..951ce645 100644 --- a/build/qa/pvc.yml +++ b/build/qa/pvc.yml @@ -1,13 +1,12 @@ ---- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: efs-claim-medicalalert - namespace: caresage-web + namespace: medicalalert-web spec: accessModes: - - ReadWriteMany - storageClassName: efs-sc + - ReadWriteMany + storageClassName: efs-sc-qa-ecommerce resources: requests: - storage: 10Gi + storage: 5Gi diff --git a/build/qa/storageclass.yaml b/build/qa/storageclass.yaml index 0f81a4ed..6d4acbd2 100644 --- a/build/qa/storageclass.yaml +++ b/build/qa/storageclass.yaml @@ -3,9 +3,11 @@ apiVersion: storage.k8s.io/v1 metadata: name: efs-sc provisioner: efs.csi.aws.com + #reclaimPolicy: Retain +allowVolumeExpansion: true +volumeBindingMode: Immediate parameters: provisioningMode: efs-ap -# reclaimPolicy: Retain fileSystemId: fs-01d898a0e680dbd45 directoryPerms: "700" gidRangeStart: "1000" # optional diff --git a/build/qa/medicalalert-web-default-conf-cm.yaml b/build/qa/web-default-conf-cm.yaml similarity index 100% rename from build/qa/medicalalert-web-default-conf-cm.yaml rename to build/qa/web-default-conf-cm.yaml diff --git a/build/qa/medicalalert-web-hpa.yml b/build/qa/web-hpa.yml similarity index 89% rename from build/qa/medicalalert-web-hpa.yml rename to build/qa/web-hpa.yml index baf41dbf..86625d72 100644 --- a/build/qa/medicalalert-web-hpa.yml +++ b/build/qa/web-hpa.yml @@ -2,7 +2,7 @@ apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: medicalalert-web-hpa - namespace: caresage-web + namespace: medicalalert-web spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/pod.tpl b/pod.tpl deleted file mode 100644 index 94984380..00000000 --- a/pod.tpl +++ /dev/null @@ -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 -