deploy-tmp.yaml 2.8 KB

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