deploy-tmp.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. terminationGracePeriodSeconds: 180
  21. affinity:
  22. podAntiAffinity:
  23. preferredDuringSchedulingIgnoredDuringExecution:
  24. - weight: 100
  25. podAffinityTerm:
  26. labelSelector:
  27. matchExpressions:
  28. - key: app
  29. operator: In
  30. values:
  31. - dashouye
  32. topologyKey: kubernetes.io/hostname
  33. initContainers:
  34. - name: init
  35. image: $JNLP_REPO/dev/busybox
  36. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  37. imagePullPolicy: Always
  38. volumeMounts:
  39. - name: volume
  40. mountPath: $JNLP_MOUNT_PATH
  41. containers:
  42. - name: $DRONE_REPO_NAME
  43. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  44. imagePullPolicy: Always
  45. ports:
  46. - containerPort: $JNLP_CONTAINER_PORT
  47. name: port
  48. volumeMounts:
  49. - name: volume
  50. mountPath: $JNLP_MOUNT_PATH
  51. livenessProbe:
  52. tcpSocket:
  53. port: $JNLP_CONTAINER_PORT
  54. initialDelaySeconds: $JNLP_LIVENESS_INIT
  55. periodSeconds: $JNLP_LIVENESS_PER
  56. readinessProbe:
  57. tcpSocket:
  58. port: $JNLP_CONTAINER_PORT
  59. initialDelaySeconds: $JNLP_READINESS_INIT
  60. periodSeconds: $JNLP_READINESS_PER
  61. volumeClaimTemplates:
  62. - metadata:
  63. name: volume
  64. spec:
  65. accessModes: ["ReadWriteOnce"]
  66. storageClassName: rbd
  67. resources:
  68. requests:
  69. storage: $JNLP_STORAGE_CAPACITY
  70. ---
  71. apiVersion: v1
  72. kind: Service
  73. metadata:
  74. name: $DRONE_REPO_NAME-svc
  75. namespace: $JNLP_ENV
  76. labels:
  77. app: $DRONE_REPO_NAME-svc
  78. spec:
  79. type: NodePort
  80. ports:
  81. - port: $JNLP_CONTAINER_PORT
  82. targetPort: $JNLP_CONTAINER_PORT
  83. selector:
  84. app: $DRONE_REPO_NAME