svc-dolphinscheduler-worker-headless.yaml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. {{- if and .Values.worker.enabled }}
  18. apiVersion: v1
  19. kind: Service
  20. metadata:
  21. name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
  22. labels:
  23. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
  24. {{- include "dolphinscheduler.common.labels" . | nindent 4 }}
  25. {{- if .Values.worker.service.annotations }}
  26. annotations: {{- toYaml .Values.worker.service.annotations | nindent 4 }}
  27. {{- end }}
  28. spec:
  29. clusterIP: "None"
  30. ports:
  31. - port: 1234
  32. targetPort: worker-port
  33. protocol: TCP
  34. name: worker-port
  35. - port: 1235
  36. targetPort: actuator-port
  37. protocol: TCP
  38. name: actuator-port
  39. selector:
  40. {{- include "dolphinscheduler.worker.labels" . | nindent 4 }}
  41. ---
  42. {{- if .Values.worker.service.serviceMonitor.enabled }}
  43. apiVersion: monitoring.coreos.com/v1
  44. kind: ServiceMonitor
  45. metadata:
  46. name: {{ include "dolphinscheduler.fullname" . }}-worker
  47. namespace: {{ .Release.Namespace }}
  48. labels:
  49. {{- include "dolphinscheduler.common.labels" . | nindent 4 }}
  50. {{- if .Values.worker.service.serviceMonitor.labels }}
  51. {{- toYaml .Values.worker.service.serviceMonitor.labels | nindent 4 }}
  52. {{- end }}
  53. {{- if .Values.worker.service.serviceMonitor.annotations }}
  54. annotations: {{- toYaml .Values.worker.service.serviceMonitor.annotations | nindent 4 }}
  55. {{- end }}
  56. spec:
  57. namespaceSelector:
  58. matchNames:
  59. - {{ .Values.worker.service.serviceMonitor.namespace | default .Release.Namespace }}
  60. selector:
  61. matchLabels:
  62. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
  63. {{- include "dolphinscheduler.common.labels" . | nindent 6 }}
  64. endpoints:
  65. - scheme: http
  66. targetPort: actuator-port
  67. path: {{ .Values.worker.service.serviceMonitor.path }}
  68. interval: {{ .Values.worker.service.serviceMonitor.interval }}
  69. {{- end }}
  70. {{- end }}