Add namespace, secret for image registry, and prod configs
This commit is contained in:
50
k8s/prod/deployment.yaml
Normal file
50
k8s/prod/deployment.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: todo-frontend
|
||||
namespace: todo-prod
|
||||
labels:
|
||||
app: todo-frontend
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: todo-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: todo-frontend
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: todo-registry-secret
|
||||
containers:
|
||||
- name: todo-frontend
|
||||
image: ccr.ccs.tencentyun.com/todo-prod/todo-frontend:v1.0.0
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
env:
|
||||
- name: API_BASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: todo-config
|
||||
key: API_BASE_URL
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
14
k8s/prod/service.yaml
Normal file
14
k8s/prod/service.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: todo-frontend
|
||||
namespace: todo-prod
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: todo-frontend
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
nodePort: 30080
|
||||
Reference in New Issue
Block a user