forked from Gitlink/microservices-k8s
80 lines
2.1 KiB
YAML
80 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: forgeplus
|
|
namespace: forgeplus
|
|
annotations:
|
|
mon-name: "Forgeplus服务"
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: forgeplus
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: forgeplus
|
|
stack: forgeplus
|
|
spec:
|
|
containers:
|
|
- env:
|
|
- name: GOPROXY
|
|
value: https://goproxy.cn,direct
|
|
- name: RAILS_ENV
|
|
value: production
|
|
- name: APP_HOME
|
|
value: /var/www/forgeplus
|
|
- name: SECRET_KEY_BASE
|
|
value: 8665e31a29ab7e12cb0f98c1dbcbcc1e3a6a15230fb178328d1d7ebfbc85f6dd3fa419e0397807624cef376808def125a9af422d4dc6f0e8781e751cdd1a90af
|
|
lifecycle:
|
|
postStart:
|
|
exec:
|
|
command: ["bundle","exec","rake","db:migrate"]
|
|
image: 172.20.32.140:32001/172.20.32.140:32001/forgeplus-app:latest
|
|
imagePullPolicy: IfNotPresent
|
|
name: forgeplus
|
|
ports:
|
|
- containerPort: 4000
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- mountPath: /var/www/forgeplus/
|
|
name: app-code
|
|
subPath: forgeplus-ns/forgeplus/packages/02-forgeplus/forgeplus
|
|
- mountPath: /usr/local/bundle/
|
|
name: app-gems
|
|
subPath: forgeplus-ns/forgeplus/packages/02-forgeplus/bundle
|
|
- mountPath: /var/www/forgeplus/files/
|
|
name: upload-files
|
|
subPath: forgeplus-ns/forgeplus/forge-files
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: app-code
|
|
hostPath:
|
|
path: /data/k8s-data/
|
|
type: DirectoryOrCreate
|
|
- name: app-gems
|
|
hostPath:
|
|
path: /data/k8s-data/
|
|
type: DirectoryOrCreate
|
|
- name: upload-files
|
|
hostPath:
|
|
path: /data/k8s-data/
|
|
type: DirectoryOrCreate
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: forgeplus
|
|
namespace: forgeplus
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- name: "4000"
|
|
port: 4000
|
|
targetPort: 4000
|
|
selector:
|
|
app: forgeplus
|
|
|
|
|
|
|