apiVersion: v1 kind: ConfigMap metadata: name: smarketing-frontend-config namespace: ${namespace} data: runtime-env.js: | window.__runtime_config__ = { AUTH_URL: 'http://${ingress_host}/api/auth', MEMBER_URL: 'http://${ingress_host}/api/member', STORE_URL: 'http://${ingress_host}/api/store', CONTENT_URL: 'http://${ingress_host}/api/content', RECOMMEND_URL: 'http://${ingress_host}/api/recommend' }; --- # 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