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

EASI-4676: Mount nginx config as configmap for k8s envs #2918

Merged
8 changes: 8 additions & 0 deletions deploy/base/easi/easi-frontend_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,4 +27,8 @@ spec:
- containerPort: 80
protocol: TCP
resources: {}
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/conf.d/easi.conf
subPath: easi.conf
Jdwoodson marked this conversation as resolved.
Show resolved Hide resolved
restartPolicy: Always
14 changes: 14 additions & 0 deletions deploy/base/easi/easi-frontend_nginx_configmap.yaml
Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions deploy/base/easi/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions scripts/deploy_eks_env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
# We want to control which environment variables envsubst replaces
# shellcheck disable=SC2016

# Exit on any error
set -e
Expand Down Expand Up @@ -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
Expand All @@ -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
)

Expand Down
Loading