95 lines
2.2 KiB
Plaintext
95 lines
2.2 KiB
Plaintext
# ConfigMap
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: smarketing-frontend-config
|
|
namespace: ${namespace}
|
|
data:
|
|
runtime-env.js: |
|
|
window.__runtime_config__ = {
|
|
AUTH_URL: '${auth_url}',
|
|
MEMBER_URL: '${member_url}',
|
|
STORE_URL: '${store_url}',
|
|
MENU_URL: '${menu_url}',
|
|
SALES_URL: '${sales_url}',
|
|
CONTENT_URL: '${content_url}',
|
|
RECOMMEND_URL: '${recommend_url}'
|
|
};
|
|
|
|
---
|
|
# Deployment
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: smarketing-frontend
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: smarketing-frontend
|
|
spec:
|
|
replicas: ${replicas}
|
|
selector:
|
|
matchLabels:
|
|
app: smarketing-frontend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: smarketing-frontend
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: acr-secret
|
|
containers:
|
|
- name: smarketing-frontend
|
|
image: ${smarketing_frontend_image_path}
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: ${export_port}
|
|
resources:
|
|
requests:
|
|
cpu: ${resources_requests_cpu}
|
|
memory: ${resources_requests_memory}
|
|
limits:
|
|
cpu: ${resources_limits_cpu}
|
|
memory: ${resources_limits_memory}
|
|
volumeMounts:
|
|
- name: runtime-config
|
|
mountPath: /usr/share/nginx/html/runtime-env.js
|
|
subPath: runtime-env.js
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: ${export_port}
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: ${export_port}
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
volumes:
|
|
- name: runtime-config
|
|
configMap:
|
|
name: smarketing-frontend-config
|
|
|
|
---
|
|
# Service
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: smarketing-frontend-service
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: smarketing-frontend
|
|
spec:
|
|
type: LoadBalancer
|
|
ports:
|
|
- port: 80
|
|
targetPort: ${export_port}
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app: smarketing-frontend |