Commit 4c594c63 by wangtingwei

first submit

0 parents
Showing with 121 additions and 0 deletions
apiVersion: v1
kind: ConfigMap
metadata:
namespace: kpl
name: cfg-kpl-notice
data:
application-notice.yaml: |
notice:
smtp:
host: smtp.163.com
port: 25
from: czguoshuai@163.com
user: czguoshuai@163.com
password: RXUCHLSHWNEFQJSC
timeout: 10000
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: kpl-notice-api
namespace: kpl
spec:
selector:
matchLabels:
app: kpl-notice-api
replicas: 1
minReadySeconds: 10
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: kpl-notice-api
podAntiAffinity: kpl-notice-api
spec:
# hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
# hostAliases:
# - ip:
# hostnames:
# -
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: podAntiAffinity
operator: In
values:
- kpl-notice-api
topologyKey: kubernetes.io/hostname
initContainers:
- name: package-jar
image: hub.kce.ksyun.com/aivc-kpl/aivc-notice-api:tmp_v1.0
command: ['cp', '-rf', '/data/aivc-notice-api/', '/app/aivc-notice-api/']
volumeMounts:
- mountPath: /app/
name: app-volume
containers:
- name: kpl-notice-api
image: hub.kce.ksyun.com/aivc-kpl/java8_base:v1.2
imagePullPolicy: Always
volumeMounts:
- mountPath: /app/
name: app-volume
- mountPath: /data/logs/aivc-notice-api/
name: log-volume
- mountPath: /data/config/
name: cfg-kpl-notice
resources:
limits:
memory: "4G"
cpu: "2"
requests:
memory: "0G"
cpu: "0"
command:
- /bin/bash
- -ce
- java -jar -XX:-OmitStackTraceInFastThrow -Xmx2G -Xms2G -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseG1GC -Xloggc:/data/logs/aivc-notice-api/aivc-notice-api-gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/logs/aivc-notice-api/ /app/aivc-notice-api/aivc-notice-api-1.0.0.jar --spring.profiles.active=prd --spring.config.location=classpath:/,/data/config/application-notice.yaml
# env:
# - name: TZ
# value: Asia/shanghai
volumes:
- name: app-volume
emptyDir: {}
- name: log-volume
hostPath:
path: /data/logs/
type: DirectoryOrCreate
- name: cfg-kpl-notice
configMap:
name: cfg-kpl-notice
imagePullSecrets:
- name: harbor-secret
# nodeSelector:
# aivc-notice: "true"
---
apiVersion: v1
kind: Service
metadata:
name: kpl-notice-api-svc
namespace: kpl
spec:
type: NodePort
selector:
app: kpl-notice-api
ports:
- protocol: TCP
# (集群内部端口)
port: 8080
# (pod 上的端口)
targetPort: 8080
nodePort: 30950
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!