forked from gitea_admin/simple-node
frontend
This commit is contained in:
50
frontend/k8s-deployment.yaml
Normal file
50
frontend/k8s-deployment.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: todo-frontend-config
|
||||
data:
|
||||
BACKEND_URL: "http://<BACKEND_NODE_IP>:30001" # Update with your NodePort IP or LoadBalancer DNS
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: todo-frontend
|
||||
labels:
|
||||
app: todo-frontend
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: todo-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: todo-frontend
|
||||
spec:
|
||||
containers:
|
||||
- name: todo-frontend
|
||||
image: IMAGE_PATH_PLACEHOLDER
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: PORT
|
||||
value: "3000"
|
||||
- name: BACKEND_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: todo-frontend-config
|
||||
key: BACKEND_URL
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: todo-frontend-service
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: todo-frontend
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
nodePort: 30000
|
||||
Reference in New Issue
Block a user