deploy-tmp.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ---
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: nginx-material
  6. namespace: pro
  7. labels:
  8. app: nginx-material
  9. spec:
  10. serviceName: nginx-material
  11. replicas: 1
  12. selector:
  13. matchLabels:
  14. app: nginx-material
  15. template:
  16. metadata:
  17. labels:
  18. app: nginx-material
  19. spec:
  20. terminationGracePeriodSeconds: 180
  21. initContainers:
  22. - name: init
  23. image: hub.evbj.easou.com/dev/busybox
  24. command: [ "chmod","777","-R","/data" ]
  25. imagePullPolicy: IfNotPresent
  26. volumeMounts:
  27. - name: volume
  28. mountPath: /data
  29. #nodeSelector:
  30. # app.touchrs: touchrs
  31. # affinity:
  32. # podAntiAffinity:
  33. # preferredDuringSchedulingIgnoredDuringExecution:
  34. # - weight: 100
  35. # podAffinityTerm:
  36. # labelSelector:
  37. # matchExpressions:
  38. # - key: app
  39. # operator: In
  40. # values:
  41. # - nginx-material
  42. # topologyKey: kubernetes.io/hostname
  43. containers:
  44. - name: nginx-material
  45. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  46. imagePullPolicy: IfNotPresent
  47. ports:
  48. - containerPort: 80
  49. name: port
  50. volumeMounts:
  51. - name: volume
  52. mountPath: /data
  53. readinessProbe:
  54. tcpSocket:
  55. port: 80
  56. initialDelaySeconds: 40
  57. periodSeconds: 15
  58. # - image: hub.evbj.easou.com/pro/filebeat:7.13.3
  59. # imagePullPolicy: IfNotPresent
  60. # name: filebeat
  61. # volumeMounts:
  62. # - name: volume #日志同时挂载在nginx和filebeat中
  63. # mountPath: /data
  64. # - name: filebeat-config
  65. # mountPath: /usr/share/filebeat/filebeat.yml
  66. # subPath: filebeat.yml
  67. volumeClaimTemplates:
  68. - metadata:
  69. name: volume
  70. spec:
  71. accessModes: [ "ReadWriteOnce" ]
  72. storageClassName: ceph-block
  73. resources:
  74. requests:
  75. storage: 100Gi
  76. ---
  77. apiVersion: v1
  78. kind: Service
  79. metadata:
  80. name: nginx-material-svc
  81. namespace: pro
  82. labels:
  83. app: nginx-material-svc
  84. spec:
  85. type: NodePort
  86. ports:
  87. - port: 80
  88. targetPort: 80
  89. name: "main"
  90. selector:
  91. app: nginx-material
  92. ---
  93. apiVersion: networking.k8s.io/v1
  94. kind: Ingress
  95. metadata:
  96. name: nginx-material-ingress
  97. namespace: pro
  98. spec:
  99. rules:
  100. - host: material.ieasou.cn
  101. http:
  102. paths:
  103. - path: /
  104. pathType: Prefix
  105. backend:
  106. service:
  107. name: nginx-material-svc
  108. port:
  109. number: 8080
  110. ingressClassName: nginx