apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: TemplateProject
namespace: PROJECT_NS
spec:
revisionHistoryLimit: 50
replicas: REP
strategy:
type: Recreate
template:
metadata:
labels:
app: TemplateProject
spec:
nodeSelector:
role: NodeLable
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
hostAliases:
- ip: "10.47.54.191"
hostnames:
- "elasticsearch.kube.com"
- ip: "10.47.123.21"
hostnames:
- "zipkin.kube.com"
- ip: "10.46.102.138"
hostnames:
- "stg.dmz.iobs.paic.com.cn"
- "daas-auto.com"
- "j.api.autohome.com.cn"
- "test-api.pingan.com.cn"
- "test.chexiao.co"
- "testkc1.chexiao.co"
- "testkc3.chexiao.co"
- "workorder2016.lunztech.cn"
- "gatewayapi.lunztech.cn"
- "test-mapi.stg.1qianbao.com"
- ip: "10.49.163.100"
hostnames:
- "test-api-mop.chinaums.com"
- "ck-static.yun.pingan.com"
- "openapi.mall.autohome.com.cn"
- ip: "10.46.102.6"
hostnames:
- "test-cms-ptr.pingan.com.cn"
- "test-csms-ptr.pingan.com.cn"
containers:
- name: TemplateProject
image: ProjectImage
imagePullPolicy: IfNotPresent
ports:
- containerPort: APP_PORT
resources:
requests:
#cpu: "0.5"
memory: 1024Mi
limits:
#cpu: "1"
memory: 4096Mi
volumeMounts:
- name: logs
mountPath: "/wls/wls81/logs"
env:
- name: appport
value: "APP_PORT"
- name: appenv
value: "ENV"
- name: denv
value: "appdenv"
- name: cluster
value: "appcenv"
- name: nodeLable
value: "TemplateProject"
- name: APP_ID
value: "PROJECT_NS"
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- TemplateProject
topologyKey: "kubernetes.io/hostname"
volumes:
- name: logs
hostPath:
path: /data/logs
apiVersion: v1
kind: Service
metadata:
name: TemplateProject-ENV-service
namespace: PROJECT_NS
annotations:
#prometheus.io/scrape: "true"
#prometheus.io/port: "9121"
#prometheus.io/app-metrics: 'true'
#prometheus.io/app-metrics-path: "/actuator/prometheus"
spec:
selector:
app: TemplateProject
ports:
-
port: 80
targetPort: APP_PORT
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: TemplateProject-ENV
namespace: PROJECT_NS
spec:
rules:
-
host: TemplateProject-ENV.kube.com
http:
paths:
-
path: /
backend:
serviceName: TemplateProject-ENV-service
servicePort: 80
-