deploy-tmp.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ---
  2. apiVersion: apps/v1
  3. kind: $JNLP_CONTROL
  4. metadata:
  5. name: $DRONE_REPO_NAME
  6. namespace: $JNLP_ENV
  7. labels:
  8. app: $DRONE_REPO_NAME
  9. spec:
  10. serviceName: $DRONE_REPO_NAME
  11. replicas: $JNLP_REPLICAS
  12. selector:
  13. matchLabels:
  14. app: $DRONE_REPO_NAME
  15. template:
  16. metadata:
  17. labels:
  18. app: $DRONE_REPO_NAME
  19. spec:
  20. affinity:
  21. podAntiAffinity:
  22. requiredDuringSchedulingIgnoredDuringExecution:
  23. - labelSelector:
  24. matchExpressions:
  25. - key: app
  26. operator: In
  27. values:
  28. - book-duiba
  29. topologyKey: kubernetes.io/hostname
  30. terminationGracePeriodSeconds: 180
  31. dnsPolicy: None
  32. dnsConfig:
  33. nameservers:
  34. - 223.5.5.5
  35. - 10.26.22.50
  36. initContainers:
  37. - name: init
  38. image: $JNLP_REPO/dev/busybox
  39. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  40. imagePullPolicy: Always
  41. volumeMounts:
  42. - name: volume
  43. mountPath: $JNLP_MOUNT_PATH
  44. #nodeSelector:
  45. # app.touchrs: touchrs
  46. containers:
  47. - name: $DRONE_REPO_NAME
  48. image: hub.evbj.easou.com/pro/book-duiba:v1.1.63
  49. imagePullPolicy: Always
  50. ports:
  51. - containerPort: $JNLP_CONTAINER_PORT
  52. name: port
  53. volumeMounts:
  54. - name: volume
  55. mountPath: $JNLP_MOUNT_PATH
  56. livenessProbe:
  57. tcpSocket:
  58. port: $JNLP_CONTAINER_PORT
  59. initialDelaySeconds: $JNLP_LIVENESS_INIT
  60. periodSeconds: $JNLP_LIVENESS_PER
  61. readinessProbe:
  62. tcpSocket:
  63. port: $JNLP_CONTAINER_PORT
  64. initialDelaySeconds: $JNLP_READINESS_INIT
  65. periodSeconds: $JNLP_READINESS_PER
  66. volumeClaimTemplates:
  67. - metadata:
  68. name: volume
  69. spec:
  70. accessModes: ["ReadWriteOnce"]
  71. storageClassName: rbd
  72. # storageClassName: ceph-block
  73. resources:
  74. requests:
  75. storage: $JNLP_STORAGE_CAPACITY
  76. ---
  77. apiVersion: v1
  78. kind: Service
  79. metadata:
  80. name: $DRONE_REPO_NAME-svc
  81. namespace: $JNLP_ENV
  82. labels:
  83. app: $DRONE_REPO_NAME-svc
  84. spec:
  85. type: NodePort
  86. ports:
  87. - port: $JNLP_CONTAINER_PORT
  88. targetPort: $JNLP_CONTAINER_PORT
  89. selector:
  90. app: $DRONE_REPO_NAME
  91. ---
  92. kind: Ingress
  93. apiVersion: networking.k8s.io/v1
  94. metadata:
  95. name: $DRONE_REPO_NAME-ingress
  96. namespace: $JNLP_ENV
  97. spec:
  98. rules:
  99. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  100. http:
  101. paths:
  102. - path: /
  103. pathType: Prefix
  104. backend:
  105. service:
  106. name: $DRONE_REPO_NAME-svc
  107. port:
  108. number: $JNLP_CONTAINER_PORT
  109. ingressClassName: nginx