deployment-hue.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: hue
  5. labels:
  6. deployment: hue
  7. {{ if .Values.monitoring.enabled }}
  8. annotations:
  9. "sidecar.jaegertracing.io/inject": "true"
  10. {{ end }}
  11. spec:
  12. selector:
  13. matchLabels:
  14. pod: hue
  15. replicas: {{ .Values.hue.replicas }}
  16. template:
  17. metadata:
  18. labels:
  19. pod: hue
  20. {{- with .Values.podLabels }}
  21. {{ toYaml . | indent 8 }}
  22. {{- end }}
  23. annotations:
  24. checksum/config: {{ include (print $.Template.BasePath "/configmap-hue.yaml") . | sha256sum }}
  25. checksum/config-extra: {{ include (print $.Template.BasePath "/configmap-hue-extra.yaml") . | sha256sum }}
  26. checksum/config-hive: {{ include (print $.Template.BasePath "/configmap-hive.yaml") . | sha256sum }}
  27. {{- with .Values.podAnnotations }}
  28. {{ toYaml . | indent 8 }}
  29. {{- end }}
  30. spec:
  31. {{ if eq .Values.hue.database.engine "postgresql_psycopg2" }}
  32. initContainers:
  33. - name: hue-init
  34. image: {{ .Values.image.registry }}/hue:{{ .Values.image.tag }}
  35. imagePullPolicy: {{ .Values.image.pullPolicy }}
  36. args:
  37. - /bin/sh
  38. - -c
  39. - >
  40. set -x;
  41. while [ $(curl -s --connect-timeout 1 {{ .Values.hue.database.host }}:{{ .Values.hue.database.port }} || echo $?) -ne 52 ]; do
  42. sleep 1;
  43. done
  44. {{ end }}
  45. containers:
  46. - name: hue
  47. image: {{ .Values.image.registry }}/hue:{{ .Values.image.tag }}
  48. imagePullPolicy: {{ .Values.image.pullPolicy }}
  49. ports:
  50. - containerPort: 8888
  51. resources:
  52. requests:
  53. # memory: "350Mi"
  54. cpu: "50m"
  55. volumeMounts:
  56. - name: config-volume
  57. mountPath: /usr/share/hue/desktop/conf/z-hue.ini
  58. subPath: hue-ini
  59. - name: config-volume-extra
  60. mountPath: /usr/share/hue/desktop/conf/zz-hue.ini
  61. subPath: hue-ini
  62. - name: hive-config-volume
  63. mountPath: /etc/hive/conf/hive-site.xml
  64. subPath: hive-site
  65. readinessProbe:
  66. httpGet:
  67. path: /desktop/debug/is_alive
  68. port: 8888
  69. initialDelaySeconds: 3
  70. periodSeconds: 3
  71. failureThreshold: 30
  72. {{ if .Values.balancer.enabled }}
  73. - name: nginx
  74. image: {{ .Values.image.registry }}/nginx:{{ .Values.image.tag }}
  75. imagePullPolicy: {{ .Values.image.pullPolicy }}
  76. ports:
  77. - containerPort: 80
  78. resources:
  79. requests:
  80. # memory: "64Mi"
  81. cpu: "20m"
  82. volumeMounts:
  83. - name: nginx-config
  84. mountPath: /etc/nginx/sites-available/hue
  85. subPath: hue
  86. {{ end }}
  87. volumes:
  88. - name: config-volume
  89. configMap:
  90. name: hue-config
  91. - name: config-volume-extra
  92. configMap:
  93. name: hue-config-extra
  94. - name: hive-config-volume
  95. configMap:
  96. name: hive-config
  97. {{ if .Values.balancer.enabled }}
  98. - name: nginx-config
  99. configMap:
  100. name: nginx-config
  101. {{ end }}