diff --git a/deploy/base/easi/easi-frontend_deployment.yaml b/deploy/base/easi/easi-frontend_deployment.yaml index 1c3da1e814..64b887579a 100644 --- a/deploy/base/easi/easi-frontend_deployment.yaml +++ b/deploy/base/easi/easi-frontend_deployment.yaml @@ -15,6 +15,10 @@ spec: labels: app: easi-frontend spec: + volumes: + - name: nginx-config + configMap: + name: easi-frontend-configmap-nginx containers: - name: easi-frontend image: easi-frontend:latest @@ -23,4 +27,8 @@ spec: - containerPort: 80 protocol: TCP resources: {} + volumeMounts: + - name: nginx-config + mountPath: /etc/nginx/conf.d/easi.conf + subPath: easi.conf restartPolicy: Always diff --git a/deploy/base/easi/easi-frontend_nginx_configmap.yaml b/deploy/base/easi/easi-frontend_nginx_configmap.yaml new file mode 100644 index 0000000000..7de692e462 --- /dev/null +++ b/deploy/base/easi/easi-frontend_nginx_configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: easi-frontend-configmap-nginx + namespace: easi +data: + easi.conf: | + server { + listen 80 default_server; + root /usr/share/nginx/html; + location / { + try_files $uri /index.html; + } + } diff --git a/deploy/base/easi/kustomization.yaml b/deploy/base/easi/kustomization.yaml index 6b502c2161..806649cc63 100644 --- a/deploy/base/easi/kustomization.yaml +++ b/deploy/base/easi/kustomization.yaml @@ -12,6 +12,7 @@ resources: - easi-backend_configmap.yaml - easi-backend_deployment.yaml - easi-backend_service.yaml + - easi-frontend_nginx_configmap.yaml - easi-frontend_deployment.yaml - easi-frontend_service.yaml - email_deployment.yaml diff --git a/scripts/deploy_eks_env.sh b/scripts/deploy_eks_env.sh index f0e836f0e8..b75d73fe26 100755 --- a/scripts/deploy_eks_env.sh +++ b/scripts/deploy_eks_env.sh @@ -1,4 +1,6 @@ #!/bin/bash +# We want to control which environment variables envsubst replaces +# shellcheck disable=SC2016 # Exit on any error set -e @@ -110,7 +112,10 @@ export EMAIL_INGRESS kustomize edit set image easi-backend=840301899071.dkr.ecr.us-west-2.amazonaws.com/easi-backend:"$GIT_HASH" kustomize edit set image easi-frontend=840301899071.dkr.ecr.us-west-2.amazonaws.com/easi-frontend:"$GIT_HASH" kustomize edit set image db-migrate=840301899071.dkr.ecr.us-west-2.amazonaws.com/easi-db-migrate:"$GIT_HASH" - kustomize build | envsubst > manifest-easi.yaml + + # IMPORTANT NOTE: + # envsubst is needed here to replace the EASI_INGRESS placeholder variable in /deploy/overlays/pr/easi-backend_configmap.yaml + kustomize build | envsubst '$EASI_INGRESS' > manifest-easi.yaml # if verbose, print out the kustomization.yaml and manifest-easi.yaml if [ "$VERBOSE" = true ]; then @@ -121,7 +126,7 @@ export EMAIL_INGRESS cat manifest-easi.yaml fi - echo "❄️ Deploying Ingress Objects via Kubectl ❄️" + echo "❄️ Deploying EASi Objects via Kubectl ❄️" kubectl apply -n "$NAMESPACE" -f manifest-easi.yaml )