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

Update nginx config #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ deploy: manifests
kubectl apply -f config/deploy

# Build the frontend docker image
docker-build-frontend: test
docker-build-frontend:
docker build . -f ${DOCKERFILE_FRONTEND} -t ${IMG_FRONTEND}:${TAG}

# Build the backend docker image
docker-build-backend: test
docker-build-backend:
docker build . -f ${DOCKERFILE_BACKEND} -t ${IMG_BACKEND}:${TAG}

# Push the docker image
Expand Down
47 changes: 45 additions & 2 deletions config/deploy/kubediag-dashboard-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
server {
listen 8080;
server_name localhost;

location /api/ {
proxy_pass http://localhost:7000/api/;
}

// location with routePrefix
location /kubediag/${routePrefix}/api/ {
proxy_pass http://localhost:7000/api/;
}

// location with routePrefix
location /kubediag/${routePrefix}/ {
proxy_pass http://localhost:8080/;
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -16,12 +47,24 @@ spec:
spec:
containers:
- name: backend
image: hub.c.163.com/kubediag/kubediag-dashboard-backend:v0.1.0
image: hub.c.163.com/kubediag/kubediag-dashboard-backend:v0.1.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 7000
- name: frontend
image: hub.c.163.com/kubediag/kubediag-dashboard-frontend:v0.1.0
image: hub.c.163.com/kubediag/kubediag-dashboard-frontend:v0.1.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
volumeMounts:
- name: nginx-conf
mountPath: /etc/nginx/conf.d/default.conf
subPath: nginx.conf
readOnly: true
volumes:
- name: nginx-conf
configMap:
name: nginx-conf
items:
- key: nginx.conf
path: nginx.conf