app.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: app
  5. labels:
  6. app: app
  7. env: release
  8. spec:
  9. selector:
  10. matchLabels:
  11. app: app
  12. replicas: 1
  13. strategy:
  14. type: RollingUpdate
  15. rollingUpdate:
  16. maxUnavailable: 0
  17. maxSurge: 1
  18. # minReadySeconds: 30
  19. template:
  20. metadata:
  21. labels:
  22. app: app
  23. spec:
  24. containers:
  25. - name: filebeat
  26. image: dotbalo/filebeat:5.5.2
  27. resources:
  28. requests:
  29. memory: "100Mi"
  30. cpu: "10m"
  31. limits:
  32. cpu: "200m"
  33. memory: "300Mi"
  34. imagePullPolicy: Always
  35. env:
  36. - name: POD_IP
  37. valueFrom:
  38. fieldRef:
  39. apiVersion: v1
  40. fieldPath: status.podIP
  41. - name: pod_name
  42. valueFrom:
  43. fieldRef:
  44. apiVersion: v1
  45. fieldPath: metadata.name
  46. - name: TZ
  47. value: "Asia/Shanghai"
  48. securityContext:
  49. runAsUser: 0
  50. volumeMounts:
  51. - name: logpath
  52. mountPath: /data/log/app/
  53. - name: filebeatconf
  54. mountPath: /filebeat.yml
  55. subPath: usr/share/filebeat/filebeat.yml
  56. - name: app
  57. image: alpine:3.6
  58. imagePullPolicy: IfNotPresent
  59. volumeMounts:
  60. - name: logpath
  61. mountPath: /home/tomcat/target/
  62. - name: tz-config
  63. mountPath: /etc/localtime
  64. - mountPath: /usr/share/zoneinfo/Asia/Shanghai
  65. name: tz-config
  66. - mountPath: /etc/timezone
  67. name: timezone
  68. env:
  69. - name: TZ
  70. value: "Asia/Shanghai"
  71. - name: LANG
  72. value: C.UTF-8
  73. - name: LC_ALL
  74. value: C.UTF-8
  75. - name: ENV
  76. value: k8srelease
  77. - name: XMS
  78. value: "2048m"
  79. - name: XMX
  80. value: "2048m"
  81. - name: MEMORY_LIMIT
  82. valueFrom:
  83. resourceFieldRef:
  84. resource: requests.memory
  85. divisor: 1Mi
  86. command:
  87. - sh
  88. - -c
  89. - sleep 360000
  90. ports:
  91. - containerPort: 8080
  92. name: tomcat
  93. # livenessProbe:
  94. # tcpSocket:
  95. # port: tomcat
  96. # initialDelaySeconds: 180
  97. # timeoutSeconds: 2
  98. # failureThreshold: 2
  99. # readinessProbe:
  100. # tcpSocket:
  101. # port: tomcat
  102. # initialDelaySeconds: 180
  103. # timeoutSeconds: 2
  104. # failureThreshold: 2
  105. imagePullSecrets:
  106. - name: myregistrykey
  107. volumes:
  108. - name: tz-config
  109. hostPath:
  110. path: /usr/share/zoneinfo/Asia/Shanghai
  111. - hostPath:
  112. path: /etc/timezone
  113. type: ""
  114. name: timezone
  115. - name: logpath
  116. emptyDir: {}
  117. - name: filebeatconf
  118. configMap:
  119. name: filebeatconf
  120. items:
  121. - key: filebeat.yml
  122. path: usr/share/filebeat/filebeat.yml