Product-Manager/z2/k8s/deployment-frontend.yml

55 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2022-05-07 11:14:18 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-manager-frontend-deployment
labels:
app: product-manager-frontend
spec:
replicas: 1
selector:
matchLabels:
app: product-manager-frontend
template:
metadata:
labels:
app: product-manager-frontend
spec:
containers:
- name: product-manager-frontend
image: product-manager-frontend:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx/conf.d/ # mount nginx-conf volumn to /etc/nginx
readOnly: true
name: nginx-conf
volumes:
- name: nginx-conf
configMap:
name: nginx-conf # place ConfigMap `nginx-conf` on /etc/nginx
items:
- key: default.conf
path: default.conf
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
namespace: vinayakrao
data:
default.conf: |
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri /index.html;
}
location /api/ {
# The following statement will proxy traffic to the upstream named Backend
proxy_pass http://backend-service:8000;
}
}