deploy-tmp.yaml 2.8 KB

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