初始提交
This commit is contained in:
141
py-deploy/template/gateway/deployment.yaml
Normal file
141
py-deploy/template/gateway/deployment.yaml
Normal file
@@ -0,0 +1,141 @@
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ deployment_name }}
|
||||
namespace: {{ namespace }}
|
||||
spec:
|
||||
replicas: {{ replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ deployment_name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ deployment_name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ deployment_name }}
|
||||
env:
|
||||
- name: SERVICE_NAME
|
||||
value: {{ deployment_name }}
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: status.podIP
|
||||
image: {{ image }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- /saas/tmy3-config/pre-Stop.sh
|
||||
resources:
|
||||
limits:
|
||||
cpu: {{ limits_cpu }}
|
||||
memory: {{ limits_memory }}
|
||||
requests:
|
||||
cpu: {{ requests_cpu }}
|
||||
memory: {{ requests_memory }}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: 8080
|
||||
timeoutSeconds: 1
|
||||
volumeMounts:
|
||||
- mountPath: /etc/localtime
|
||||
name: localtime
|
||||
- mountPath: /saas/tmy3-config/logback-spring.xml
|
||||
name: tmly
|
||||
subPath: logback-spring.xml
|
||||
- mountPath: /saas/tmy3-config/pre-Stop.sh
|
||||
name: tmly
|
||||
subPath: pre-Stop.sh
|
||||
- mountPath: /saas/run-env.sh
|
||||
name: tmly
|
||||
subPath: run-env.sh
|
||||
imagePullSecrets:
|
||||
- name: {{ imageSecret }}
|
||||
volumes:
|
||||
- hostPath:
|
||||
path: /etc/localtime
|
||||
type: ''
|
||||
name: localtime
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
name: tmly
|
||||
name: tmly
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ deployment_name }}
|
||||
namespace: {{ namespace }}
|
||||
spec:
|
||||
ports:
|
||||
- name: server-port
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: {{ deployment_name }}
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||
nginx.ingress.kubernetes.io/enable-cors: 'true'
|
||||
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
|
||||
nginx.ingress.kubernetes.io/cors-allow-methods: 'GET,PUT,POST'
|
||||
name: {{ deployment_name }}
|
||||
namespace: {{ namespace }}
|
||||
spec:
|
||||
ingressClassName: {{ ingressClassName }}
|
||||
rules:
|
||||
- host: {{ domain }}
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: {{ deployment_name }}
|
||||
port:
|
||||
number: 8080
|
||||
path: /tmy3/tmy3api(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||
nginx.ingress.kubernetes.io/enable-cors: 'true'
|
||||
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
|
||||
nginx.ingress.kubernetes.io/cors-allow-methods: 'GET,PUT,POST'
|
||||
name: super-{{ deployment_name }}
|
||||
namespace: {{ namespace }}
|
||||
spec:
|
||||
ingressClassName: {{ ingressClassName }}
|
||||
rules:
|
||||
- host: {{ superDomain }}
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: {{ deployment_name }}
|
||||
port:
|
||||
number: 8080
|
||||
path: /tmy3/tmy3api(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
Reference in New Issue
Block a user