svc-dolphinscheduler-worker-headless.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. apiVersion: v1
  18. kind: Service
  19. metadata:
  20. name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
  21. labels:
  22. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
  23. {{- include "dolphinscheduler.common.labels" . | nindent 4 }}
  24. {{- if .Values.worker.service.annotations }}
  25. annotations: {{- toYaml .Values.worker.service.annotations | nindent 4 }}
  26. {{- end }}
  27. spec:
  28. clusterIP: "None"
  29. ports:
  30. - port: 1234
  31. targetPort: worker-port
  32. protocol: TCP
  33. name: worker-port
  34. - port: 1235
  35. targetPort: actuator-port
  36. protocol: TCP
  37. name: actuator-port
  38. selector:
  39. {{- include "dolphinscheduler.worker.labels" . | nindent 4 }}
  40. ---
  41. {{- if .Values.worker.service.serviceMonitor.enabled }}
  42. apiVersion: monitoring.coreos.com/v1
  43. kind: ServiceMonitor
  44. metadata:
  45. name: {{ include "dolphinscheduler.fullname" . }}-worker
  46. namespace: {{ .Release.Namespace }}
  47. labels:
  48. {{- include "dolphinscheduler.common.labels" . | nindent 4 }}
  49. {{- if .Values.worker.service.serviceMonitor.labels }}
  50. {{- toYaml .Values.worker.service.serviceMonitor.labels | nindent 4 }}
  51. {{- end }}
  52. {{- if .Values.worker.service.serviceMonitor.annotations }}
  53. annotations: {{- toYaml .Values.worker.service.serviceMonitor.annotations | nindent 4 }}
  54. {{- end }}
  55. spec:
  56. namespaceSelector:
  57. matchNames:
  58. - {{ .Values.worker.service.serviceMonitor.namespace | default .Release.Namespace }}
  59. selector:
  60. matchLabels:
  61. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-worker-headless
  62. {{- include "dolphinscheduler.common.labels" . | nindent 6 }}
  63. endpoints:
  64. - scheme: http
  65. targetPort: actuator-port
  66. path: {{ .Values.worker.service.serviceMonitor.path }}
  67. interval: {{ .Values.worker.service.serviceMonitor.interval }}
  68. {{- end }}