adm-middleware-dev.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: adm-middleware
  6. labels:
  7. app: adm-middleware
  8. spec:
  9. selector:
  10. app: adm-middleware
  11. ---
  12. apiVersion: apps/v1
  13. kind: Deployment
  14. metadata:
  15. name: adm-middleware
  16. spec:
  17. replicas: 1
  18. selector:
  19. matchLabels:
  20. app: adm-middleware
  21. template:
  22. metadata:
  23. labels:
  24. app: adm-middleware
  25. spec:
  26. hostAliases:
  27. - ip: "192.168.100.90"
  28. hostnames:
  29. - "node1"
  30. - "namenode"
  31. - "secondarynamenode"
  32. - "zookeeper1"
  33. - ip: "192.168.100.91"
  34. hostnames:
  35. - "node2"
  36. - "datanode1"
  37. - "zookeeper2"
  38. - ip: "192.168.100.92"
  39. hostnames:
  40. - "node3"
  41. - "datanode2"
  42. - "zookeeper3"
  43. volumes:
  44. - name: springcloud
  45. configMap:
  46. name: springcloud
  47. defaultMode: 0777
  48. items:
  49. - key: bootstrap.yml
  50. path: path/to/application.yml
  51. containers:
  52. - name: adm-middleware
  53. image: labisenlin.persagy.com/library/adm-middleware:latest
  54. imagePullPolicy: Always
  55. volumeMounts:
  56. - name: springcloud
  57. mountPath: /data/SpringCloud/bootstarp.yml
  58. subPath: path/to/application.yml
  59. env:
  60. - name: TZ
  61. value: Asia/Shanghai
  62. - name: JAVA_OPTS
  63. value: -Dfile.encoding=UTF-8
  64. - name: SERVER_PORT
  65. value: "8876"
  66. - name: SPRING_CLOUD_CONFIG_URI
  67. valueFrom:
  68. configMapKeyRef:
  69. name: adm-middleware
  70. key: spring.cloud.config.uri
  71. - name: SPRING_PROFILES_ACTIVE
  72. valueFrom:
  73. configMapKeyRef:
  74. name: adm-middleware
  75. key: spring.profiles.active
  76. - name: SPRING_CLOUD_CONFIG_PROFILE
  77. valueFrom:
  78. configMapKeyRef:
  79. name: adm-middleware
  80. key: spring.cloud.config.profile
  81. - name: EUREKA_CLIENT_FETCH_REGISTRY
  82. valueFrom:
  83. configMapKeyRef:
  84. name: adm-middleware
  85. key: eureka.client.fetch-registry
  86. - name: EUREKA_CLIENT_REGISTER_WITH_EUREKA
  87. valueFrom:
  88. configMapKeyRef:
  89. name: adm-middleware
  90. key: eureka.client.register-with-eureka
  91. - name: EUREKA_CLIENT_DEFAULT_ZONE
  92. valueFrom:
  93. configMapKeyRef:
  94. name: adm-middleware
  95. key: eureka.client.default.zone
  96. - name: EUREKA_INSTANCE_IP_ADDRESS
  97. valueFrom:
  98. configMapKeyRef:
  99. name: adm-middleware
  100. key: eureka.instance.ip.address